从oprofile获得最有用的输出的最佳方法是什么?

时间:2009-09-03 12:46:16

标签: c optimization oprofile

使用以下工具:

  • opreport
  • opcontrol
  • opannotate

我开始使用此工具并尝试找到最佳组合,以获得示例 最简单的分析。

由于

2 个答案:

答案 0 :(得分:6)

gprof2dot是配置文件数据最令人惊叹的可视化工具。

opcontrol --shutdown
opcontrol --callgraph=7
opcontrol --image=<abs/path/to/your/execuable>
opcontrol --start

... time passes ...

opcontrol --dump
opreport -c > profile_info.txt
gprof2dot.py -f oprofile --strip profile_info.txt | dot -Tsvg > profile_graph.svg
inkscape profile_graph.svg
深入挖掘实际问题代码时,

gprof2dot的{​​{1}}选项非常好。

如果您手动将事件计数器设置为较低的数字,请记住您无法设置调用图。默认使用--skew选项时,最小计数器比--callgraph中列出的计数器大15倍


编辑:示例截图: gprof2dot.py example output

降低分辨率以避免泄露机密数据,但你明白了。

答案 1 :(得分:5)

查看KCachegrind - 这是一个配置文件数据可视化工具。

KCachegrind 可视化Callgrind个人工具工具生成的数据文件。但是使用conversion scripts KCachegrind 能够可视化其他分析器的输出,例如OProfile

使用包管理器(yum,apt-get等)安装KCachegrind时,会得到一个名为op2calltree的工具,它将Oprofile的输出转换为KCachegrind的格式。

相关问题