Re: [GIT PULL 00/10] perf/core improvements and fixes

From: Arnaldo Carvalho de Melo
Date: Tue Jun 21 2016 - 12:14:26 EST


Em Tue, Jun 21, 2016 at 12:08:47PM +0200, Paolo Bonzini escreveu:
> On 21/06/2016 05:11, Brendan Gregg wrote:
> >>> > > - Add stackcollapse.py script to help generating flame graphs (Paolo Bonzini)
> >> >
> >> > I think this is already done by '-g folded'. Please see:
> >> >
> >> > http://www.brendangregg.com/blog/2016-04-30/linux-perf-folded.html
> >> >
> > Pretty much. Two similar solutions were developed around the same
> > time. Although I have to use some awk to get "perf -g folded" in the
> > exact right format, and stackcollapse-perf.py does that directly.
>
> Yes, the idea for stackcollapse-perf.py was:
>
> - to do everything directly and emit "the right" format for the
> flamegraph tools. This however is a very minimal output, and it's not
> necessarily the best for perf in general.
>
> - to provide an example of visiting callgraphs from the scripting
> interface, since it's not really documented. From the commit message:
> "Add stackcollapse.py script as an example of parsing call chains, and
> also of using optparse to access command line options".

Yeah, agreed, its short, and it provides the output ready to be used, no
need for extra processing, up to the user to decide if one or the other
is more suitable to their needs.

As a bonus, it documents callgraphs in scripts, good deal :-)

- Arnaldo