linux/kernel/trace
David Sharp e1e3592735 ring_buffer: Off-by-one and duplicate events in ring_buffer_read_page
Fix two related problems in the event-copying loop of
ring_buffer_read_page.

The loop condition for copying events is off-by-one.
"len" is the remaining space in the caller-supplied page.
"size" is the size of the next event (or two events).
If len == size, then there is just enough space for the next event.

size was set to rb_event_ts_length, which may include the size of two
events if the first event is a time-extend, in order to assure time-
extends are kept together with the event after it. However,
rb_advance_reader always advances by one event. This would result in the
event after any time-extend being duplicated. Instead, get the size of
a single event for the memcpy, but use rb_event_ts_length for the loop
condition.

Signed-off-by: David Sharp <dhsharp@google.com>
LKML-Reference: <1293064704-8101-1-git-send-email-dhsharp@google.com>
LKML-Reference: <AANLkTin7nLrRPc9qGjdjHbeVDDWiJjAiYyb-L=gH85bx@mail.gmail.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2010-12-23 12:09:30 -05:00
..
blktrace.c block: remove REQ_HARDBARRIER 2010-11-10 14:54:09 +01:00
ftrace.c
Kconfig [S390] ftrace: build without frame pointers on s390 2010-11-10 10:05:54 +01:00
Makefile
power-traces.c
ring_buffer.c ring_buffer: Off-by-one and duplicate events in ring_buffer_read_page 2010-12-23 12:09:30 -05:00
ring_buffer_benchmark.c
trace.c Merge branch 'tip/perf/urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace into perf/urgent 2010-12-16 11:21:24 +01:00
trace.h
trace_branch.c
trace_clock.c
trace_entries.h
trace_event_perf.c
trace_events.c
trace_events_filter.c
trace_export.c
trace_functions.c
trace_functions_graph.c
trace_irqsoff.c
trace_kdb.c
trace_kprobe.c Remove duplicate includes from many files 2010-10-27 18:03:18 -07:00
trace_mmiotrace.c
trace_nop.c
trace_output.c
trace_output.h
trace_printk.c
trace_sched_switch.c
trace_sched_wakeup.c
trace_selftest.c
trace_selftest_dynamic.c
trace_stack.c
trace_stat.c
trace_stat.h
trace_syscalls.c
trace_workqueue.c