I remember a post from one of the Devs a while ago showing off some wizzy graphical tool that analysed call graph and profiling date, and produced a tree-like diagram showing the function/method hierarchy and the time spent in those functions.
Can anyone remember the tool(s) used, or can anyone find the post I'm talking about? I've searched various topics but I can't find the thing
Graphical Profiling / Call Graph analysis
Moderator: Moderators
-
- Posts: 834
- Joined: 19 May 2009, 21:10
Re: Graphical Profiling / Call Graph analysis
Thanks, now I just need to find out how the graph was generated!
- BrainDamage
- Lobby Developer
- Posts: 1164
- Joined: 25 Sep 2006, 13:56
Re: Graphical Profiling / Call Graph analysis
I used oprofile ( linux only ) for the data acquisition:
http://oprofile.sourceforge.net/about/
oprof is a statistical profiler, you might want to calculate number of samples to have error confidence less than your acceptable level
gprof2dot to convert the table data into a graph script
http://code.google.com/p/jrfonseca/wiki/Gprof2Dot
gprof2dot can convert from multiple profiling tools, but I found oprofile to be best since it only requires debug symbols in the binary to work, and the slowdown it introduces is neglectable
either you're running linux, windows, or mac you could try gprof, altho it requires for the binary to be compiled using special gprof symbols, slows down the app to grind levels, and I find it somehow crappier than oprof. ( after compiling the app with the special symbols, you'll have to run it and parse the binary profile data with the gprof tool in order to make it readble from the script, make sure you'll enable call graph output from gprof )
graphviz to render the graph script http://www.graphviz.org/
http://oprofile.sourceforge.net/about/
Code: Select all
# opcontrol -c=16 -p=library,thread,cpu --no-vmlinux
# opcontrol --start
$ spring ( must contain debug symbols )
# opcontrol --stop
# opcontrol --flush
$ opreport -cgf --demangle=smart --exclude-dependent --merge=tgid,cpu,tid --symbols /path/to/spring > calldata.txt
gprof2dot to convert the table data into a graph script
http://code.google.com/p/jrfonseca/wiki/Gprof2Dot
Code: Select all
$ gprof2dot -f oprofile -o dotgraph.dot calldata.txt
either you're running linux, windows, or mac you could try gprof, altho it requires for the binary to be compiled using special gprof symbols, slows down the app to grind levels, and I find it somehow crappier than oprof. ( after compiling the app with the special symbols, you'll have to run it and parse the binary profile data with the gprof tool in order to make it readble from the script, make sure you'll enable call graph output from gprof )
graphviz to render the graph script http://www.graphviz.org/
$ dot -T svg -o svggraph.svg dotgraph.dot
Re: Graphical Profiling / Call Graph analysis
That's fantastic - we've actually used oprofile already but I didn't know about gprof2dot - thanks!