Details of a thread in Powershell

This topic contains 2 replies, has 2 voices, and was last updated by Profile photo of Ayan Mullick Ayan Mullick 3 years, 4 months ago.

  • Author
    Posts
  • #12794
    Profile photo of Ayan Mullick
    Ayan Mullick
    Participant

    How can I get the CPU consumption of all threads running in a process thru powershell, in a format similar to this.

    I can't find any processor information when I run

     (gwmi win32_thread)[0]

    . And the "Start Address" is numeric !?!

  • #12796
    Profile photo of Dave Wyatt
    Dave Wyatt
    Moderator

    You'll probably need to query performance counters for this information. Check out the Win32_PerfFormattedData_PerfProc_Thread class. It has (among other things), PercentPrivilegedTime, PercentUserTime, and PercentProcessorTime properties.

    "Start Address" is always numeric, but it's possible to translate that into funciton names by reading debug symbol files. I've never actually written code to do that, and can't offer much help there. This blog post might be a good place start: http://blogs.msdn.com/b/jmstall/archive/2005/10/08/symbol-apis.aspx

  • #12825
    Profile photo of Ayan Mullick
    Ayan Mullick
    Participant

    Currently, is there any command line utility to view the "Start address" of a thread as function names.

You must be logged in to reply to this topic.