linux/tools/perf
Frederic Weisbecker d00a47cce5 perf: Fix warning while reading ring buffer headers
commit e9e94e3bd8
"perf trace: Ignore "overwrite" field if present in
/events/header_page" makes perf trace launching spurious warnings
about unexpected tokens read:

	Warning: Error: expected type 6 but read 4

This change tries to handle the overcommit field in the header_page
file whenever this field is present or not.

The problem is that if this field is not present, we try to find it
and give up in the middle of the line when we realize we are actually
dealing with another field, which is the "data" one. And this failure
abandons the file pointer in the middle of the "data" description
line:

	field: u64 timestamp;	offset:0;	size:8;	signed:0;
	field: local_t commit;	offset:8;	size:8;	signed:1;
	field: char data;	offset:16;	size:4080;	signed:1;
                      ^^^
                      Here

What happens next is that we want to read this line to parse the data
field, but we fail because the pointer is not in the beginning of the
line.

We could probably fix that by rewinding the pointer. But in fact we
don't care much about these headers that only concern the ftrace
ring-buffer. We don't use them from perf.

Just skip this part of perf.data, but don't remove it from recording
to stay compatible with olders perf.data

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
2010-05-01 04:31:48 +02:00
..
arch perf probe: Add PowerPC DWARF register number mappings 2010-04-22 13:48:31 +10:00
bench perf: Fix endianness argument compatibility with OPT_BOOLEAN() and introduce OPT_INCR() 2010-04-14 11:26:44 +02:00
Documentation perf: Remove leftover useless options to record trace events from scripts 2010-04-30 19:55:00 +02:00
scripts perf: Remove leftover useless options to record trace events from scripts 2010-04-30 19:55:00 +02:00
util perf: Fix warning while reading ring buffer headers 2010-05-01 04:31:48 +02:00
.gitignore perf: Ignore perf-archive temp file 2010-01-29 10:37:33 +01:00
builtin-annotate.c perf machines: Make the machines class adopt the dsos__fprintf methods 2010-04-27 21:22:44 -03:00
builtin-bench.c perf bench: Add "all" pseudo subsystem and "all" pseudo suite 2009-12-14 08:51:19 +01:00
builtin-buildid-cache.c perf: Fix endianness argument compatibility with OPT_BOOLEAN() and introduce OPT_INCR() 2010-04-14 11:26:44 +02:00
builtin-buildid-list.c perf machines: Make the machines class adopt the dsos__fprintf methods 2010-04-27 21:22:44 -03:00
builtin-diff.c perf: 'perf kvm' tool for monitoring guest performance from host 2010-04-19 12:37:24 +03:00
builtin-help.c perf: Fix endianness argument compatibility with OPT_BOOLEAN() and introduce OPT_INCR() 2010-04-14 11:26:44 +02:00
builtin-kmem.c perf symbols: Add machine helper routines 2010-04-29 15:25:23 -03:00
builtin-kvm.c perf: 'perf kvm' tool for monitoring guest performance from host 2010-04-19 12:37:24 +03:00
builtin-list.c perf list: Fix large list output by using the pager 2009-08-13 09:05:48 +02:00
builtin-lock.c perf: Generalize perf lock's sample event reordering to the session layer 2010-04-24 03:49:58 +02:00
builtin-probe.c perf probe: Add --max-probes option 2010-04-26 15:35:20 -03:00
builtin-record.c perf tools: Rename "kernel_info" to "machine" 2010-04-27 21:17:50 -03:00
builtin-report.c perf machines: Make the machines class adopt the dsos__fprintf methods 2010-04-27 21:22:44 -03:00
builtin-sched.c perf: Use generic sample reordering in perf sched 2010-04-24 03:50:42 +02:00
builtin-stat.c perf: Fix endianness argument compatibility with OPT_BOOLEAN() and introduce OPT_INCR() 2010-04-14 11:26:44 +02:00
builtin-test.c perf test: Initial regression testing command 2010-04-29 18:59:23 -03:00
builtin-timechart.c perf: Use generic sample reordering in perf timechart 2010-04-24 03:50:46 +02:00
builtin-top.c perf machines: Make the machines class adopt the dsos__fprintf methods 2010-04-27 21:22:44 -03:00
builtin-trace.c perf: Add a perf trace option to check samples ordering reliability 2010-04-24 03:50:48 +02:00
builtin.h perf test: Initial regression testing command 2010-04-29 18:59:23 -03:00
command-list.txt perf test: Initial regression testing command 2010-04-29 18:59:23 -03:00
CREDITS perf_counter tools: Add CREDITS file for Git contributors 2009-06-24 19:54:29 +02:00
design.txt perf: Fix few typos + cosmetics 2010-01-13 17:39:44 +01:00
Makefile perf test: Initial regression testing command 2010-04-29 18:59:23 -03:00
perf-archive.sh perf archive: Explain how to use the generated tarball 2010-03-23 20:33:08 +01:00
perf.c perf test: Initial regression testing command 2010-04-29 18:59:23 -03:00
perf.h perf: 'perf kvm' tool for monitoring guest performance from host 2010-04-19 12:37:24 +03:00