Преглед изворни кода

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>
Ingo Molnar пре 15 година
родитељ
комит
8886f42d6d
1 измењених фајлова са 1 додато и 0 уклоњено
  1. 1 0
      tools/perf/builtin-trace.c

+ 1 - 0
tools/perf/builtin-trace.c

@@ -196,6 +196,7 @@ static int __cmd_trace(void)
 		exit(0);
 		exit(0);
 	}
 	}
 	header = perf_header__read(input);
 	header = perf_header__read(input);
+	head = header->data_offset;
 	sample_type = perf_header__sample_type(header);
 	sample_type = perf_header__sample_type(header);
 
 
 	if (!(sample_type & PERF_SAMPLE_RAW))
 	if (!(sample_type & PERF_SAMPLE_RAW))