public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arun Sharma <asharma@fb.com>
To: Sam Liao <phyomh@gmail.com>
Cc: linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org,
	acme@redhat.com
Subject: Re: [PATCH] Add inverted call graph report support to perf tool
Date: Fri, 11 Mar 2011 17:31:25 -0800	[thread overview]
Message-ID: <20110312013125.GA24618@dev1756.snc6.facebook.com> (raw)
In-Reply-To: <AANLkTi=vxgHe=dqz+xEPcZ9oBexM1jBxFz3sXA2DJEZA@mail.gmail.com>

On Mon, Mar 07, 2011 at 09:43:27PM +0800, Sam Liao wrote:
> +
> +	/* reverse call chain data */
> +	if (reverse_call && symbol_conf.use_callchain && sample->callchain) {

You probably want to check for nr > 1 here, as in:

 	/* reverse call chain data */
-	if (reverse_call && symbol_conf.use_callchain && sample->callchain) {
+	if (reverse_call && symbol_conf.use_callchain && sample->callchain
+	    && (sample->callchain->nr > 1)) {
 		struct ip_callchain *chain;
 		int i, j;
 		u64 tmp_ip;

Otherwise, if you get a callchain with ->nr == 0, the loop with (nr - 2) will
go on for a long time.

 -Arun

      parent reply	other threads:[~2011-03-17 17:53 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-07 13:43 [PATCH] Add inverted call graph report support to perf tool Sam Liao
2011-03-07 18:06 ` Frederic Weisbecker
2011-03-08  8:59   ` Sam Liao
2011-03-10  2:43     ` Frederic Weisbecker
2011-03-10  6:48       ` Ingo Molnar
2011-03-11 10:51         ` Frederic Weisbecker
2011-03-11 14:45           ` Arnaldo Carvalho de Melo
2011-03-10 14:32       ` Sam Liao
2011-03-11 11:57         ` Frederic Weisbecker
2011-03-11 12:07           ` Frederic Weisbecker
2011-03-12 14:59           ` Sam Liao
2011-05-06  8:54             ` Ingo Molnar
2011-03-12  1:31 ` Arun Sharma [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=20110312013125.GA24618@dev1756.snc6.facebook.com \
    --to=asharma@fb.com \
    --cc=acme@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=phyomh@gmail.com \
    /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