public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Stephane Eranian <eranian@google.com>
To: linux-kernel@vger.kernel.org
Cc: acme@redhat.com, mingo@elte.hu, peterz@infradead.org,
	dsahern@gmail.com, namhyung.kim@lge.com
Subject: [PATCH] perf report: fix error with -g in pipe mode
Date: Tue, 10 Apr 2012 12:13:28 +0200	[thread overview]
Message-ID: <20120410101327.GA8104@quad> (raw)

In pipe mode, we cannot check the validity of sample_type
or the branch view mode until we start processing the events.
There is no meta-data information at the beginning of the pipe
mode stream. Instead, all the meta data is pushed via pseudo
records and those get processed by process_sample_events().

Without this patch:
  $ perf record -g -o - foo | perf inject -b | perf report -g -i -
  Selected -g but no callchain data. Did you call 'perf record' without -g?

Signed-off-by: Stephane Eranian <eranian@google.com>
---

diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index 2e31743..c338b97 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -249,6 +249,13 @@ static int perf_report__setup_sample_type(struct perf_report *rep)
 {
 	struct perf_session *self = rep->session;
 
+	/*
+	 * cannot determine sample type, branch mode until we have
+	 * processed the meta-data pseudo records via process_sample_events()
+	 */
+	if (self->fd_pipe)
+		return 0;
+
 	if (!(self->sample_type & PERF_SAMPLE_CALLCHAIN)) {
 		if (sort__has_parent) {
 			ui__warning("Selected --sort parent, but no "

             reply	other threads:[~2012-04-10 10:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-10 10:13 Stephane Eranian [this message]
2012-04-10 16:33 ` [PATCH] perf report: fix error with -g in pipe mode David Ahern

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=20120410101327.GA8104@quad \
    --to=eranian@google.com \
    --cc=acme@redhat.com \
    --cc=dsahern@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=namhyung.kim@lge.com \
    --cc=peterz@infradead.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