On Mon, 17 Oct 2011, Arun Sharma wrote:
> On Mon, Oct 17, 2011 at 05:38:22PM +0100, Mark Hills wrote:
> > I'm using perf very successfully, and recently in place of oprofile.
> >
> > But I wondered if there is a way for 'perf report' to output a gprof-style
> > callgraph (similar to 'oprofile -c')?
> >
> > Aside from being familiar, the motivation is so that it can be displayed
> > as a directed graph (not tree) by the excellent gprof2dot [1] tool.
>
> perf record -ag -- sleep 1
> perf script | script-below.py | gprof2dot -f hprof | dot -Tpng -o graph.png
Thanks Arun, interesting script.
> It's probably better to teach gprof2dot how to parse the output of perf
> script. But this was the path of least resistance for me.
Since we spoke, the author of gprof2dot has added preliminary support for
perf to his repository. It's not fully complete and is just a test; eg.
the call ratios are wrong as gprof2dot expects them from the caller (not
callee) perspective.
$ perf report --show-nr-samples -g flat,0 | gprof2dot -f perf
I did not have chance to look at what extra work is needed, but the
initial results are promising.
--
Mark
--
To unsubscribe from this list: send the line "unsubscribe linux-perf-users" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
[Linux USB Devel]
[Video for Linux]
[Linux Audio Users]
[Photo]
[Yosemite News]
[Yosemite Photos]
[Free Online Dating]
[Linux Kernel]
[Linux SCSI]
[XFree86]