public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Jiri Olsa <jolsa@redhat.com>
To: linux-tip-commits@vger.kernel.org
Cc: acme@redhat.com, linux-kernel@vger.kernel.org, paulus@samba.org,
	hpa@zytor.com, mingo@kernel.org, a.p.zijlstra@chello.nl,
	jolsa@redhat.com, fweisbec@gmail.com, tglx@linutronix.de
Subject: [tip:perf/core] perf tools: Do backtrace post unwind only if we regs and stack were captured
Date: Thu, 13 Sep 2012 22:58:19 -0700	[thread overview]
Message-ID: <tip-bdde37163e1fd474509aab90f5eaacee46100107@git.kernel.org> (raw)
In-Reply-To: <1347295819-23177-2-git-send-email-jolsa@redhat.com>

Commit-ID:  bdde37163e1fd474509aab90f5eaacee46100107
Gitweb:     http://git.kernel.org/tip/bdde37163e1fd474509aab90f5eaacee46100107
Author:     Jiri Olsa <jolsa@redhat.com>
AuthorDate: Mon, 10 Sep 2012 18:50:16 +0200
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Tue, 11 Sep 2012 12:01:15 -0300

perf tools: Do backtrace post unwind only if we regs and stack were captured

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

Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1347295819-23177-2-git-send-email-jolsa@redhat.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/session.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index 3806ea4..0ecd62b 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);

  reply	other threads:[~2012-09-14  5:58 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 ` [PATCH 1/4] perf tools: Do backtrace post unwind only if we regs and stack were captured Jiri Olsa
2012-09-14  5:58   ` tip-bot for Jiri Olsa [this message]
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=tip-bdde37163e1fd474509aab90f5eaacee46100107@git.kernel.org \
    --to=jolsa@redhat.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@redhat.com \
    --cc=fweisbec@gmail.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=paulus@samba.org \
    --cc=tglx@linutronix.de \
    /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