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

2

9

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

Deformed answered 3/9, 2009 at 12:46 Comment(1)
The meaning of "best" is always dependent on the meaning of "good", and that is not always obvious what is. Could you describe what good things you are looking for?Solly
E
5

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.

Escribe answered 8/9, 2009 at 9:58 Comment(0)
D
6

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 example output

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

Dupe answered 2/3, 2010 at 1:7 Comment(3)
Do you think it's better than KCachegrind? Have a screenshot?Gabby
@NathanKidd: I have a more complete answer about gprof2dot here: https://mcmap.net/q/156104/-beyond-stack-sampling-c-profilersDupe
I've uploaded a screenshot. Many thanks for the tool!Rambunctious
E
5

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.

Escribe answered 8/9, 2009 at 9:58 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.