Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754822AbdGSViZ (ORCPT ); Wed, 19 Jul 2017 17:38:25 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]:38206 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932262AbdGSVhD (ORCPT ); Wed, 19 Jul 2017 17:37:03 -0400 From: Taeung Song To: Arnaldo Carvalho de Melo Cc: linux-kernel@vger.kernel.org, Milian Wolff , Namhyung Kim , Jiri Olsa Subject: [PATCH v3 4/9] perf annotate: Show the proper header when using --show-total-period Date: Thu, 20 Jul 2017 06:36:59 +0900 Message-Id: <1500500219-16694-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: 1157 Lines: 29 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) Reported-by: Milian Wolff Cc: Namhyung Kim Cc: Jiri Olsa Signed-off-by: Taeung Song --- tools/perf/util/annotate.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c index d4f1a0a..1e1899d 100644 --- a/tools/perf/util/annotate.c +++ b/tools/perf/util/annotate.c @@ -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"); -- 2.7.4