mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Greg Price <price@MIT.EDU>
To: Namhyung Kim <namhyung@kernel.org>
Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>,
	linux-kernel@vger.kernel.org,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Paul Mackerras <paulus@samba.org>, Ingo Molnar <mingo@redhat.com>,
	Jiri Olsa <jolsa@redhat.com>, David Ahern <dsahern@gmail.com>
Subject: Re: [PATCH] perf report: Add option to collapse undesired parts of call graph
Date: Mon, 1 Jul 2013 10:05:13 -0400	[thread overview]
Message-ID: <20130701140510.GC22203@biohazard-cafe.mit.edu> (raw)
In-Reply-To: <87obas176f.fsf@sejong.aot.lge.com>

On Thu, Jun 27, 2013 at 01:58:16PM +0900, Namhyung Kim wrote:
> On Wed, 26 Jun 2013 18:25:01 -0400, Greg Price wrote:
> > On Wed, Jun 26, 2013 at 10:28:56AM +0900, Namhyung Kim wrote:
> >> On Sat, 22 Jun 2013 23:17:20 -0400, Greg Price wrote:
> >> > @@ -1211,8 +1214,13 @@ static int machine__resolve_callchain_sample(struct machine *machine,
> >> >  					   MAP__FUNCTION, ip, &al, NULL);
> >> >  		if (al.sym != NULL) {
> >> >  			if (sort__has_parent && !*parent &&
> >> > -			    symbol__match_parent_regex(al.sym))
> >> > +			    symbol__match_regex(al.sym, &parent_regex))
> >> >  				*parent = al.sym;
> >> > +			else if (have_blackbox && root_al &&
> >> > +			         symbol__match_regex(al.sym, &blackbox_regex)) {
> >> > +				*root_al = al;
> >> > +				callchain_cursor_reset(&callchain_cursor);
> >> 
> >> Okay, this is where the magic happens. :)
> >
> > Indeed! :)
> >
> >> So it overwrites the original 'al' in process_sample_event() to
> >> blackboxed symbol and drop the callchain.  Wouldn't it deserve a
> >> comment? :)
> >
> > I could do that.  Perhaps something like
> >   /* ignore the callchain we had so far, i.e. this symbol's callees */
> > Sound like what you had in mind?
> 
> More important thing is, I think, it updates the original al (root_al)
> so that the perf will see the new symbol as if it was sampled in the
> first place and it will collect all of its callers in one place.

OK, I'll try to capture that in a comment in v2.



> >> > +			}
> >> >  			if (!symbol_conf.use_callchain)
> >> >  				break;
> >> pp
> >> This is unrelated to this patch, but why is this line needed?  I guess
> >> this check should be done before calling this function.
> >
> > Hmm.  We actually can get into this function when
> > !symbol_conf.use_callchain, if we're using say --sort=parent.  But I'm
> > still somewhat puzzled, because in that case it looks like we'll break
> > the loop after the first address with a symbol, even if we didn't find
> > the 'parent' there, which seems like it wouldn't serve the purpose.
> 
> Right, that's what I want to say.
> 
> We already have the check before calling this function so breaking the
> loop after checking only first callchain node looks strange.  If we
> don't want to see callchains but only parents, it should either check
> every callchain nodes or fail out as an unsupported operation IMHO.

I agree.  Will reply momentarily with a patch.

I actually wrote a version that tries to keep the optimization, but
decided it was too complicated for what it gains us.

Cheers,
Greg

  reply	other threads:[~2013-07-01 14:07 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-07  7:30 Greg Price
2013-01-11  5:27 ` Arnaldo Carvalho de Melo
2013-02-25  4:28   ` Greg Price
2013-06-23  3:17   ` Greg Price
2013-06-23 21:53     ` Jiri Olsa
2013-06-24  8:32       ` Ingo Molnar
2013-06-24 23:14         ` Greg Price
2013-06-25  7:47           ` Ingo Molnar
2013-06-25  8:01             ` Namhyung Kim
2013-06-26 22:41               ` Greg Price
2013-06-24 22:50       ` Greg Price
2013-06-26  1:28     ` Namhyung Kim
2013-06-26 22:25       ` Greg Price
2013-06-27  4:58         ` Namhyung Kim
2013-07-01 14:05           ` Greg Price [this message]
2013-07-01 14:08           ` [PATCH] perf report: Fix bug in case "--no-call-graph -p foo" Greg Price
2013-07-01 14:28 [PATCH v2] perf report/top: Add option to collapse undesired parts of call graph Greg Price
2013-07-07 13:13 ` Jiri Olsa
2013-07-08 11:57   ` Greg Price
2013-07-08 16:24     ` Jiri Olsa
2013-07-08 16:47       ` Arnaldo Carvalho de Melo
2013-07-19  7:50     ` [tip:perf/core] " tip-bot for Greg Price

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=20130701140510.GC22203@biohazard-cafe.mit.edu \
    --to=price@mit.edu \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@ghostprotocols.net \
    --cc=dsahern@gmail.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=paulus@samba.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®