From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964901AbcISNOM (ORCPT ); Mon, 19 Sep 2016 09:14:12 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46458 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S940551AbcISNMY (ORCPT ); Mon, 19 Sep 2016 09:12:24 -0400 From: Jiri Olsa To: Arnaldo Carvalho de Melo Cc: lkml , Don Zickus , Joe Mario , Ingo Molnar , Peter Zijlstra , Namhyung Kim , David Ahern , Andi Kleen Subject: [PATCH 55/61] perf c2c report: Recalc width of global sort entries Date: Mon, 19 Sep 2016 15:10:04 +0200 Message-Id: <1474290610-23241-56-git-send-email-jolsa@kernel.org> In-Reply-To: <1474290610-23241-1-git-send-email-jolsa@kernel.org> References: <1474290610-23241-1-git-send-email-jolsa@kernel.org> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Mon, 19 Sep 2016 13:12:23 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Using resort callbacks to compute the columns' width. Computing only the global ones, c2c entries have fixed width only. Link: http://lkml.kernel.org/n/tip-zyayvq2u3dzyf3y7i9jza0lw@git.kernel.org Signed-off-by: Jiri Olsa --- 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 ff8a66ee7092..c93a766190b1 100644 --- a/tools/perf/builtin-c2c.c +++ b/tools/perf/builtin-c2c.c @@ -1726,11 +1726,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; @@ -1746,6 +1756,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); -- 2.7.4