可以从perf.data文件生成perf-stat结果吗? [英] Can perf-stat results be generated from a perf.data file?
问题描述
当我想从Linux工具套件中使用perf-stat和perf-report生成性能报告时, perf ,我运行:
When I want to generate performance reports using perf-stat and perf-report from the Linux tool suite perf, I run:
$ perf record -o my.perf.data myCmd
$ perf report -i my.perf.data
并且:
$ perf stat myCmd
但这意味着我第二次运行"myCmd",这需要几分钟.相反,我希望是:
But that means I run 'myCmd' a second time, which takes several minutes. Instead, I was hoping for:
$ perf stat -i my.perf.data
但是与perf套件中的大多数工具不同,我没有看到perf-stat的-i选项.是否有另一种工具,或获取perf-report来生成与perf-stat类似的输出的方法?
But unlike most of the tools in the perf suite, I don't see a -i option for perf-stat. Is there another tool for this, or a way to get perf-report to generate similar output to perf-stat?
推荐答案
我在kernel.org上挖掘了源代码,看来没有办法获取perf stat来解析perf.data
I dug into the source on kernel.org and it looks like there's no way to get perf stat to parse perf.data
如果您查看第245行,则会看到函数"run_perf_stat",而308-320附近的行似乎实际上是在进行记录和整理.
If you look at line 245 you'll see the function "run_perf_stat" and the lines around 308-320 seem to be what actually do the recording and collating.
我没有花足够的力气来确定是否有可能启用所需的功能.
I didn't dig into this hard enough to determine if it's possible to enable the kind of functionality that you desire.
perf报表似乎不具有许多其他格式化功能.您可以在此处进一步检查:
It does not look like perf report has a lot of additional formatting capabilities to it. You can check further if you like here: