Commit 4bf2364a authored by Frederic Weisbecker's avatar Frederic Weisbecker Committed by Ingo Molnar

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: default avatarFrederic 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: default avatarIngo Molnar <mingo@elte.hu>
parent 6ede59c4
...@@ -184,6 +184,10 @@ static int __cmd_trace(void) ...@@ -184,6 +184,10 @@ static int __cmd_trace(void)
header = perf_header__read(input); header = perf_header__read(input);
sample_type = perf_header__sample_type(header); 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) { if (load_kernel() < 0) {
perror("failed to load kernel symbols"); perror("failed to load kernel symbols");
return EXIT_FAILURE; return EXIT_FAILURE;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment