Ok, you found this guide because you see a high CPU usage in ProcessExplorer/Task manager.
If you see this:
ProcessExplorer_DPC_1.png 37.7KB 1035 downloads
you have an issue with a driver. To trace this, follow this guide:
Here you'll lean to see the cause of a Windows Exe/Service which causes a high CPU usage.
To get started you need the Windows Performance Tools Kit. Read here how to install it:
Now open a command prompt (cmd.exe) with admin rights, go to a directory like C:\temp and run the following commands:
xperf -on latency -stackwalk profile
now wait a time while the high CPU usage from an application occurs and wait a few seconds until enough data are traced.
To stop the trace run the following command:
xperf -d latency.etl
This closes the trace and writes the result to the file latency.etl.
In the next step, make a double click on the etl file to run the Viewer.
Now wait until the 2 passes are over.
Go to "Trace"->"Configure Symbol Paths" and type in the following:
Click ok, to close the dialog.
Now go to the graph "CPU sampling per CPU" and select the interval where you have the high CPU usage, make a right click and select "Load Symbols" and next click "clone selection". Make a rightclick again and select "summary tabke" and you see this:
CPUusage_xperfview_CPUSampling_per_Process.png 15.13KB 446 downloads
and look which process causes the CPU usage (Here it is the TrustedInstaller.exe)
Now, go to the first graph "Stack Counts by Type", make a right click and select Summary Table.
CPUusage_xperfview.png 10.69KB 421 downloads
Now, you have to accept the license agreement to download the public debugging symbols.
(NOTE, THE PDBs ARE SOMETIME VERY HUGE. BE AWARE THAT IT MAY TAKE SOME TIME IF YOU HAVE A SLOW INTERNET CONNECTION.
Here you'll see summary of the calls (make sure you sort the data per Count: Sampled Profile) and locate the Process from the former summary table which causes the high CPU usage. The important thing is the "Stack". Expand the view until the count number reduces much and you see this:
xperfview_cpuusage_stack.png 61.81KB 743 downloads
For me, the high CPU usage from explorer is caused while searching for installed apps to show them inside the Software- Add/remove Dialog (CreateItemIDFromInstalledApps).
If you can't see Thread names in the stack, the PDBs are missing. So if the issue occurs in a Microsoft application like Office or MSE, the required symbols are not available on the symbol server so you can't find the cause.
If you have high CPU usage in Firefox add the this:
to the symbol path in xperfview and load the symbols again to see more.
If you develop your own tool, add the path to your PDB files which generated the VC++ compiler for you.
If no symbols are available, look at the filename to see which program it is and run this command:
xperf -I latency.etl -a fileversion > fileversion.txt
Now open the fileversion.txt and search for the program. Now look at the fileversion, to a bing/google search to see if this is the latest version of the program. If not, update it and see if this update fixes it. If you use the latest version and the issue is not fixed contact the support and send the etl to them, so that they can see the cause of the high CPU usage in their applications.
// Edit 2010-03-22
To enable Stackwalk on a x64 Windows, you have to set a registry value. Start Regedit.exe and go to the following key:
HKLM\System\CurrentControlSet\Control\Session Manager\Memory Management
and create a DWORD (if it not already exists) DisablePagingExecutive and set the value to 1 and reboot to enable the setting.
The Debugging Team made a Video about this too. Check it out:
Edited by MagicAndre1981, 30 July 2011 - 07:17 AM.