Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751789AbdGZR3d (ORCPT ); Wed, 26 Jul 2017 13:29:33 -0400 Received: from terminus.zytor.com ([65.50.211.136]:35611 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751452AbdGZR3a (ORCPT ); Wed, 26 Jul 2017 13:29:30 -0400 Date: Wed, 26 Jul 2017 10:27:15 -0700 From: tip-bot for Taeung Song Message-ID: Cc: namhyung@kernel.org, jolsa@redhat.com, milian.wolff@kdab.com, hpa@zytor.com, mingo@kernel.org, acme@redhat.com, tglx@linutronix.de, treeze.taeung@gmail.com, linux-kernel@vger.kernel.org Reply-To: namhyung@kernel.org, jolsa@redhat.com, acme@redhat.com, tglx@linutronix.de, treeze.taeung@gmail.com, linux-kernel@vger.kernel.org, hpa@zytor.com, milian.wolff@kdab.com, mingo@kernel.org In-Reply-To: References: To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf annotate stdio: Fix column header when using --show-total-period Git-Commit-ID: 38d2dcd0ccf85b55d783edbfc14fd8dea4d55b73 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1700 Lines: 38 Commit-ID: 38d2dcd0ccf85b55d783edbfc14fd8dea4d55b73 Gitweb: http://git.kernel.org/tip/38d2dcd0ccf85b55d783edbfc14fd8dea4d55b73 Author: Taeung Song AuthorDate: Tue, 25 Jul 2017 06:28:42 +0900 Committer: Arnaldo Carvalho de Melo CommitDate: Tue, 25 Jul 2017 22:46:37 -0300 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 --- tools/perf/util/annotate.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c index 004072f..c2b4b00 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);