Re: [GIT PULL 00/13] Annotation improvements (G+ edition)

From: Ingo Molnar
Date: Wed Apr 25 2012 - 03:05:42 EST



* Arnaldo Carvalho de Melo <acme@xxxxxxxxxxxxx> wrote:

> Hi Ingo,
>
> Please consider pulling,
>
> - Arnaldo
>
> The following changes since commit a385ec4f11bdcf81af094c03e2444ee9b7fad2e5:
>
> Merge tag 'v3.4-rc2' into perf/core (2012-04-13 09:57:10 +0200)
>
> are available in the git repository at:
>
>
> git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux perf/annotate
>
> for you to fetch changes up to 3f862fd076275c442dfe295eddb5650a6e0aecd4:
>
> perf annotate: Add missing jump variants (2012-04-19 17:10:12 -0300)
>
> ----------------------------------------------------------------
> Annotate improvements
>
> Now the default annotate browser uses a much more compact format, implementing
> suggestions made made by several people, notably Linus.
>
> Here is part of the new __list_del_entry annotation:
>
> __list_del_entry
> 8.47 â push %rbp
> 8.47 â mov (%rdi),%rdx
> 20.34 â mov $0xdead000000100100,%rcx
> 3.39 â mov 0x8(%rdi),%rax
> 0.00 â mov %rsp,%rbp
> 1.69 â cmp %rcx,%rdx
> 0.00 â je 43
> 1.69 â mov $0xdead000000200200,%rcx
> 3.39 â cmp %rcx,%rax
> 0.00 â je a3
> 5.08 â mov (%rax),%r8
> 18.64 â cmp %r8,%rdi
> 0.00 â jne 84
> 1.69 â mov 0x8(%rdx),%r8
> 25.42 â cmp %r8,%rdi
> 0.00 â jne 65
> 1.69 â mov %rax,0x8(%rdx)
> 0.00 â mov %rdx,(%rax)
> 0.00 â leaveq
> 0.00 â retq
> 0.00 â 43: mov %rdx,%r8
> 0.00 â mov %rdi,%rcx
> 0.00 â mov $0xffffffff817cd6a8,%rdx
> 0.00 â mov $0x31,%esi
> 0.00 â mov $0xffffffff817cd6e0,%rdi
> 0.00 â xor %eax,%eax
> 0.00 â callq ffffffff8104eab0 <warn_slowpath_fmt>
> 0.00 â leaveq
> 0.00 â retq
> 0.00 â 65: mov %rdi,%rcx
> 0.00 â mov $0xffffffff817cd780,%rdx
> 0.00 â mov $0x3a,%esi
> 0.00 â mov $0xffffffff817cd6e0,%rdi
> 0.00 â xor %eax,%eax
> 0.00 â callq ffffffff8104eab0 <warn_slowpath_fmt>
> 0.00 â leaveq
> 0.00 â retq
>
> The infrastructure is there to provide formatters for any instruction,
> like the one I'll do for call functions to elide the address.
>
> Signed-off-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
>
> ----------------------------------------------------------------
> Arnaldo Carvalho de Melo (13):
> perf annotate: Rename objdump_line to disasm_line
> perf annotate: Parse instruction
> perf annotate browser: Use the disasm_line instruction name and operand fields
> perf annotate: Disassembler instruction parsing
> perf annotate: Parse call targets earlier
> perf annotate: Introduce scnprintf ins_ops method
> perf annotate browser: Rename disasm_line_rb_node
> perf symbols: Introduce symbol__size method
> perf annotate browser: Hide non jump target addresses in offset mode
> perf annotate browser: Align jump labels
> perf annotate browser: Make lines more compact
> perf annotate browser: Use a vertical line as percentage separator
> perf annotate: Add missing jump variants
>
> tools/perf/ui/browsers/annotate.c | 323 +++++++++++++++++++++----------------
> tools/perf/util/annotate.c | 263 +++++++++++++++++++++++++-----
> tools/perf/util/annotate.h | 32 +++-
> tools/perf/util/symbol.h | 5 +
> tools/perf/util/util.c | 10 ++
> tools/perf/util/util.h | 2 +
> 6 files changed, 446 insertions(+), 189 deletions(-)

The new output looks very (very!) nice - but it is still a bit
fragile:

earth5:~/tip/tools/perf> ./perf record -a sleep 1
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 0.092 MB perf.data (~4008 samples) ]

earth5:~/tip/tools/perf> ./perf annotate _int_free
perf: Segmentation fault

The crash happens here:

Program received signal SIGSEGV, Segmentation fault.
0x0000000000486cda in annotate_browser__mark_jump_targets (size=<optimized out>,
browser=<optimized out>) at ui/browsers/annotate.c:704
704 bdlt->jump_target = true;

But other than that the new assembly output is awesome :-)

Thanks,

Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/