可以从 perf.data 文件生成 perf-stat 结果吗?

2024-02-18

当我想使用 Linux 工具套件中的 perf-stat 和 perf-report 生成性能报告时perf http://code.google.com/p/kernel/wiki/PerfUserGuide, I run:

$ perf record -o my.perf.data myCmd
$ perf report -i my.perf.data

And:

$ perf stat myCmd

但这意味着我第二次运行“myCmd”,这需要几分钟。相反,我希望:

$ perf stat -i my.perf.data

但与 perf 套件中的大多数工具不同,我没有看到 perf-stat 的 -i 选项。是否有其他工具可以实现此目的,或者有一种方法可以让 perf-report 生成与 perf-stat 类似的输出?


我深入研究了 kernel.org 上的源代码,看起来没有办法让 perf stat 来解析 perf.data

http://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=blob;f=tools/perf/builtin-stat.c;h=c70d72003557f17f29345b0f219dc5ca9f572d75;hb=refs /heads/linux-2.6.33.y http://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=blob;f=tools/perf/builtin-stat.c;h=c70d72003557f17f29345b0f219dc5ca9f572d75;hb=refs/heads/linux-2.6.33.y

如果你看一下第 245 行,你会看到函数“run_perf_stat”,而第 308-320 行周围的行似乎是实际进行记录和整理的。

我没有深入研究这个问题来确定是否可以启用您想要的功能。

看起来 perf 报告没有很多额外的格式化功能。如果您喜欢,可以在这里进一步检查:

http://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=blob;f=tools/perf/builtin-report.c;h=860f1eeeea7dbf8e43779308eaaffb1dbcf79d10;hb=refs /heads/linux-2.6.33.y http://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=blob;f=tools/perf/builtin-report.c;h=860f1eeeea7dbf8e43779308eaaffb1dbcf79d10;hb=refs/heads/linux-2.6.33.y

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

可以从 perf.data 文件生成 perf-stat 结果吗? 的相关文章

随机推荐