aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederic Weisbecker <[email protected]>2009-08-17 23:07:49 +0200
committerIngo Molnar <[email protected]>2009-08-18 00:00:18 +0200
commit4bf2364a951d3c043e132e4451d90c7bc74dee83 (patch)
tree601f1b7147a0f498d704b464a4d43add530ae8b4
parent6ede59c412579303a25c11f93d4d262e100fc7e6 (diff)
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 <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Arnaldo Carvalho de Melo <[email protected]> Cc: Mike Galbraith <[email protected]> Cc: Steven Rostedt <[email protected]> LKML-Reference: <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
-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;