This article discusses the features of Windows Performance Recorder (WPR) and Windows Performance Analyzer (WPA) and provides examples of how to apply those features when you troubleshoot.
Applies to: All supported versions of Windows Server and Windows Client
Summary
WPR and WPA are performance monitoring tools that produce in-depth performance profiles of Windows operating systems and applications. Windows includes a command-line version of WPR. To get WPA and a GUI version of WPR (that's shown in the examples in this article), download and install the Windows Assessment and Deployment Kit (WADK).
Note:
The previous command-line tool, Xperf, is still supported for collecting data and is included in the WADK. However, Xperfview is no longer supported. Use WPA to view Xperf recordings.For information about how to use Xperf, see Xperf Command-Line Reference.
Prerequisites
To run the WPT tools, your system must meet the following requirements:
- WPR: Windows 8 or later.
- WPA: Windows 8 or later with the Microsoft .NET Framework 4.5 or later.
Using WPR to record data
WPR is a powerful recording tool that creates Event Tracing for Windows (ETW) recordings of system and application behavior and resource usage. WPR provides built-in profiles that you can use to select the events that are to be recorded. Alternatively, you can author custom profiles in XML. For more information, see the following documentation.
| Topic | Link |
|---|---|
| Quick start of basic procedures | WPR How-to Topics |
| Descriptions of the built-in recording profiles | Built-in Recording Profiles |
| Complete documentation of the WPR user interface | WPR Features |
| Reference of command-line options | WPR Command-Line Options |
| Discussion of key scenarios | WPR ScenariosPerformance Scenarios |
| Descriptions of the logging modes (Memory mode or File mode) | Logging ModeChange the Logging Mode |
| Complete reference material, including a recording profile XML reference and a legacy Xperf reference | WPR Technical Reference |
You can run WPR from the user interface (WPRUI.exe) or the command line (WPR.exe). The WPR UI makes it simple to generate a recording by using built-in recording profiles to analyze CPU usage, power issues, poor system or application performance, and other performance issues. WPRUI.exe is available in the WADK. WPR.exe ships together with the Windows operating system (Windows 8.1 or a later version) and doesn't require additional installation.
To start a recording, follow these steps:
-
Select Start, enter Windows Performance Recorder, and then select Windows Performance Recorder in the search results.
-
Do one of the following:
-
To record while using the default (First-level triage) profile, select Start.
:::image type="content" source="media/support-tools-xperf-wpa-wpr/wpr-record-simplified.png" alt-text="Screenshot that shows the condensed view of W.P.R.":::
-
To select a different profile or set other options, select More options. Select the options that you want, and then select Start.
:::image type="content" source="media/support-tools-xperf-wpa-wpr/wpr-record.png" alt-text="Screenshot that shows the expanded view of W.P.R.":::
-
To stop a recording, follow these steps:
- In WPR, select Save.
- Browse to the location to which you want to save the recording file.
- Enter a description of the problem for which you created the recording.
- Select Save, and then select Open in WPA or OK.
Using WPA to analyze data
WPA is a powerful analysis tool that combines a flexible UI with extensive graphing capabilities and data tables that can be pivoted and that have full text search capabilities. WPA provides an Issues window to explore the root cause of any identified issue. For more information, see the following documentation.
| Topic | Link |
|---|---|
| Basic procedures and a detailed walkthrough | WPA Quick Start Guide |
| Complete documentation of the WPA UI | WPA Features |
| Extended discussion of key scenarios | WPA Scenarios |
To open WPA, select Start, enter Windows Performance Analyzer, and then select Windows Performance Analyzer in the search results.
If you didn't open WPA directly from WPR after you saved a recording, you can use the WPA File menu to open a trace file.
Note:
To load symbols for analysis, select Trace, and then select Load Symbols. For more information, see Load Symbols or Configure Symbol Paths.
The WPA user interface (UI) includes docked windows that surround a central workspace. This workspace contains Analysis tabs. All windows can be docked in different locations. To open a closed window, select the window on the Window menu. WPA uses the following windows and tabs.
| Window or tab | Description |
|---|---|
| Graph Explorer | Contains thumbnails of all the graphs that apply to the current recording. The graphs are grouped into categories. To expand a category, select the triangle in the upper left corner of the thumbnail. For more information, see Graph Explorer. |
| Analysis | Displays detailed information and legends for trace recordings. You can drag graphs from the Graph Explorer to the Analysis tab. The tab displays the information in graph and pivot table format. In the tables, the vertical gold bar separates keys from data. The vertical blue bar separates pivot table data from graphing elements. For more information, see Analysis Tab. |
| Analysis Assistant | Displays information about the currently selected graph and table. For more information, see Analysis Assistant. |
| Issues | Available for Assessment Platform recordings, and lists issues that the assessment identifies. For more information, see Issues Window. |
| Details | Available for Assessment Platform recordings, and lists details and recommended solutions for the selected issue. For more information, see Details Window. |
| Diagnostic Console | Provides a list of exceptions in the recording and details related to symbol loading and decoding. For more information, see Diagnostic Console Window. |
Examples
The following table describes several problem scenarios, the WPR profiles that you can use for recording data, and suggested graphs and pivot table fields to analyze the data.
| Scenario | WPR profile | Graph and parameters to analyze |
|---|---|---|
| High CPU usage | Default profile (First Level Triage) and/or CPU Usage | Computation > CPU Usage (Sampled)Key options:<ul><li>Process > Stack (list activities by process, then by all threads in that process)</li><li>Process > Thread ID > Stack (list activities by process on each thread individually)</li><li>Process Name > Stack (list activities by all threads in all processes associated with a given name</li></ul>Data: Count (Sort by) |
| Virtual allocation leak | VirtualAlloc usage | Memory > VirtualAlloc Commit LifeTimesKeys: Type, Process, StackData: Count (Sort by), Impacting Size (MB) |
| Pool leak | Pool usage | Memory > PoolKeys: Type, Paged, Pool Tag, StackData: Count (Sum), Impacting Size (MB) |
| Handle leak | Handle usage | Memory > HandlesKeys: Creating Process, Handle Type, Create StackData: Object Name, Object, HandleGraph element (right of blue bar): Count |
| Heap leak | Heap usageTracing flags* | Memory > Heap AllocationsKeys: Type, Process, StackData: Count, Impacting Size (B) Sum |
| Wait analysis | Default profile (First Level Triage) or CPU Usage | Computation > CPU Usage (Precise)Keys: New Process, New Thread, New Stack, Readying Process, Readying Thread, Readying StackData: Wait(Max), Wait(Sum), Count(Waits) |
* To set the Tracing flags, open an administrative Command Prompt window, and then run the following commands:
reg add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\<Process_Name>" /v TracingFlags /t REG_DWORD /d 1 /f
reg add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\VirtMemTest64.exe" /v TracingFlags /t REG_DWORD /d 1 /f
Note:
In the first command, <Process_Name> represents the name of the service or process that you want to analyze.
After the commands run, restart the service or process.
Source: Microsoft Learn / IT Pro troubleshooting by Microsoft and contributors (upstream author metadata: kaushika-msft). Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.
