Skip to content

perf annotate: Add support for event group view (v1)

Namhyung Kim lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest13 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/13perf annotate: Parse --asm-raw output properlytools/perf/ui/browsers/annotate.c tools/perf/util/annotate.c+36 -20 replies
2/13perf annotate: Whitespace fixupstools/perf/util/annotate.c+6 -61 reply
3/13perf annotate: Merge same lines in summary viewtools/perf/util/annotate.c tools/perf/util/annotate.h+53 -30 replies
4/13perf annotate: Don't try to follow jump target on PLT symbolstools/perf/ui/browsers/annotate.c+12 -01 reply
5/13perf annotate: Pass evsel instead of evidx on annotation functionstools/perf/builtin-annotate.c tools/perf/builtin-top.c tools/perf/ui/browsers/annotate.c +4 more+57 -460 replies
6/13perf annotate: Factor out disasm__calc_percent()tools/perf/util/annotate.c+35 -170 replies
7/13perf annotate: Basic support for event group viewtools/perf/util/annotate.c+69 -170 replies
8/13perf annotate: Factor out struct source_line_percenttools/perf/ui/browsers/annotate.c tools/perf/util/annotate.c tools/perf/util/annotate.h+14 -100 replies
9/13perf annotate: Support event group view for --print-linetools/perf/util/annotate.c tools/perf/util/annotate.h+95 -290 replies
10/13perf annotate browser: Make browser_disasm_line->percent an arraytools/perf/ui/browsers/annotate.c+7 -70 replies
11/13perf annotate browser: Use disasm__calc_percent()tools/perf/ui/browsers/annotate.c tools/perf/util/annotate.c tools/perf/util/annotate.h+20 -390 replies
12/13perf annotate browser: Support event group view on TUItools/perf/ui/browsers/annotate.c+57 -120 replies
13/13perf annotate: Add --group optiontools/perf/builtin-annotate.c+6 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCHSET 00/13] perf annotate: Add support for event group view (v1)

Hi,

This is a patchset to support event grouping on perf annotate.

It depends on perf report event group view patchset [1] and contains a couple of annotate fixup/cleanup patches that I sent yesterday (although I fixed a compile problem and added a cleanup patch).

The symbol histograms already contain hit counts for every event so it was relatively easier to support than that of perf report case. I added a sort of flexible array to struct source_line and browser_disasm_line for gathering percent values for each group members.

Patch 0001-0004 are cleanups and can be merged separately. I sent
similar patches yesterday, and this is the up-to-date version.
Patch 0005-0006 are preparation for later patches and Patch 0007 added event group view for --stdio.
Patch 0008-0009 added event group view for --print-line and Patch 0010-0012 added event group view for --tui.
Patch 0013 added --group option to enable group view suport.

Let me show you an example:

  $ perf annotate --group --stdio --print-line

Sorted summary for file /lib/ld-2.11.1.so
----------------------------------------------

     33.33    0.00 /build/buildd/eglibc-2.11.1/elf/rtld.c:381
     33.33    0.00 /build/buildd/eglibc-2.11.1/elf/dynamic-link.h:128
     33.33    0.00 /build/buildd/eglibc-2.11.1/elf/do-rel.h:105
      0.00   75.00 /build/buildd/eglibc-2.11.1/elf/dynamic-link.h:137
      0.00   25.00 /build/buildd/eglibc-2.11.1/elf/dynamic-link.h:187
   Percent         |      Source code & Disassembly of ld-2.11.1.so
  ------------------------------------------------------------------
                   :
                   :
                   :
                   :      Disassembly of section .text:
                   :
                   :      0000000000001120 <_dl_rtld_di_serinfo-0x7a20>:
      0.00    0.00 :        1120:       push   %rbp
      0.00    0.00 :        1121:       mov    %rsp,%rbp
      0.00    0.00 :        1124:       push   %r15
      0.00    0.00 :        1126:       push   %r14
      0.00    0.00 :        1128:       push   %r13
      0.00    0.00 :        112a:       push   %r12
      0.00    0.00 :        112c:       push   %rbx
      0.00    0.00 :        112d:       mov    %rdi,%rbx
      0.00    0.00 :        1130:       sub    $0x28,%rsp
      0.00    0.00 :        1134:       rdtsc  
      0.00    0.00 :        1136:       shl    $0x20,%rdx
      0.00    0.00 :        113a:       mov    %eax,%eax
      0.00    0.00 :        113c:       or     %rax,%rdx
      0.00    0.00 :        113f:       lea    -0x26(%rip),%r13        # 1120 <free@plt+0x648>
      0.00    0.00 :        1146:       sub    0x21ea93(%rip),%r13        # 21fbe0 <calloc+0x208c80>
   /build/buildd/eglibc-2.11.1/elf/rtld.c:381
     33.33    0.00 :        114d:       mov    %rdx,0x21ec54(%rip)        # 21fda8 <_rtld_global_ro+0x1a8>
      0.00    0.00 :        1154:       mov    %r13,%rdx

...

You can access it via my tree as well.

git://git.kernel.org/pub/scm/linux/kernel/git/namhyung/linux-perf.git perf/annotate-group-v1

As always, any comments are welcome, thanks.
Namhyung

[1] http://www.mail-archive.com/[email protected]/msg337706.html

Namhyung Kim (13):
perf annotate: Parse --asm-raw output properly
perf annotate: Whitespace fixups
perf annotate: Merge same lines in summary view
perf annotate: Don't try to follow jump target on PLT symbols perf annotate: Pass evsel instead of evidx on annotation functions perf annotate: Factor out disasm__calc_percent()
perf annotate: Basic support for event group view
perf annotate: Factor out struct source_line_percent perf annotate: Support event group view for --print-line perf annotate browser: Make browser_disasm_line->percent an array perf annotate browser: Use disasm__calc_percent()
perf annotate browser: Support event group view on TUI perf annotate: Add --group option

 tools/perf/builtin-annotate.c     |   20 ++-
 tools/perf/builtin-top.c          |    2 +-
 tools/perf/ui/browsers/annotate.c |  151 ++++++++++------
 tools/perf/ui/browsers/hists.c    |    2 +-
 tools/perf/util/annotate.c        |  349 ++++++++++++++++++++++++++++++-------
 tools/perf/util/annotate.h        |   28 ++-
 tools/perf/util/hist.h            |    5 +-
 7 files changed, 418 insertions(+), 139 deletions(-)
Signature · 1 line
1.7.9.2