Re: [RFC] perf tool improvement requests

From: Peter Zijlstra
Date: Tue Sep 04 2018 - 10:17:30 EST


On Tue, Sep 04, 2018 at 10:42:18AM -0300, Arnaldo Carvalho de Melo wrote:
> Then I need to get the DW_AT_location stuff parsed in pahole, so
> that with those offsets (second column, ending with :) with hits (first
> column, there its local period, but we can ask for some specific metric
> [1]), I'll be able to figure out what DW_TAG_variable or
> DW_TAG_formal_parameter is living there at that time, get the offset
> from the decoded instruction, say that xor, 0x138 offset from the type
> for %r15 at that offset (85) from kmem_cache_alloc, right?

I'm not sure how the DWARF location stuff works; it could be it already
includes the offset and decoding the instruction is not needed.

But yes, that's the basic idea; get DWARF to tell you what variable is
used at a certain IP.

> In a first milestone we'd have something like:
>
> perf annotate --hits function | pahole --annotate -C task_struct
>
> perf annotate --hits | pahole --annotate

Not sure keeping it two proglets makes sense, but whatever :-)

The alternative I suppose is making perf do the IP->struct::member
mapping and freed that to pahole, which then only uses it to annotate
the output.

Or, munge the entirety of pahole into perf..