Skip to contentSkip to conversation

perf annotate browser: 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 6/9 perf annotate browser: 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 or a 't' hotkey, show "Event count" as a first column)

---
 tools/perf/ui/browsers/annotate.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
tools/perf/ui/browsers/annotate.c +6 -2
index 5ff1799..7800fe2 100644
@@ -166,8 +166,12 @@ static void annotate_browser__write(struct ui_browser *browser, void *entry, int
 
 		if (!show_title)
 			ui_browser__write_nstring(browser, " ", pcnt_width);
-		else
-			ui_browser__printf(browser, "%*s", 7, "Percent");
+		else  {
+			if (annotate_browser__opts.show_total_period)
+				ui_browser__printf(browser, "%*s", 11, "Event count");
+			else
+				ui_browser__printf(browser, "%*s", 7, "Percent");
+		}
 	}
 	if (ab->have_cycles) {
 		if (dl->ipc)
Signature · 1 line
2.7.4