Create a performance trace

Performance traces can help to figure out, which processes slow down the system. To create a performance trace, we use XPERF and NETSH commands. NETSH is part of the operating system while XPERF is a part of the Windows ADK (Assessment and Deployment Kit) and needs to be downloaded and installed. Find the latest version of the ADK here: http://aka.ms/adk.

Let’s prepare your system.

  • Navigate to http://aks.ms/adk and scroll down to the option Other ADK downloads.
  • Select the ADK that matches your operating system. Note that all Windows 10 versions newer than 2004 must use the ADK for Windows 10 2004.
  • During setup leave everything default. When it comes to the features, select Windows Performance Toolkit as the only option.
  • After successful installation, you can find XPerf.exe in C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit

Create the trace

In this example we capture the system performance and the network traffic. XPERF captures CPU, memory, disk and so on while NETSH logs network traffic.

  • I recommend to open two command prompts in administrative mode.
  • In the first command prompt type
    XPERF.exe -on BASE+FILE_IO+PERF_COUNTER
    Do not press RETURN yet. In the second command prompt type
    NETSH trace start capture=yes scenario=netconnection maxsize=2048 tracefile=c:\NetSH.etl
  • Press RETURN in both windows in close succession.
  • Traces are running in the background. You can now start to reproduce the scenario you would like to capture.
  • In the meanwhile, you can prepare the command prompts for the stop commands. Type following command in the first window but do not hit RETURN.
    XPERF.exe -d C:\XPerf.etl
    In the second command prompt, also without pressing RETURN, type:
    NETSH trace stop
  • After a successful reproduction, stop and save the traces by pressing RETURN in both windows in close succession.
  • When both traces have been saved to disk, merge them to one single trace file by typing following command in one of the open command prompts:
    XPERF merge C:\XPerf.etl C:\NetSH.etl C:\Performance.etl
  • For easier delivery, compress the C:\Performance.etl using a zip tool (i.e. 7ZIP)

Posted

in

by

Tags:

Comments

Leave a Reply