none
Retrieving CPU usage from a specific thread RRS feed

All replies

  • pslist -d

    Friday, May 10, 2019 4:24 PM
  • I've tried this one but maybe I didn't understand the result. It shows for instance:

     Tid Pri    Cswtch            State     User Time   Kernel Time   Elapsed Time
    7248  12   1442214     Wait:UserReq  0:00:17.718   0:00:24.453  195:28:20.152

    How can I figure out the CPU usage at the moment?

    Friday, May 10, 2019 4:28 PM
  • Looks like you would have to write a script to call pslist, parse the output, sleep for a period of time, call pslist again, and then calculate the difference. 

    I'll revert back to my favorite question... what's the real problem that you are trying to solve? 

    Friday, May 10, 2019 4:49 PM
  • Understood.

    I have a program that sometimes after some days it freezes. In the beginning of the execution, I log all my threads ID in a text file. With this I am intend to figure out which thread is consuming a lot of CPU (freeze signal). 

    I have a second application, Watchdog application, that monitores the first (main) application, there is communication between them. The watchdog detects something is wrong (lack of communication for instance) and restart the main application. But before restart the first application I would like to collect some useful information to figure out which thread is doing something wrong.

    Sometimes it took an entire month before freezing...

    Friday, May 10, 2019 5:31 PM
  • Use procdump and get a dump of the entire process memory. https://docs.microsoft.com/en-us/sysinternals/downloads/procdump

    Then you can load it into Windbg and look at call stacks and threads.

    I've also had good luck analyzing dumps with debugdiag. https://www.microsoft.com/en-us/download/details.aspx?id=58210

     

    Friday, May 10, 2019 6:02 PM
  • Ok,

    tks for your reply

    Friday, May 10, 2019 6:58 PM