简体   繁体   中英

What is the best way to get the most useful output from oprofile?

Using tools such as:

  • opreport
  • opcontrol
  • opannotate

I am starting to use this tool and trying to find the best combinations, examples to get the most out of profiling.

Thanks

gprof2dot is the most amazing visualization tool for profile data.

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 's --skew option is really nice when drilling down the actual problem code.

Remeber you can't set callgraph if you've manually set the event counter to a low number. Be default the when using the --callgraph option the minimum counter is 15 times larger than the one listed in --list-events


Edit: example screenshot: gprof2dot.py示例输出

The resolution is reduced to avoid disclosing confidential data, but you get the idea.

Look at the KCachegrind - it's a profile data visualization tool.

KCachegrind visualize data files generated by Callgrind profiler tool. But with conversion scripts , KCachegrind is able to visualize output of other profilers like OProfile .

When you install KCachegrind using a package manager (yum, apt-get, etc.) you get a tool called op2calltree which transforms Oprofile's output to KCachegrind's format.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM