Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932753AbcKIO3p (ORCPT ); Wed, 9 Nov 2016 09:29:45 -0500 Received: from mail.kernel.org ([198.145.29.136]:60034 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932219AbcKIO3o (ORCPT ); Wed, 9 Nov 2016 09:29:44 -0500 Date: Wed, 9 Nov 2016 11:29:37 -0300 From: Arnaldo Carvalho de Melo To: Namhyung Kim Cc: Ingo Molnar , Peter Zijlstra , Jiri Olsa , LKML , Markus Trippelsdorf Subject: Re: [PATCH 2/4] perf hist browser: Show folded sign properly on --hierarchy Message-ID: <20161109142937.GG12125@kernel.org> References: <20161108130833.9263-1-namhyung@kernel.org> <20161108130833.9263-3-namhyung@kernel.org> <20161109142811.GF12125@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161109142811.GF12125@kernel.org> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.7.1 (2016-10-04) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1061 Lines: 31 Em Wed, Nov 09, 2016 at 11:28:11AM -0300, Arnaldo Carvalho de Melo escreveu: > Em Tue, Nov 08, 2016 at 10:08:31PM +0900, Namhyung Kim escreveu: > > When horizontall scrolling is used in hierarchy mode, the folded signed > > disappears at the right most column. > > Humm, this indeed shows the '+' folded signal after pressing ->, but it > moves from the first to the third column :-\ > > > +++ b/tools/perf/ui/browsers/hists.c > > @@ -1381,8 +1381,14 @@ static int hist_browser__show_hierarchy_entry(struct hist_browser *browser, > > } > > > > perf_hpp_list__for_each_format(entry->hpp_list, fmt) { > > - ui_browser__write_nstring(&browser->b, "", 2); > > - width -= 2; Also why move this invariant to both branches? > > + if (first) { > > + ui_browser__printf(&browser->b, "%c ", folded_sign); > > + width -= 2; > > + first = false; > > + } else { > > + ui_browser__write_nstring(&browser->b, "", 2); > > + width -= 2; > > + } > > > > /* > > * No need to call hist_entry__snprintf_alignment() > > -- > > 2.10.1