Skip to content

Commit

Permalink
perf trace: Fix parsing of perf.data
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ingo Molnar committed Sep 3, 2009
1 parent 6ddf259 commit 8886f42
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tools/perf/builtin-trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ static int __cmd_trace(void)
exit(0);
}
header = perf_header__read(input);
head = header->data_offset;
sample_type = perf_header__sample_type(header);

if (!(sample_type & PERF_SAMPLE_RAW))
Expand Down

0 comments on commit 8886f42

Please sign in to comment.