]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
perf trace: Fix parsing of perf.data
authorIngo Molnar <mingo@elte.hu>
Thu, 3 Sep 2009 14:19:57 +0000 (16:19 +0200)
committerIngo Molnar <mingo@elte.hu>
Thu, 3 Sep 2009 14:19:57 +0000 (16:19 +0200)
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>
tools/perf/builtin-trace.c

index d59bf8a8674382d6927ee6fded802b1f51bcc35d..914ab366e369a75142c86207af6cc294416c983b 100644 (file)
@@ -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))