加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Linux > 正文

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

发布时间:2020-12-14 02:08:27 所属栏目:Linux 来源:网络整理
导读:当我想使用 Linux工具套件 perf中的perf-stat和perf-report生成性能报告时,我运行: $perf record -o my.perf.data myCmd$perf report -i my.perf.data 和: $perf stat myCmd 但这意味着我第二次运行’myCmd’,这需要几分钟.相反,我希望: $perf stat -i my
当我想使用 Linux工具套件 perf中的perf-stat和perf-report生成性能报告时,我运行:

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

和:

$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

如果你看第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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读