aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/probe-event.c
diff options
context:
space:
mode:
authorDavid Sharp <dhsharp@google.com>2010-12-22 16:38:24 -0800
committerSteven Rostedt <rostedt@goodmis.org>2010-12-23 12:09:30 -0500
commite1e359273576ee8fe27021356b064c772ed29af3 (patch)
treec1a8aa53fb3044162851aa7a7bc9d72f710232d1 /tools/perf/util/probe-event.c
parentMerge branch 'perf/urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux-2.6 into perf/urgent (diff)
downloadlinux-dev-e1e359273576ee8fe27021356b064c772ed29af3.tar.xz
linux-dev-e1e359273576ee8fe27021356b064c772ed29af3.zip
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>
Diffstat (limited to 'tools/perf/util/probe-event.c')
0 files changed, 0 insertions, 0 deletions