Skip to contentSkip to conversation

perf annotate: Show the proper header when using --show-total-period

PATCH Superseded Taeung Song 1 participant 1 message Jul 19, 2017 perf events

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 4/9 perf annotate: Show the proper header when using --show-total-period

Currently a first column is only "Percent",
so fix it to show correct column name based on given options. (e.g. if using --show-total-period, show "Event count" as a first column)

---
 tools/perf/util/annotate.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
tools/perf/util/annotate.c +3 -1
index d4f1a0a..1e1899d 100644
@@ -1850,7 +1850,9 @@ int symbol__annotate_printf(struct symbol *sym, struct map *map,
 			4 * evsel->nr_members : 4;
 
 	graph_dotted_len = printf(" %-*.*s|	Source code & Disassembly of %s for %s (%" PRIu64 " %s)\n",
-				  width, width, "Percent", d_filename, evsel_name,
+				  width, width,
+				  symbol_conf.show_total_period ? "Event count" : "Percent",
+				  d_filename, evsel_name,
 				  symbol_conf.show_total_period ? h->total_period : h->total_samples,
 				  symbol_conf.show_total_period ? "event count" : "samples");
 
Signature · 1 line
2.7.4