Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751934AbdG0QQT (ORCPT ); Thu, 27 Jul 2017 12:16:19 -0400 Received: from mail-pg0-f66.google.com ([74.125.83.66]:37023 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751441AbdG0QQQ (ORCPT ); Thu, 27 Jul 2017 12:16:16 -0400 From: Taeung Song To: Arnaldo Carvalho de Melo Cc: linux-kernel@vger.kernel.org, Milian Wolff , Namhyung Kim , Jiri Olsa Subject: [PATCH v4 4/9] perf annotate browser: Show the proper header when using --show-total-period Date: Fri, 28 Jul 2017 01:16:09 +0900 Message-Id: <1501172169-6761-1-git-send-email-treeze.taeung@gmail.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1155 Lines: 34 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) Reported-by: Milian Wolff Cc: Namhyung Kim Cc: Jiri Olsa Signed-off-by: Taeung Song --- tools/perf/ui/browsers/annotate.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/perf/ui/browsers/annotate.c b/tools/perf/ui/browsers/annotate.c index 87b0395..9fd4413 100644 --- a/tools/perf/ui/browsers/annotate.c +++ b/tools/perf/ui/browsers/annotate.c @@ -165,8 +165,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) -- 2.7.4