-2

I want to analyze performance of long process (6-8 hours). I need information about created/finished processes (with command lines) and CPU utilization.

I found, that Windows Performance Analyzer (wpa.exe/xperfview.exe) is great tool for analyzing. I create performance data collector, select provider 'Windows Kernel Trace', keyword 'process' and got information about processes.

But I can't find how to collect information about CPU utilization with sampling. I know, that

xperf.exe -on Base

collect CPU information, but it generate too much information...

Also I can collect CPU utilization with performance counters as *.blg file, but I can't load this file into Windows Performance Analyzer. :(

Any ideas?

David Jones
  • 4,766
  • 3
  • 32
  • 45
Sergey Azarkevich
  • 2,641
  • 2
  • 22
  • 38

1 Answers1

3

You can get the CPU sampling with Stacks with this command from a command prompt (cmd.exe), running as admin:

xperf -on PROC_THREAD+LOADER+PROFILE -stackwalk profile -buffersize 1024 -MaxFile 1024 -FileMode Circular && timeout -1 && xperf -d C:\HighCPUUsage.etl

This creates a file with max size of 1GB. Xperf/ETW is not working well for long term analysis, because the files are getting too large. So, run the command, and if you see a high CPU usage in Taskmgr, press key to stop logging. Open the ETL in WPA.exe and now you see the last minutes.

magicandre1981
  • 27,895
  • 5
  • 86
  • 127
  • 1
    This command generate ~2MB per second. I need gather information for ~6 hours. So finally I will have ~40GB .etl file (MaxFile should be increased of course) which I hardly be able to load to wpa.exe.... – Sergey Azarkevich Feb 04 '15 at 22:10
  • 1
    divide the issue into smaller parts. Do what I told you and run a shorter trace and find out what is causing here the CPU usage. Now fix this in your code and watch the CPU usage again. If you still have issues, repeat this until you fixed all issues. – magicandre1981 Feb 05 '15 at 06:20
  • 1
    As I say in question - it generate too much information. This is not a code problem - I want to get a quick overview of nightly build procedure perfromance. I can't spend 40 days (measure procedure 40 times) for quick investigation. – Sergey Azarkevich Feb 05 '15 at 07:48
  • again, divide the issue into smaller parts. Capture several smaller traces and analyze the CPU usage and see if it is the same. – magicandre1981 Feb 05 '15 at 16:45
  • 1
    OK. When I will have the extra 40 days I recall you advice. – Sergey Azarkevich Feb 06 '15 at 04:16