Windows 性能分析器(Windows Performance Analyzer)( WPA ) 工具是Windows 评估(Windows Assessment)和部署工具包(Deployment Kit)( Windows ADK )的一部分。它是您可以用来根据事件跟踪日志记录创建图表和表格的工具。您可以使用Xperf(Xperf)或Windows 性能记录器(Windows Performance Recorder)( WPR )等工具制作这些跟踪文件。如果您遇到系统性能问题,这些工具很有用。您还可以定期使用它们进行性能监控。
在本文中,您将学习如何使用WPR创建快速录音。您应该在要测试计算机性能的(the performance of your computer)活动期间启动此录制。这可能是启动游戏(launching a game)或其他应用程序,甚至运行您编写的程序。然后,我们将介绍如何使用WPA工具读取和分析该数据文件以进行故障排除。
安装和启动Microsoft Windows ADK 工具(Microsoft Windows ADK Tools)
安装WPA(WPA)和WPR的第一步是从 Microsoft 的 Windows Performance Toolkit 下载页面安装 Windows ADK(install Windows ADK from Microsoft’s download page for the Windows Performance Toolkit)。此工具来自Microsoft.com,因此安装完全安全。在逐步完成安装过程时,您需要选择要安装的组件。
只需确保选择了Windows Performance Toolkit,因为这包括您需要的两个工具。
选择Install后,该过程可能需要一些时间,因此请耐心等待。
Windows Performance Toolkit安装完成后,您就可以进行第一次WPR录制了。
注意(Note):对于此示例,我们安装了HeavyLoad 压力测试应用程序,以便在(HeavyLoad Stress Test app)WPR记录发生时将我们的系统置于重负载下。
在使用Microsoft Windows 性能分析器(Microsoft Windows Performance Analyzer)工具之前,您需要使用Windows 性能记录器(Windows Performance Recorder)来捕获事件跟踪日志记录(ETL文件)。此记录将包含所有Windows事件跟踪(Event Tracing)( ETW )事件。WPA分析有关CPU、内存、存储等的所有系统信息。
要启动WPR,请选择“开始(Start)”菜单并键入“Windows Performance Recorder”。接下来,选择Windows Performance Recorder应用程序。
WPR工具是一种简单的工具,可以捕获特定时间范围内系统上发生的事件。要开始录制,只需选择开始(Start)按钮。
这将启动系统事件记录过程。执行您想用来测试系统性能的(your system’s performance)操作(例如启动和运行程序) 。
完成后,只需返回WPR窗口并选择保存(Save)按钮。
下一步将显示ETL文件的路径。您可以在详细说明(detailed description)窗口中包含您正在排除故障或测试的内容的说明。
完成后,选择保存(Save)按钮。
该应用程序会将所有数据写入ETL文件,您将在窗口底部看到直接打开WPA工具或通过打开文件夹导航到ETL文件的选项。
立即进行性能分析的最方便的方法是选择“在 WPA 中打开”(Open in WPA)按钮。
使用Windows 性能分析器分析(Windows Performance Analyzer)ETL文件(ETL Files)
双击WPA应用程序并启动后,您就可以开始浏览和可视化ETL文件中的数据了。这是一个特殊的日志文件,只有某些应用程序可以打开。您无法使用Google Docs或Microsoft Word之类的工具查看它。
您会注意到左侧有四个主要类别的数据可供探索。您可以选择左侧的这些图表中的任何一个,以在右侧窗格中更详细地查看它们。
这些类别包括:
- 系统活动(System Activity):处理信息、后台任务、事件等。
- 计算:与(Computation)CPU内核相关的所有信息。
- 存储(Storage):磁盘使用信息。
- 内存(Memory):真实和虚拟内存使用情况。
- 电源(Power):处理器电源使用详情。
在每个图表(如CPU 使用情况(CPU Usage)图表)中,您可以将鼠标悬停在任何图表区域上以查看数据组件的细分,例如进程名称、进程活动时间和总体CPU使用百分比。
如果您从底部的列表中选择特定的进程名称,您将在图表中看到突出显示的区域,以确定进程消耗CPU资源的特定时间。这可以帮助确定操作系统进程或应用程序进程是否占用了所有CPU时间。
您还可以深入每个进程以查看特定的堆栈活动,上面的图表再次突出显示该堆栈正在积极使用CPU时间的区域。
WPA 中的可用图表
在左窗格的四个主要类别中,您将找到一个图形浏览器,可以帮助您分析和排除系统性能发生的问题。
我们已经介绍了上面的系统活动(System Activity)列表。在此下方,您将找到计算(Computation)类别。
在这里,您将找到以下子图表:
- CPU Usage (Sampled):以采样间隔采集 的CPU活动样本。(CPU)
- CPU 使用率(精确)(CPU Usage (Precise)):与特定正在运行的进程线程相关的 CPU 使用率。
- DPC/SR DurationDPC(DPCs) ) 的CPU 时间。
- CPU 使用率(归因)(CPU Usage (Attributed)):CPU 使用率分为几类。
同样,您可以选择这些子图表中的任何一个以在右侧显示它们。或者,您可以进一步深入了解与这些领域中的每一个相关的更多子图表。
存储(Storage)类别在左侧导航窗格下方有几个磁盘使用子视觉对象。
您可以查看整体 lDisk 使用情况或深入了解以下任何子视觉效果:
- 磁盘活动
- 磁盘计数
- 磁盘偏移
- IO时间
- 服务时间
- 磁盘大小
- 磁盘吞吐量
- 磁盘利用率
将其中的一个或多个添加到左侧的同一窗格中,您可以将磁盘使用的不同方面相互比较。这种与进程(related to processes)或CPU时间相关的视觉效果的比较可能会帮助您确定Windows性能问题的根源。
左侧导航窗格中的下一个类别是Memory。
您会在“内存(Memory)”类别下找到以下图表:
- 内存利用率(Memory Utilization)
- 故障计数
- 故障 IO 时间
- 虚拟内存快照
最后,列表中的最后一个类别是Power。这些都是与系统的整体CPU功耗相关的视觉效果。
这包括围绕所有系统处理器(如CPU(CPUs)和GPU(GPUs) )的以下所有子视觉效果:
- 中央处理器频率
- CPU 空闲状态和状态图
- 系统延迟容限
- 处理器配置文件
- 处理器停放状态
- 核心停车状态
- 处理器性能
- 处理器约束
其他 Microsoft WPA 功能
WPA工具中有几个有用的功能可以帮助您进行故障排除工作。
其中之一是分析助手(Assistant)。您可以通过选择Window菜单并选择Analysis Assistant来找到它。
这将在工具中打开一个新窗格,该窗格将为您提供有关您单击的图表或图表内项目的提示和详细信息。
如果您不熟悉整个工具中使用的所有术语,这将特别有用。
如果您选择Window菜单并选择New Analysis View,您可以打开一个新的 Analysis 选项卡。
这使您可以通过在一个选项卡中添加一系列视觉对象然后打开一个新选项卡来执行一组完全不同的视觉对象来执行多项分析,而不会丢失之前的分析。在选项卡之间来回(Flip)切换以单独处理每个分析。
进一步探索Windows 性能分析器(Windows Performance Analyzer Further)
如果您想深入了解WPA,Microsoft有一个旧的 Microsoft Docs 指南(old Microsoft Docs guide)。该文档不再维护,但它应该为您指明正确的方向。它甚至包括一个完整的命令行参考,您可以使用它从命令提示符运行WPA命令。(WPA)
如您所见,Windows 性能分析器工具比默认安装在(Windows Performance Analyzer)Windows上的标准性能工具更加灵活和有用。因此,下次您的Windows系统开始出现异常时,请花时间下载Windows ADK并尝试WPR和WPA 。
如果您使用的是Linux(或Android),则可以使用Microsoft Performance Toolkit获得类似工具的 GitHub Linux 版本(GitHub Linux version of a similar tool is available)。
How to Use Windows Performance Analyzer (WPA) to Boost PC Speed
The Windows Performance Analyzer (WPA) tool is a part оf the Windows Assessment and Deployment Kit (Windows ΑDK). It’s the tool you can use to create graphs and tables based оn event trace log recordings. You make thеse trace files uѕing tools like Xperf or Windows Performance Recorder (WPR). These tools are useful if уou have system performance issues. You can also use them regularly for performance monitoring.
In this article, you’ll learn how to create a quick recording using the WPR. You should launch this recording during an event where you want to test the performance of your computer. This could be launching a game or other application or even running a program you’ve written. Then, we’ll cover how to use the WPA tool to read and analyze that data file for troubleshooting purposes.
Installing and Launching Microsoft Windows ADK Tools
The first step to install both the WPA and WPR is to install Windows ADK from Microsoft’s download page for the Windows Performance Toolkit. This tool is from Microsoft.com, so completely safe to install. As you step through the installation process, you’ll need to choose the components you want to install.
Just make sure that the Windows Performance Toolkit is selected since this includes both tools you need.
Once you select Install, the process can take time, so be patient.
When the Windows Performance Toolkit installation is complete, you’re ready to make your first WPR recording.
Note: For this example, we’ve installed the HeavyLoad Stress Test app to put our system under a heavy load while the WPR recording occurs.
Before using the Microsoft Windows Performance Analyzer tool, you’ll need to use the Windows Performance Recorder to capture an event trace log recording (an ETL file). This recording will contain all Event Tracing for Windows (ETW) events. WPA analyzes all system information about CPU, memory, storage, and more.
To launch WPR, select the Start menu and type “Windows Performance Recorder.” Next, select the Windows Performance Recorder app.
The WPR tool is a straightforward tool to capture events occurring on your system during a specific timeframe. To start the recording, just select the Start button.
This will launch the system event recording process. Perform actions (like launching and running a program) that you want to use to test your system’s performance.
Once finished, just return to the WPR window and select the Save button.
The next step will display the path to your ETL file. You can include a description of what you’re troubleshooting or testing in the detailed description window.
When done, select the Save button.
The app will write all data to the ETL file, and you’ll see options at the bottom of the window to open the WPA tool directly or navigate to the ETL file by opening the folder.
The most convenient way to immediately move on to your performance analysis is to select the Open in WPA button.
Analyzing ETL Files with Windows Performance Analyzer
Once you double-click the WPA app and it launches, you’re ready to start navigating through and visualizing the data in the ETL file. This is a special log file only certain apps can open. You couldn’t view it using something like Google Docs or Microsoft Word.
You’ll notice along the left side there are four major categories of data to explore. You can select any of these charts on the left to see them displayed in more detail in the right pane.
These categories include:
- System Activity: Process information, background tasks, events, and more.
- Computation: All information related to CPU cores.
- Storage: Disk usage information.
- Memory: Real and virtual memory usage.
- Power: Processor power usage details.
In each chart, like the CPU Usage chart, you can hover over any graph area to see a breakdown of the data components like process name, process active time, and percentage of overall CPU usage.
If you select a specific process name from the list at the bottom, you’ll see highlighted areas in the graph to identify the specific times that process consumed CPU resources. This can help identify whether operating system processes or application processes are eating up all CPU time.
You can also drill down into each process to see specific stack activity, again with the graph above highlighting areas when that stack was actively using CPU time.
Available Charts in WPA
Inside each of the four major categories in the left pane, you’ll find a graph explorer that can help you analyze and troubleshoot what’s happening with your system performance.
We’ve covered the System Activity list above. Below this, you’ll find the Computation category.
Here you’ll find the following sub-charts:
- CPU Usage (Sampled): Samples of CPU activity taken at sampling intervals.
- CPU Usage (Precise): CPU usage associated with specific running process threads.
- DPC/SR Duration: CPU time spent servicing deferred procedure calls (DPCs).
- CPU Usage (Attributed): CPU usage broken down into several categories.
Again, you can select any of these sub-charts to display them on the right. Or you can drill down further into more sub-charts related to each of these areas.
The Storage category has several disk usage sub-visuals underneath it in the left navigation pane.
You can view overall lDisk Usage or drill down into any of the following sub-visuals:
- Disk activity
- Disk Counts
- Disk Offset
- IO Time
- Service Time
- Disk Size
- Disk Throughput
- Disk Utilization
Adding one or more of these to the same pane on the left lets you compare different aspects of disk usage to one another. This kind of comparison alongside visuals related to processes or CPU time could potentially help you identify the source of your Windows performance problems.
The next category in the left navigation pane is Memory.
You’ll find the following charts under the Memory category:
Finally, the last category in the list is Power. These are all visuals related to your system’s overall CPU power consumption.
This includes all of the following sub-visuals around all system processors like CPUs and GPUs:
- CPU Frequency
- CPU Idle States and State Diagram
- System Latency Tolerance
- Processor Profiles
- Processor Parking State
- Core Parking State
- Processor Performance
- Processor Constraints
Other Microsoft WPA Features
There are several useful features in the WPA tool that’ll help you with your troubleshooting efforts.
One of those is an Analysis Assistant. You can find this by selecting the Window menu and selecting Analysis Assistant.
This opens up a new pane in the tool that will give you tips and details about the charts or items inside the charts that you click on.
This is especially useful if you aren’t that familiar with all of the terminology used throughout the tool.
If you select the Window menu and select New Analysis View, you can open a new Analysis tab.
This lets you perform multiple analyses by adding a family of visuals in one tab and then opening a new tab to perform a completely different set of visuals without losing your previous analysis. Flip back and forth between tabs to work on each analysis individually.
Exploring Windows Performance Analyzer Further
If you’d like to dig even further into WPA, Microsoft has an old Microsoft Docs guide. The documentation isn’t being maintained anymore, but it should point you in the right direction. It even includes a full command line reference you can use to run WPA commands from the command prompt.
As you can see, the Windows Performance Analyzer tool is much more flexible and useful than standard performance tools that come installed on Windows by default. So, the next time your Windows system starts acting unusual, take the time to download the Windows ADK and give WPR and WPA a try.
If you’re using Linux (or Android), a GitHub Linux version of a similar tool is available using the Microsoft Performance Toolkit.