如何使用xperf收集CPU使用率采样(Windows Performance Toolkit) [英] How to gather CPU utilization sampling with xperf (Windows Performance Toolkit)

查看:412
本文介绍了如何使用xperf收集CPU使用率采样(Windows Performance Toolkit)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想分析较长过程(6-8小时)的性能.我需要有关已创建/完成的进程(带有命令行)和CPU利用率的信息.

I want to analyze performance of long process (6-8 hours). I need information about created/finished processes (with command lines) and CPU utilization.

我发现Windows性能分析器(wpa.exe/xperfview.exe)是进行分析的好工具.我创建性能数据收集器,选择提供程序"Windows Kernel Trace",关键字"process",并获取有关进程的信息.

I found, that Windows Performance Analyzer (wpa.exe/xperfview.exe) is great tool for analyzing. I create performance data collector, select provider 'Windows Kernel Trace', keyword 'process' and got information about processes.

但是我找不到如何通过采样收集有关CPU利用率的信息. 我知道,那

But I can't find how to collect information about CPU utilization with sampling. I know, that

xperf.exe-基于

xperf.exe -on Base

收集CPU信息,但是会生成太多信息...

collect CPU information, but it generate too much information...

我还可以使用性能计数器将CPU利用率收集为* .blg文件,但无法将此文件加载到Windows Performance Analyzer中. :(

Also I can collect CPU utilization with performance counters as *.blg file, but I can't load this file into Windows Performance Analyzer. :(

有什么想法吗?

推荐答案

您可以从命令提示符(cmd.exe)中使用此命令使用Stacks获得CPU采样,

You can get the CPU sampling with Stacks with this command from a command prompt (cmd.exe), running as admin:

xperf -on PROC_THREAD+LOADER+PROFILE -stackwalk profile -buffersize 1024 -MaxFile 1024 -FileMode Circular && timeout -1 && xperf -d C:\HighCPUUsage.etl

这将创建最大大小为1GB的文件. Xperf/ETW不能很好地进行长期分析,因为文件太大.因此,运行命令,如果Taskmgr中的CPU使用率很高,请按键以停止记录.在WPA.exe中打开ETL,现在您可以看到最后几分钟.

This creates a file with max size of 1GB. Xperf/ETW is not working well for long term analysis, because the files are getting too large. So, run the command, and if you see a high CPU usage in Taskmgr, press key to stop logging. Open the ETL in WPA.exe and now you see the last minutes.

这篇关于如何使用xperf收集CPU使用率采样(Windows Performance Toolkit)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆