From: Mark Hills <mark@pogo.org.uk>
To: Arun Sharma <asharma@fb.com>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: perf and gprof2dot
Date: Wed, 19 Oct 2011 15:34:41 +0100 (BST) [thread overview]
Message-ID: <1110191529070.13784@jrf.vwaro.pbz> (raw)
In-Reply-To: <20111017233029.GA8704@dev1756.snc6.facebook.com>
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
prev parent reply other threads:[~2011-10-19 14:34 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-17 16:38 perf and gprof2dot Mark Hills
2011-10-17 23:30 ` Arun Sharma
2011-10-19 14:34 ` Mark Hills [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1110191529070.13784@jrf.vwaro.pbz \
--to=mark@pogo.org.uk \
--cc=asharma@fb.com \
--cc=linux-perf-users@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).