linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@redhat.com>
To: linux-kernel@vger.kernel.org
Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Ingo Molnar <mingo@elte.hu>, Paul Mackerras <paulus@samba.org>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Jiri Olsa <jolsa@redhat.com>
Subject: [PATCH 1/4] perf tools: Do backtrace post unwind only if we regs and stack were captured
Date: Mon, 10 Sep 2012 18:50:16 +0200	[thread overview]
Message-ID: <1347295819-23177-2-git-send-email-jolsa@redhat.com> (raw)
In-Reply-To: <1347295819-23177-1-git-send-email-jolsa@redhat.com>

Bail out without error if we want to do backtrace post unwind,
back were not able to capture user registers or user stack
during the record phase, which is possible and valid case.

Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Signed-off-by: Jiri Olsa <jolsa@redhat.com>
---
 tools/perf/util/session.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index 9453758..90278ee 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -388,6 +388,11 @@ int machine__resolve_callchain(struct machine *machine,
 	      (evsel->attr.sample_type & PERF_SAMPLE_STACK_USER)))
 		return 0;
 
+	/* Bail out if nothing was captured. */
+	if ((!sample->user_regs.regs) ||
+	    (!sample->user_stack.size))
+		return 0;
+
 	return unwind__get_entries(unwind_entry, &callchain_cursor, machine,
 				   thread, evsel->attr.sample_regs_user,
 				   sample);
-- 
1.7.11.4


  reply	other threads:[~2012-09-10 16:51 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-10 16:50 [PATCH 0/4] perf tools: Back [vdso] DSO with real data Jiri Olsa
2012-09-10 16:50 ` Jiri Olsa [this message]
2012-09-14  5:58   ` [tip:perf/core] perf tools: Do backtrace post unwind only if we regs and stack were captured tip-bot for Jiri Olsa
2012-09-10 16:50 ` [PATCH 2/4] perf tools: Add memdup function Jiri Olsa
2012-09-14  5:59   ` [tip:perf/core] " tip-bot for Jiri Olsa
2012-09-10 16:50 ` [PATCH 3/4] perf dso: Make dsos__find function globally available Jiri Olsa
2012-09-14  6:00   ` [tip:perf/core] perf symbols: " tip-bot for Jiri Olsa
2012-09-10 16:50 ` [PATCH 4/4] perf tools: Back [vdso] DSO with real data Jiri Olsa
2012-09-10 16:56   ` Peter Zijlstra
2012-09-14  6:01   ` [tip:perf/core] " tip-bot for Jiri Olsa

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=1347295819-23177-2-git-send-email-jolsa@redhat.com \
    --to=jolsa@redhat.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@ghostprotocols.net \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --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;
as well as URLs for NNTP newsgroup(s).