Details of a thread in Powershell

Welcome Forums General PowerShell Q&A Details of a thread in Powershell

This topic contains 2 replies, has 2 voices, and was last updated by

 
Participant
4 years, 8 months ago.

  • Author
    Posts
  • #12794

    Participant
    Points: 0
    Rank: Member

    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

    Member
    Points: 0
    Rank: Member

    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

    Participant
    Points: 0
    Rank: Member

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

The topic ‘Details of a thread in Powershell’ is closed to new replies.