diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2018-04-05 10:13:24 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2018-04-05 10:18:39 -0400 |
commit | c0459a092509f9c2ff91cc070cd2645d38e7cf7b (patch) | |
tree | c686c7b0269fb06cdb97648f126dd6bbd113f304 | |
parent | 0d75f123a6dcdacb3550b0c3c44a283f7259289e (diff) |
perf annotate: Show group details on the title line
To match what is shown in the main 'perf report/top' title lines, i.e.
if a group is being shown, either a real group (recorded with "-e
'{a,b,c}') or a forced group (using 'perf report --group' for a
perf.data file recorded without {}) we will show multiple columns,
one per event, but we were failing to show the group details, so, for:
# perf report --header-only | grep cmdline
# cmdline : /home/acme/bin/perf record -e {cycles,instructions,cache-misses}
# perf report --group
The first line was showing just "cycles", now it shows the correct line,
which is:
Samples: 578 of events 'anon group { cycles, instructions, cache-misses }', 4000 Hz, Event count (approx.): 487421794
syscall_return_via_sysret /lib/modules/4.16.0-rc7/build/vmlinux
0.22 2.97 0.00 │ ↓ jmp 6c
│ mov %cr3,%rdi
1.33 10.89 4.00 │ ↓ jmp 62
│ mov %rdi,%rax
<SNIP>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jin Yao <yao.jin@linux.intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Fixes: 6920e2854e9a ("perf annotate browser: Show extra title line with event information")
Link: https://lkml.kernel.org/n/tip-i41tqh17c2dabnyzjh99r1oz@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r-- | tools/perf/util/annotate.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c index fffe16af9797..fbad8dfbb186 100644 --- a/tools/perf/util/annotate.c +++ b/tools/perf/util/annotate.c | |||
@@ -2600,7 +2600,7 @@ int __annotation__scnprintf_samples_period(struct annotation *notes, | |||
2600 | bool show_freq) | 2600 | bool show_freq) |
2601 | { | 2601 | { |
2602 | const char *ev_name = perf_evsel__name(evsel); | 2602 | const char *ev_name = perf_evsel__name(evsel); |
2603 | char ref[30] = " show reference callgraph, "; | 2603 | char buf[1024], ref[30] = " show reference callgraph, "; |
2604 | char sample_freq_str[64] = ""; | 2604 | char sample_freq_str[64] = ""; |
2605 | unsigned long nr_samples = 0; | 2605 | unsigned long nr_samples = 0; |
2606 | int nr_members = 1; | 2606 | int nr_members = 1; |
@@ -2609,8 +2609,11 @@ int __annotation__scnprintf_samples_period(struct annotation *notes, | |||
2609 | char unit; | 2609 | char unit; |
2610 | int i; | 2610 | int i; |
2611 | 2611 | ||
2612 | if (perf_evsel__is_group_event(evsel)) | 2612 | if (perf_evsel__is_group_event(evsel)) { |
2613 | perf_evsel__group_desc(evsel, buf, sizeof(buf)); | ||
2614 | ev_name = buf; | ||
2613 | nr_members = evsel->nr_members; | 2615 | nr_members = evsel->nr_members; |
2616 | } | ||
2614 | 2617 | ||
2615 | for (i = 0; i < nr_members; i++) { | 2618 | for (i = 0; i < nr_members; i++) { |
2616 | struct sym_hist *ah = annotation__histogram(notes, evsel->idx + i); | 2619 | struct sym_hist *ah = annotation__histogram(notes, evsel->idx + i); |