From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754027AbdG3JmW (ORCPT ); Sun, 30 Jul 2017 05:42:22 -0400 Received: from terminus.zytor.com ([65.50.211.136]:33069 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753928AbdG3JmV (ORCPT ); Sun, 30 Jul 2017 05:42:21 -0400 Date: Sun, 30 Jul 2017 02:40:06 -0700 From: tip-bot for Arnaldo Carvalho de Melo Message-ID: Cc: treeze.taeung@gmail.com, milian.wolff@kdab.com, jolsa@redhat.com, tglx@linutronix.de, hpa@zytor.com, mingo@kernel.org, acme@redhat.com, linux-kernel@vger.kernel.org, namhyung@kernel.org Reply-To: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@kernel.org, acme@redhat.com, namhyung@kernel.org, milian.wolff@kdab.com, treeze.taeung@gmail.com, jolsa@redhat.com, tglx@linutronix.de To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf annotate stdio: Set enough columns for --show-total-period Git-Commit-ID: ce9ee4a2de20062a97ad50ecc11ebda7e7618fd1 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 Commit-ID: ce9ee4a2de20062a97ad50ecc11ebda7e7618fd1 Gitweb: http://git.kernel.org/tip/ce9ee4a2de20062a97ad50ecc11ebda7e7618fd1 Author: Arnaldo Carvalho de Melo AuthorDate: Wed, 26 Jul 2017 17:16:46 -0300 Committer: Arnaldo Carvalho de Melo CommitDate: Wed, 26 Jul 2017 17:16:46 -0300 perf annotate stdio: Set enough columns for --show-total-period Now that we set the first column header according to wether --show-total-period is being used, we need to size it accordingly. Based-on-a-patch-by: Taeung Song Cc: Jiri Olsa Cc: Milian Wolff Cc: Namhyung Kim Link: http://lkml.kernel.org/n/tip-pu504ffnit4m334k09hxcbs3@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/annotate.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c index c2b4b00..5125c2b 100644 --- a/tools/perf/util/annotate.c +++ b/tools/perf/util/annotate.c @@ -1142,7 +1142,7 @@ static int disasm_line__print(struct disasm_line *dl, struct symbol *sym, u64 st color = get_percent_color(percent); if (symbol_conf.show_total_period) - color_fprintf(stdout, color, " %7" PRIu64, + color_fprintf(stdout, color, " %11" PRIu64, sample.period); else color_fprintf(stdout, color, " %7.2f", percent); @@ -1165,7 +1165,7 @@ static int disasm_line__print(struct disasm_line *dl, struct symbol *sym, u64 st } else if (max_lines && printed >= max_lines) return 1; else { - int width = 8; + int width = symbol_conf.show_total_period ? 12 : 8; if (queue) return -1; @@ -1806,7 +1806,7 @@ int symbol__annotate_printf(struct symbol *sym, struct map *map, int printed = 2, queue_len = 0; int more = 0; u64 len; - int width = 8; + int width = symbol_conf.show_total_period ? 12 : 8; int graph_dotted_len; filename = strdup(dso->long_name);