本文介绍了Xperf时间与KeQueryPerformanceCounter相比的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在恢复周期中分析内核模式驱动程序。我运行Xperf为:xperf -on ResumeTrace -stackwalk Profile。我还在我的驱动程序中添加了代码,用于测量函数所需的时间,使用KeQueryPerformanceCounter。我遇到的问题是时间不匹配:
- Xperf表示fcn A具有更大的"重量"。比fcn B大约10%;
- KeQueryPerformanceCounter表示fcn B比fcn A花费大约15倍的运行时间。再次,似乎"重量"也是如此。在Xperf中是msec,它与KeQueryPerformanceCounter的不匹配。

我也使用PwrTest来测量恢复时间,这些更接近KeQueryPerformanceCounter。所以我不确定Xperf是否正在给我正确的数据或者我不明白Xperf究竟测量的是什么/如何。

感谢您的任何建议。

解决方案

I'm attempting to profile a kernel mode driver during a resume cycle.  I run Xperf as : xperf -on ResumeTrace -stackwalk Profile.  I've also added code in my driver to measure the time a function takes, using KeQueryPerformanceCounter.  The issue I have is the times do not match:
- Xperf indicates fcn A has a larger "weight" than fcn B by ~10%;
- KeQueryPerformanceCounter indicates fcn B takes ~15 times more time to run than fcn A.

Also, it seems that the "weight" in Xperf is msec, which does not match that of KeQueryPerformanceCounter.

I've also used PwrTest to measure resume times, and these are closer to KeQueryPerformanceCounter.  So I am not sure if Xperf is giving me the correct data OR I don't understand exactly what/how Xperf is measuring.

Thanks for any advice.

解决方案


这篇关于Xperf时间与KeQueryPerformanceCounter相比的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-16 01:49