Skip to content

Commit

Permalink
perf tools: Warn while running perf trace without sample
Browse files Browse the repository at this point in the history
When a user runs perf trace using an input with logged
counters without PERF_SAMPLE_RAW attribute, warn by giving a
nice tip.

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Steven Rostedt <rostedt@goodmis.org>
LKML-Reference: <1250543271-8383-2-git-send-email-fweisbec@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Frederic Weisbecker authored and Ingo Molnar committed Aug 17, 2009
1 parent 6ede59c commit 4bf2364
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tools/perf/builtin-trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,10 @@ static int __cmd_trace(void)
header = perf_header__read(input);
sample_type = perf_header__sample_type(header);

if (!(sample_type & PERF_SAMPLE_RAW))
die("No trace sample to read. Did you call perf record "
"without -R?");

if (load_kernel() < 0) {
perror("failed to load kernel symbols");
return EXIT_FAILURE;
Expand Down

0 comments on commit 4bf2364

Please sign in to comment.