aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-trace.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-09-03 10:19:57 -0400
committerIngo Molnar <mingo@elte.hu>2009-09-03 10:19:57 -0400
commit8886f42d6d8dabeb488c706c339634a0e3e08df4 (patch)
tree21774d1711bfe4f4e49c126f27ff31a5d059bd0c /tools/perf/builtin-trace.c
parent6ddf259da76cab6555c2086386f8bcd10bbb86d2 (diff)
perf trace: Fix parsing of perf.data
We started parsing perf.data at head 0. This caused -D to segfault and it could possibly also case incorrect trace entries to be displayed. Parse it at data_offset instead. Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Mike Galbraith <efault@gmx.de> Cc: Paul Mackerras <paulus@samba.org> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> LKML-Reference: <new-submission> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf/builtin-trace.c')
-rw-r--r--tools/perf/builtin-trace.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index d59bf8a86743..914ab366e369 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -196,6 +196,7 @@ static int __cmd_trace(void)
196 exit(0); 196 exit(0);
197 } 197 }
198 header = perf_header__read(input); 198 header = perf_header__read(input);
199 head = header->data_offset;
199 sample_type = perf_header__sample_type(header); 200 sample_type = perf_header__sample_type(header);
200 201
201 if (!(sample_type & PERF_SAMPLE_RAW)) 202 if (!(sample_type & PERF_SAMPLE_RAW))