Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754626AbcC3VHq (ORCPT ); Wed, 30 Mar 2016 17:07:46 -0400 Received: from mail.kernel.org ([198.145.29.136]:56926 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753849AbcC3VHo (ORCPT ); Wed, 30 Mar 2016 17:07:44 -0400 Date: Wed, 30 Mar 2016 18:07:39 -0300 From: Arnaldo Carvalho de Melo To: Namhyung Kim Cc: Andres Freund , Peter Zijlstra , Ingo Molnar , linux-kernel@vger.kernel.org Subject: Re: "perf hists browser: Support flat callchains" appears to have broken parent reporting Message-ID: <20160330210738.GF3420@kernel.org> References: <20160330123418.GC12336@awork2.anarazel.de> <20160330134634.GA3420@kernel.org> <20160330141926.GA5242@awork2.anarazel.de> <20160330160010.GA1557@danjae> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160330160010.GA1557@danjae> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2588 Lines: 74 Em Thu, Mar 31, 2016 at 01:00:10AM +0900, Namhyung Kim escreveu: > Hi Andres, > > On Wed, Mar 30, 2016 at 04:19:26PM +0200, Andres Freund wrote: > > On 2016-03-30 10:46:34 -0300, Arnaldo Carvalho de Melo wrote: > > > Em Wed, Mar 30, 2016 at 02:34:18PM +0200, Andres Freund escreveu: > > > > Hi, > > > > > > > > 4b3a3212233a - "perf hists browser: Support flat callchains" seems to > > > > have broken callchain display in tui mode when using !flat mode, or at > > > > least changed it in an unintended manner. > > > > > > humm, at first I thought this would be related to --percent-limit... > > > > I'm not using --percent-limit. Just to be sure, I did explicitly set it > > to various values, and it looks unrelated. > > > > > What tree/branch are you using? Can you try pressing 'L' to play with > > > the percent limit? > > > > I'm primarily using linus' tree, and bisected the behavioural down to > > that individual commit. > > Thanks for reporting and finding this! Yeah, I noticed it now, we really need to do the equivalent of: perf report --tui E P Then get the perf.hist.N file before a patch and after it, to see if the output changed :-\ Ditto for 'perf report --stdio' > before, after, diff. - Arnaldo > > It's somewhat weird that --stdio doesn't show the problem, but --tui > > does. Hm. > > > > > > I don't know the perf code at all, but skimming through the commit, the > > following hunk looks suspicious: > > > > @@ -263,7 +295,7 @@ static void callchain_node__init_have_children(struct callchain_node *node, > > chain = list_entry(node->val.next, struct callchain_list, list); > > chain->has_children = has_sibling; > > > > - if (!list_empty(&node->val)) { > > + if (node->val.next != node->val.prev) { > > chain = list_entry(node->val.prev, struct callchain_list, list); > > chain->has_children = !RB_EMPTY_ROOT(&node->rb_root); > > } > > > > Reverting that individual change fixes things. I'm not actually sure > > what the post 4b3a3212233a version actually tests for? > > Yeah, this is it. It's my fault that I thought if the first chain > (node->val.next) was set by has_sibling, no need to go to the body > of the "if" statement when next == prev case. But it's not... > > > > > > > I think that actually explains why stdio works - nodes are always > > unfolded in it, thus ->has_children isn't looked at. > > Right, the ->has_children thing is only for TUI code which > folds/collapses the entries dynamically. > > Do you mind resending the fix as a formal patch with my ack ? > > Thanks, > Namhyung