diff options
author | Taeung Song <treeze.taeung@gmail.com> | 2017-07-24 17:28:42 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2017-07-25 21:46:37 -0400 |
commit | 38d2dcd0ccf85b55d783edbfc14fd8dea4d55b73 (patch) | |
tree | 74f3584764c9cbfcd47241c5dd4a418b32b31c9a /tools/perf/util/annotate.c | |
parent | 3f056b66647bafc39f060a57289320765915972c (diff) |
perf annotate stdio: Fix column header when using --show-total-period
Currently the first column header is always "Percent", fix it to show
correct column name based on given options, i.e. if using
--show-total-period, show "Event count" as a first column.
Reported-by: Milian Wolff <milian.wolff@kdab.com>
Signed-off-by: Taeung Song <treeze.taeung@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/r/c3c902e7-95bc-16d4-366f-12eb034c5c8d@gmail.com
[ Extracted 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 | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c index 004072f82511..c2b4b00166ed 100644 --- a/tools/perf/util/annotate.c +++ b/tools/perf/util/annotate.c | |||
@@ -1824,7 +1824,8 @@ int symbol__annotate_printf(struct symbol *sym, struct map *map, | |||
1824 | width *= evsel->nr_members; | 1824 | width *= evsel->nr_members; |
1825 | 1825 | ||
1826 | graph_dotted_len = printf(" %-*.*s| Source code & Disassembly of %s for %s (%" PRIu64 " samples)\n", | 1826 | graph_dotted_len = printf(" %-*.*s| Source code & Disassembly of %s for %s (%" PRIu64 " samples)\n", |
1827 | width, width, "Percent", d_filename, evsel_name, h->nr_samples); | 1827 | width, width, symbol_conf.show_total_period ? "Event count" : "Percent", |
1828 | d_filename, evsel_name, h->nr_samples); | ||
1828 | 1829 | ||
1829 | printf("%-*.*s----\n", | 1830 | printf("%-*.*s----\n", |
1830 | graph_dotted_len, graph_dotted_len, graph_dotted_line); | 1831 | graph_dotted_len, graph_dotted_len, graph_dotted_line); |