Skip to contentSkip to conversation

perf trace: Fix parsing of perf.data

tip:perfcounters/core tip-bot for Ingo Molnar 1 participant 1 message Sep 3, 2009 perf events

lore
Share & tools
lore
#0 lore raw
Commit-ID:  8886f42d6d8dabeb488c706c339634a0e3e08df4
Gitweb:     http://git.kernel.org/tip/8886f42d6d8dabeb488c706c339634a0e3e08df4
Author:     Ingo Molnar <[email protected]>
AuthorDate: Thu, 3 Sep 2009 16:19:57 +0200
Committer:  Ingo Molnar <[email protected]>
CommitDate: Thu, 3 Sep 2009 16:19:57 +0200

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 <[email protected]>
Cc: Mike Galbraith <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Arnaldo Carvalho de Melo <[email protected]>
Cc: Frederic Weisbecker <[email protected]>
LKML-Reference: <new-submission>

---
 tools/perf/builtin-trace.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
tools/perf/builtin-trace.c +1 -0
index d59bf8a..914ab36 100644
@@ -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))