From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936642AbcJVIzA (ORCPT ); Sat, 22 Oct 2016 04:55:00 -0400 Received: from terminus.zytor.com ([198.137.202.10]:57842 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936317AbcJVIy5 (ORCPT ); Sat, 22 Oct 2016 04:54:57 -0400 Date: Sat, 22 Oct 2016 01:54:43 -0700 From: tip-bot for Jiri Olsa Message-ID: Cc: dsahern@gmail.com, a.p.zijlstra@chello.nl, dzickus@redhat.com, jmario@redhat.com, linux-kernel@vger.kernel.org, andi@firstfloor.org, acme@redhat.com, namhyung@kernel.org, jolsa@kernel.org, tglx@linutronix.de, hpa@zytor.com, mingo@kernel.org Reply-To: tglx@linutronix.de, mingo@kernel.org, hpa@zytor.com, jolsa@kernel.org, namhyung@kernel.org, andi@firstfloor.org, acme@redhat.com, jmario@redhat.com, linux-kernel@vger.kernel.org, dsahern@gmail.com, a.p.zijlstra@chello.nl, dzickus@redhat.com To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf c2c report: Recalc width of global sort entries Git-Commit-ID: 25aa84e32df06048d2de5c99fdd4a84fe9a3905f 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: 25aa84e32df06048d2de5c99fdd4a84fe9a3905f Gitweb: http://git.kernel.org/tip/25aa84e32df06048d2de5c99fdd4a84fe9a3905f Author: Jiri Olsa AuthorDate: Tue, 7 Jun 2016 19:02:43 +0200 Committer: Arnaldo Carvalho de Melo CommitDate: Fri, 21 Oct 2016 10:31:58 -0300 perf c2c report: Recalc width of global sort entries Using resort callbacks to compute the columns' width. Computing only the global ones, c2c entries have fixed width only. Signed-off-by: Jiri Olsa Cc: Andi Kleen Cc: David Ahern Cc: Don Zickus Cc: Joe Mario Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/n/tip-zyayvq2u3dzyf3y7i9jza0lw@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/builtin-c2c.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c index f66a6f3..579c9e9 100644 --- a/tools/perf/builtin-c2c.c +++ b/tools/perf/builtin-c2c.c @@ -1728,11 +1728,21 @@ static inline int valid_hitm_or_store(struct hist_entry *he) return has_hitm || c2c_he->stats.store; } +static void calc_width(struct hist_entry *he) +{ + struct c2c_hists *c2c_hists; + + c2c_hists = container_of(he->hists, struct c2c_hists, hists); + hists__calc_col_len(&c2c_hists->hists, he); +} + static int filter_cb(struct hist_entry *he) { if (c2c.show_src && !he->srcline) he->srcline = hist_entry__get_srcline(he); + calc_width(he); + if (!valid_hitm_or_store(he)) he->filtered = HIST_FILTER__C2C; @@ -1748,6 +1758,8 @@ static int resort_cl_cb(struct hist_entry *he) c2c_he = container_of(he, struct c2c_hist_entry, he); c2c_hists = c2c_he->hists; + calc_width(he); + if (display && c2c_hists) { c2c_hists__reinit(c2c_hists, c2c.cl_output, c2c.cl_resort);