Commit 38d2dcd0 authored by Taeung Song's avatar Taeung Song Committed by Arnaldo Carvalho de Melo

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: default avatarMilian Wolff <milian.wolff@kdab.com>
Signed-off-by: default avatarTaeung 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: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 3f056b66
...@@ -1824,7 +1824,8 @@ int symbol__annotate_printf(struct symbol *sym, struct map *map, ...@@ -1824,7 +1824,8 @@ int symbol__annotate_printf(struct symbol *sym, struct map *map,
width *= evsel->nr_members; width *= evsel->nr_members;
graph_dotted_len = printf(" %-*.*s| Source code & Disassembly of %s for %s (%" PRIu64 " samples)\n", graph_dotted_len = printf(" %-*.*s| Source code & Disassembly of %s for %s (%" PRIu64 " samples)\n",
width, width, "Percent", d_filename, evsel_name, h->nr_samples); width, width, symbol_conf.show_total_period ? "Event count" : "Percent",
d_filename, evsel_name, h->nr_samples);
printf("%-*.*s----\n", printf("%-*.*s----\n",
graph_dotted_len, graph_dotted_len, graph_dotted_line); graph_dotted_len, graph_dotted_len, graph_dotted_line);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment