All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Namhyung Kim <namhyung@kernel.org>
Cc: Andres Freund <andres@anarazel.de>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Ingo Molnar <mingo@redhat.com>,
	linux-kernel@vger.kernel.org
Subject: Re: "perf hists browser: Support flat callchains" appears to have broken parent reporting
Date: Wed, 30 Mar 2016 18:07:39 -0300	[thread overview]
Message-ID: <20160330210738.GF3420@kernel.org> (raw)
In-Reply-To: <20160330160010.GA1557@danjae>

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

      parent reply	other threads:[~2016-03-30 21:07 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-30 12:34 "perf hists browser: Support flat callchains" appears to have broken parent reporting Andres Freund
2016-03-30 13:46 ` Arnaldo Carvalho de Melo
2016-03-30 14:19   ` Andres Freund
2016-03-30 16:00     ` Namhyung Kim
2016-03-30 19:02       ` Andres Freund
2016-03-31  6:33         ` [tip:perf/urgent] perf hists: Fix determination of a callchain node's childlessness tip-bot for Andres Freund
2016-04-16 19:46           ` Andres Freund
2016-04-18 14:07             ` Arnaldo Carvalho de Melo
2016-04-18 14:25           ` Andres Freund
2016-05-02 22:17             ` Greg KH
2016-05-02 22:25               ` Andres Freund
2016-05-02 23:24                 ` Greg KH
2016-05-02 23:34                   ` Andres Freund
2016-03-30 21:07       ` Arnaldo Carvalho de Melo [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160330210738.GF3420@kernel.org \
    --to=acme@kernel.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=andres@anarazel.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.