Windows Performance Analyzer

 
Windows Performance Analyzer

Quick Start

The Windows Performance Analyzer tools are designed to measure and analyze Windows system and application performance. The Performance Analyzer tools consist of two primary programs,Xperf.exe and Performance Analyzer (Xperfview.exe). Xperf is a command-line tool that is used to control tracing and to process trace data. Performance Analyzer is a graphical trace data visualization tool. The WPA tools are available via the command-line tool, Xperf. After you install the tools, you can view your first trace.

Install Windows Performance Analyzer Tools
(可选)如何查看函数执行时间
00.设置symbol, 这里要在打开WPA前设置好, 否则加载不了symbol文件.
set _NT_SYMBOL_PATH=c:\coding\fs\release;srv*C:\symbols*http://msdl.microsoft.com/downloads/symbols 
01.开启栈回溯选项, xperf -on latency -stackwalk Profile  
02.第6步之后,在wpa的菜单中选择trace_>load symbols, 然后等待从00.步设置的MS服务器下载symbol文件,时间比较长,慢慢等
03.wpa中右键,选summary table. 然后查看各个函数的调用时间
  1. Install the tools from the appropriate MSI file for the target system’s processor architecture x86 (32-bit), x64, or Itanium-based. You can use the default installation path or select another path, for example, C:\xperf. The installer will add the Performance Analyzer installation path to your system’s PATH environment variable. For more information on installation issues, please see theInstallation section of this document.
  2. Open an elevated command prompt window.
    1. Click the Start button
    2. Click the right mouse button
    3. Select Command Prompt
    4. Select Run as administrator
  3. In the command prompt window, type the following command to turn on the Windows kernel event provider and send data to the default file \kernel.etl:

    xperf -on DiagEasy //不要在高权限目录运行

  4. Compile a program or browse some Web pages.
  5. Use the following command to stop the kernel logger, and then merge and save the trace data toTrace.etl:

    xperf –d trace.etl

  6. View the trace file in Performance Analyzer by using this command:

    xperf trace.etl

A graph of the data in the trace file appears. It should look similar to the following figure.

This view captures processor and disk utilization, process life times, and interrupt and deferred procedure call CPU usage.

You can select regions in the graph, zoom to them, and view summary table information on the regions. You click and drag to select a region, and then right-click to display the menu for the region.

For more information and examples see the Detailed Walkthrough section of this document.

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值