I would like to monitor the process' threads performance including the child threads. Is it possible with perfmon? Currently it seams to only start monitoring already open threads.
1 Answer
Perfmon is pretty rudimentary. It allows you to view existing performance counter values, but it won't dynamically add and subtract counters for you.
What you probably want is an application that will dynamically add new counter values for you, such as when a new thread is launched within a process, you want to add that new thread to the counter set. Sysinternals Process Explorer will do this, if you look at the properties of a process and navigate to the Threads tab. New threads show up highlighted in green for a few seconds, and threads are highlighted in red for a few seconds when they exit.
You could also implement a more crude system yourself with WMI or Powershell... something that loops every couple seconds...
(Get-Process Powershell).Threads | Select Id, TotalProcessorTime | FT -Autosize
Id TotalProcessorTime
-- ------------------
2184 00:00:00.1562500
4316 00:00:00
2848 00:00:00
3604 00:00:00
1456 00:00:00.0156250
4564 00:00:00
3216 00:00:00.7968750
1396 00:00:00