From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752436AbcIMBAs (ORCPT ); Mon, 12 Sep 2016 21:00:48 -0400 Received: from LGEAMRELO12.lge.com ([156.147.23.52]:45945 "EHLO lgeamrelo12.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750934AbcIMBAr (ORCPT ); Mon, 12 Sep 2016 21:00:47 -0400 X-Original-SENDERIP: 156.147.1.126 X-Original-MAILFROM: namhyung@kernel.org X-Original-SENDERIP: 10.177.227.17 X-Original-MAILFROM: namhyung@kernel.org Date: Tue, 13 Sep 2016 10:00:44 +0900 From: Namhyung Kim To: Arnaldo Carvalho de Melo Cc: Ingo Molnar , Peter Zijlstra , Jiri Olsa , LKML , Andi Kleen Subject: Re: [PATCH 5/7] perf ui/stdio: Reset output width for hierarchy Message-ID: <20160913010044.GC3641@sejong> References: <20160912061958.16656-1-namhyung@kernel.org> <20160912061958.16656-6-namhyung@kernel.org> <20160912142728.GD4897@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20160912142728.GD4897@kernel.org> User-Agent: Mutt/1.7.0 (2016-08-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 12, 2016 at 11:27:28AM -0300, Arnaldo Carvalho de Melo wrote: > Em Mon, Sep 12, 2016 at 03:19:56PM +0900, Namhyung Kim escreveu: > > When --hierarchy option is used, each entry has its own hpp_list to show > > the result. But it missed to update width of each column. > > Missing "Fixes:" tag? This is important for the stable series, that IIRC > uses those tags to semi-automatically figure out what should be picked. Looking at the code again, it already reset the width in the hists__fprintf_hiearachy_headers(). But it's only called when the show_header is true, so perf-top broke alignment. $ sudo perf top --hierarchy --stdio PerfTop: 160 irqs/sec kernel:38.8% exact: 100.0% [4000Hz cycles:pp], (all, 12 CPUs) ------------------------------------------------------------------------------------------- 52.32% perf 24.74% [.] __symbols__insert 5.62% [.] rb_next 5.14% [.] dso__load_sym It's from the commit 1b2dbbf41a0f ("perf hists: Use own hpp_list for hierarchy mode"). I'll fix the code and add the "Fixes:" tag in v2. Thanks, Namhyung > > Signed-off-by: Namhyung Kim > > --- > > tools/perf/ui/stdio/hist.c | 6 ++++++ > > 1 file changed, 6 insertions(+) > > > > diff --git a/tools/perf/ui/stdio/hist.c b/tools/perf/ui/stdio/hist.c > > index 9b65f4a6b35a..83ca728b6f61 100644 > > --- a/tools/perf/ui/stdio/hist.c > > +++ b/tools/perf/ui/stdio/hist.c > > @@ -733,6 +733,7 @@ size_t hists__fprintf(struct hists *hists, bool show_header, int max_rows, > > bool use_callchain) > > { > > struct perf_hpp_fmt *fmt; > > + struct perf_hpp_list_node *node; > > struct rb_node *nd; > > size_t ret = 0; > > const char *sep = symbol_conf.field_sep; > > @@ -745,6 +746,11 @@ size_t hists__fprintf(struct hists *hists, bool show_header, int max_rows, > > > > hists__for_each_format(hists, fmt) > > perf_hpp__reset_width(fmt, hists); > > + /* hierarchy entries have their own hpp list */ > > + list_for_each_entry(node, &hists->hpp_formats, list) { > > + perf_hpp_list__for_each_format(&node->hpp, fmt) > > + perf_hpp__reset_width(fmt, hists); > > + } > > > > if (symbol_conf.col_width_list_str) > > perf_hpp__set_user_width(symbol_conf.col_width_list_str); > > -- > > 2.9.3