From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932391AbcBYGbv (ORCPT ); Thu, 25 Feb 2016 01:31:51 -0500 Received: from torg.zytor.com ([198.137.202.12]:54860 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1758251AbcBYG1H (ORCPT ); Thu, 25 Feb 2016 01:27:07 -0500 Date: Wed, 24 Feb 2016 21:38:25 -0800 From: tip-bot for Namhyung Kim Message-ID: Cc: andi@firstfloor.org, acme@redhat.com, tglx@linutronix.de, namhyung@kernel.org, linux-kernel@vger.kernel.org, dsahern@gmail.com, hpa@zytor.com, mingo@kernel.org, jolsa@kernel.org, peterz@infradead.org Reply-To: dsahern@gmail.com, hpa@zytor.com, linux-kernel@vger.kernel.org, namhyung@kernel.org, mingo@kernel.org, peterz@infradead.org, jolsa@kernel.org, andi@firstfloor.org, acme@redhat.com, tglx@linutronix.de In-Reply-To: <1456064558-13086-5-git-send-email-namhyung@kernel.org> References: <1456064558-13086-5-git-send-email-namhyung@kernel.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf tools: Fix column width setting on 'trace' sort key Git-Commit-ID: 0c0af78d472f96efe04daaaccede7522b2394b76 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: 0c0af78d472f96efe04daaaccede7522b2394b76 Gitweb: http://git.kernel.org/tip/0c0af78d472f96efe04daaaccede7522b2394b76 Author: Namhyung Kim AuthorDate: Sun, 21 Feb 2016 23:22:38 +0900 Committer: Arnaldo Carvalho de Melo CommitDate: Mon, 22 Feb 2016 12:06:53 -0300 perf tools: Fix column width setting on 'trace' sort key It missed to update column length of the 'trace' sort key in the hists__calc_col_len() so it might truncate the output. It calculated the column length in the ->cmp() callback originally but it doesn't guarantee it's called always. Signed-off-by: Namhyung Kim Acked-by: Jiri Olsa Cc: Andi Kleen Cc: David Ahern Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/1456064558-13086-5-git-send-email-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/hist.c | 3 +++ tools/perf/util/sort.c | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c index 827c6cb..017eb5c 100644 --- a/tools/perf/util/hist.c +++ b/tools/perf/util/hist.c @@ -179,6 +179,9 @@ void hists__calc_col_len(struct hists *hists, struct hist_entry *h) if (h->transaction) hists__new_col_len(hists, HISTC_TRANSACTION, hist_entry__transaction_len()); + + if (h->trace_output) + hists__new_col_len(hists, HISTC_TRACE, strlen(h->trace_output)); } void hists__output_recalc_col_len(struct hists *hists, int max_rows) diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c index a7d73e5..6d0f858 100644 --- a/tools/perf/util/sort.c +++ b/tools/perf/util/sort.c @@ -483,9 +483,6 @@ sort__trace_cmp(struct hist_entry *left, struct hist_entry *right) if (right->trace_output == NULL) right->trace_output = get_trace_output(right); - hists__new_col_len(left->hists, HISTC_TRACE, strlen(left->trace_output)); - hists__new_col_len(right->hists, HISTC_TRACE, strlen(right->trace_output)); - return strcmp(right->trace_output, left->trace_output); }