From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S942203AbcLWT3L (ORCPT ); Fri, 23 Dec 2016 14:29:11 -0500 Received: from terminus.zytor.com ([198.137.202.10]:50926 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S941860AbcLWT2c (ORCPT ); Fri, 23 Dec 2016 14:28:32 -0500 Date: Fri, 23 Dec 2016 11:27:52 -0800 From: tip-bot for Namhyung Kim Message-ID: Cc: tglx@linutronix.de, dsahern@gmail.com, acme@redhat.com, a.p.zijlstra@chello.nl, jolsa@kernel.org, mingo@kernel.org, namhyung@kernel.org, hpa@zytor.com, linux-kernel@vger.kernel.org Reply-To: mingo@kernel.org, namhyung@kernel.org, hpa@zytor.com, linux-kernel@vger.kernel.org, jolsa@kernel.org, acme@redhat.com, a.p.zijlstra@chello.nl, dsahern@gmail.com, tglx@linutronix.de In-Reply-To: <20161222060350.17655-1-namhyung@kernel.org> References: <20161222060350.17655-1-namhyung@kernel.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/urgent] perf sched timehist: Honour 'comm_width' when aligning the headers Git-Commit-ID: 0e6758e8231d5905c2e267566e9bd679a68a7b00 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: 0e6758e8231d5905c2e267566e9bd679a68a7b00 Gitweb: http://git.kernel.org/tip/0e6758e8231d5905c2e267566e9bd679a68a7b00 Author: Namhyung Kim AuthorDate: Thu, 22 Dec 2016 15:03:48 +0900 Committer: Arnaldo Carvalho de Melo CommitDate: Thu, 22 Dec 2016 16:35:45 -0300 perf sched timehist: Honour 'comm_width' when aligning the headers Current default value is 20, but that may change in the future, so make places where we have 20 hardcoded use 'comm_width'. Signed-off-by: Namhyung Kim Cc: David Ahern Cc: Jiri Olsa Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/20161222060350.17655-1-namhyung@kernel.org [ Split from a larger patch ] Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/builtin-sched.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c index c1c07bf..020f9c9 100644 --- a/tools/perf/builtin-sched.c +++ b/tools/perf/builtin-sched.c @@ -1817,7 +1817,7 @@ static void timehist_header(struct perf_sched *sched) printf(" "); } - printf(" %-20s %9s %9s %9s", + printf(" %-*s %9s %9s %9s", comm_width, "task name", "wait time", "sch delay", "run time"); printf("\n"); @@ -1830,7 +1830,8 @@ static void timehist_header(struct perf_sched *sched) if (sched->show_cpu_visual) printf(" %*s ", ncpus, ""); - printf(" %-20s %9s %9s %9s\n", "[tid/pid]", "(msec)", "(msec)", "(msec)"); + printf(" %-*s %9s %9s %9s\n", comm_width, + "[tid/pid]", "(msec)", "(msec)", "(msec)"); /* * separator @@ -1840,7 +1841,7 @@ static void timehist_header(struct perf_sched *sched) if (sched->show_cpu_visual) printf(" %.*s ", ncpus, graph_dotted_line); - printf(" %.20s %.9s %.9s %.9s", + printf(" %.*s %.9s %.9s %.9s", comm_width, graph_dotted_line, graph_dotted_line, graph_dotted_line, graph_dotted_line);