diff options
author | Peter Zijlstra (Intel) <peterz@infradead.org> | 2016-06-30 04:29:55 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2016-06-30 17:27:42 -0400 |
commit | 135cce1bf12bd30d7d66360022f9dac6ea3a07cd (patch) | |
tree | dc0c7283290c1a53214c3f66858c00dcbdb7949a /tools/perf/util/annotate.c | |
parent | 53dd9b5f95dda95bcadda1b4680be42dfe1f9e5e (diff) |
perf annotate: Add number of samples to the header
Staring at annotations of large functions is useless if there's only a
few samples in them. Report the number of samples in the header to make
this easier to determine.
Committer note:
The change amounts to:
- Percent | Source code & Disassembly of perf-vdso.so for cycles:u
------------------------------------------------------------------
+ Percent | Source code & Disassembly of perf-vdso.so for cycles:u (3278 samples)
+--------------------------------------------------------------------------------
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Link: http://lkml.kernel.org/r/20160630082955.GA30921@twins.programming.kicks-ass.net
[ split from a larger patch ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/annotate.c')
-rw-r--r-- | tools/perf/util/annotate.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c index 78e5d6f3ff61..e9825fe825fd 100644 --- a/tools/perf/util/annotate.c +++ b/tools/perf/util/annotate.c | |||
@@ -1522,6 +1522,7 @@ int symbol__annotate_printf(struct symbol *sym, struct map *map, | |||
1522 | const char *d_filename; | 1522 | const char *d_filename; |
1523 | const char *evsel_name = perf_evsel__name(evsel); | 1523 | const char *evsel_name = perf_evsel__name(evsel); |
1524 | struct annotation *notes = symbol__annotation(sym); | 1524 | struct annotation *notes = symbol__annotation(sym); |
1525 | struct sym_hist *h = annotation__histogram(notes, evsel->idx); | ||
1525 | struct disasm_line *pos, *queue = NULL; | 1526 | struct disasm_line *pos, *queue = NULL; |
1526 | u64 start = map__rip_2objdump(map, sym->start); | 1527 | u64 start = map__rip_2objdump(map, sym->start); |
1527 | int printed = 2, queue_len = 0; | 1528 | int printed = 2, queue_len = 0; |
@@ -1544,8 +1545,8 @@ int symbol__annotate_printf(struct symbol *sym, struct map *map, | |||
1544 | if (perf_evsel__is_group_event(evsel)) | 1545 | if (perf_evsel__is_group_event(evsel)) |
1545 | width *= evsel->nr_members; | 1546 | width *= evsel->nr_members; |
1546 | 1547 | ||
1547 | graph_dotted_len = printf(" %-*.*s| Source code & Disassembly of %s for %s\n", | 1548 | graph_dotted_len = printf(" %-*.*s| Source code & Disassembly of %s for %s (%" PRIu64 " samples)\n", |
1548 | width, width, "Percent", d_filename, evsel_name); | 1549 | width, width, "Percent", d_filename, evsel_name, h->sum); |
1549 | 1550 | ||
1550 | printf("%-*.*s----\n", | 1551 | printf("%-*.*s----\n", |
1551 | graph_dotted_len, graph_dotted_len, graph_dotted_line); | 1552 | graph_dotted_len, graph_dotted_len, graph_dotted_line); |