summaryrefslogtreecommitdiff
path: root/tools/perf/builtin-trace.c
diff options
context:
space:
mode:
authorFrederic Weisbecker <fweisbec@gmail.com>2009-08-18 01:07:49 +0400
committerIngo Molnar <mingo@elte.hu>2009-08-18 02:00:18 +0400
commit4bf2364a951d3c043e132e4451d90c7bc74dee83 (patch)
tree601f1b7147a0f498d704b464a4d43add530ae8b4 /tools/perf/builtin-trace.c
parent6ede59c412579303a25c11f93d4d262e100fc7e6 (diff)
downloadlinux-4bf2364a951d3c043e132e4451d90c7bc74dee83.tar.xz
perf tools: Warn while running perf trace without sample
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>
Diffstat (limited to 'tools/perf/builtin-trace.c')
-rw-r--r--tools/perf/builtin-trace.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index b160a9f61bf3..88eef71bce6d 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -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;