From: Taeung Song Date: Mon, 24 Jul 2017 21:28:42 +0000 (+0900) Subject: perf annotate stdio: Fix column header when using --show-total-period X-Git-Tag: Ubuntu-5.13.0-19.19~12734^2~32^2~1 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=38d2dcd0ccf85b55d783edbfc14fd8dea4d55b73;p=mirror_ubuntu-jammy-kernel.git 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 Signed-off-by: Taeung Song Cc: Jiri Olsa Cc: Namhyung Kim 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 --- 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, width *= evsel->nr_members; 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", graph_dotted_len, graph_dotted_len, graph_dotted_line);