aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf
diff options
context:
space:
mode:
authorDavid Ahern <dsahern@gmail.com>2012-06-11 15:48:41 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2012-06-27 12:19:14 -0400
commit300aa941650e98966ad85847527537df5b11a87e (patch)
tree83fd299ea56896040325c57fb0f862cdb168cdc6 /tools/perf
parent08942f6d5d992e9486b07653fd87ea8182a22fa0 (diff)
perf report: Delay sample_type checks in pipe mode
The pipeline: perf record -a -g -o - sleep 5 |perf inject -v -b | perf report -g -i - generates the warning: Selected -g but no callchain data. Did you call 'perf record' without -g? The problem is that the header data is not written to the pipe, so the sample_type has not been available when perf_report__setup_sample_type is called. For pipe mode, record dumps the sample type as part of the synthesized events stream -- perf_event__synthesize_attrs(). Handle this be detecting pipe mode and not doing early sanity checks on sample_type. Signed-off-by: David Ahern <dsahern@gmail.com> Tested-by: Tim Chen <tim.c.chen@linux.intel.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Tim Chen <tim.c.chen@linux.intel.com> Link: http://lkml.kernel.org/r/1339444121-26236-1-git-send-email-dsahern@gmail.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf')
-rw-r--r--tools/perf/builtin-report.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index 40b0ffc3ad3b..69b1c1185159 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -245,11 +245,12 @@ static int process_read_event(struct perf_tool *tool,
245 return 0; 245 return 0;
246} 246}
247 247
248/* For pipe mode, sample_type is not currently set */
248static int perf_report__setup_sample_type(struct perf_report *rep) 249static int perf_report__setup_sample_type(struct perf_report *rep)
249{ 250{
250 struct perf_session *self = rep->session; 251 struct perf_session *self = rep->session;
251 252
252 if (!(self->sample_type & PERF_SAMPLE_CALLCHAIN)) { 253 if (!self->fd_pipe && !(self->sample_type & PERF_SAMPLE_CALLCHAIN)) {
253 if (sort__has_parent) { 254 if (sort__has_parent) {
254 ui__error("Selected --sort parent, but no " 255 ui__error("Selected --sort parent, but no "
255 "callchain data. Did you call " 256 "callchain data. Did you call "
@@ -272,7 +273,8 @@ static int perf_report__setup_sample_type(struct perf_report *rep)
272 } 273 }
273 274
274 if (sort__branch_mode == 1) { 275 if (sort__branch_mode == 1) {
275 if (!(self->sample_type & PERF_SAMPLE_BRANCH_STACK)) { 276 if (!self->fd_pipe &&
277 !(self->sample_type & PERF_SAMPLE_BRANCH_STACK)) {
276 ui__error("Selected -b but no branch data. " 278 ui__error("Selected -b but no branch data. "
277 "Did you call perf record without -b?\n"); 279 "Did you call perf record without -b?\n");
278 return -1; 280 return -1;