linux/kernel/trace
Steven Rostedt 436fc28026 tracing: Fix returning of duplicate data after EOF in trace_pipe_raw
The trace_pipe_raw handler holds a cached page from the time the file
is opened to the time it is closed. The cached page is used to handle
the case of the user space buffer being smaller than what was read from
the ring buffer. The left over buffer is held in the cache so that the
next read will continue where the data left off.

After EOF is returned (no more data in the buffer), the index of
the cached page is set to zero. If a user app reads the page again
after EOF, the check in the buffer will see that the cached page
is less than page size and will return the cached page again. This
will cause reading the trace_pipe_raw again after EOF to return
duplicate data, making the output look like the time went backwards
but instead data is just repeated.

The fix is to not reset the index right after all data is read
from the cache, but to reset it after all data is read and more
data exists in the ring buffer.

Cc: stable <stable@kernel.org>
Reported-by: Jeremy Eder <jeder@redhat.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2011-10-14 10:44:25 -04:00
..
blktrace.c blktrace: add FLUSH/FUA support 2011-08-11 10:36:05 +02:00
ftrace.c tracing: Warn on output if the function tracer was found corrupted 2011-10-11 09:13:25 -04:00
Kconfig trace events: Update version number reference to new 3.x scheme for EVENT_POWER_TRACING_DEPRECATED 2011-07-25 09:37:21 +02:00
Makefile tracing/filter: Add startup tests for events filter 2011-08-19 14:35:59 -04:00
power-traces.c perf: Clean up power events by introducing new, more generic ones 2011-01-04 08:16:54 +01:00
ring_buffer.c trace: Add ring buffer stats to measure rate of events 2011-08-30 12:27:45 -04:00
ring_buffer_benchmark.c tracing: Use NUMA allocation for per-cpu ring buffer pages 2011-06-14 22:04:39 -04:00
trace.c tracing: Fix returning of duplicate data after EOF in trace_pipe_raw 2011-10-14 10:44:25 -04:00
trace.h tracing: Warn on output if the function tracer was found corrupted 2011-10-11 09:13:25 -04:00
trace_branch.c tracing: Allow events to share their print functions 2010-05-14 14:20:32 -04:00
trace_clock.c tracing: Add a counter clock for those that do not trust clocks 2011-09-19 11:35:58 -04:00
trace_entries.h tracing: Have dynamic size event stack traces 2011-07-14 16:36:53 -04:00
trace_event_perf.c tracing: New flag to allow non privileged users to use a trace event 2010-11-18 14:37:40 +01:00
trace_events.c Merge branch 'perf/urgent' into perf/core 2011-07-21 09:29:21 +02:00
trace_events_filter.c tracing: Add preempt disable for filter self test 2011-08-30 12:27:07 -04:00
trace_events_filter_test.h tracing/filter: Add startup tests for events filter 2011-08-19 14:35:59 -04:00
trace_export.c tracing: Replace trace_event struct array with pointer array 2011-02-02 21:37:13 -05:00
trace_functions.c ftrace: Fix regression of :mod:module function enabling 2011-07-07 11:30:08 -04:00
trace_functions_graph.c tracing: Still trace filtered irq functions when irq trace is disabled 2011-07-07 22:26:27 -04:00
trace_irqsoff.c tracing: Fix preemptirqsoff tracer to not stop at preempt off 2011-09-22 11:11:51 -04:00
trace_kdb.c kdb,ftdump: Remove reference to internal kdb include 2010-10-22 15:34:11 -05:00
trace_kprobe.c ftrace/kprobes: Fix not to delete probes if in use 2011-10-10 15:13:03 -04:00
trace_mmiotrace.c atomic: use <linux/atomic.h> 2011-07-26 16:49:47 -07:00
trace_nop.c tracing/ftrace: make nop-tracer use polling wait for events on pipe 2009-03-23 09:22:15 +01:00
trace_output.c tracing: Have dynamic size event stack traces 2011-07-14 16:36:53 -04:00
trace_output.h tracing: Allow events to share their print functions 2010-05-14 14:20:32 -04:00
trace_printk.c tracing: Clean up tb_fmt to not give faulty compile warning 2011-08-10 20:36:32 -04:00
trace_sched_switch.c tracing: Remove obsolete sched_switch tracer 2011-02-08 17:14:56 -05:00
trace_sched_wakeup.c tracing, function_graph: Remove dependency of abstime and duration fields on latency 2011-06-14 22:48:47 -04:00
trace_selftest.c ftrace: Add self-tests for multiple function trace users 2011-05-18 19:24:51 -04:00
trace_selftest_dynamic.c ftrace: Add self-tests for multiple function trace users 2011-05-18 19:24:51 -04:00
trace_stack.c tracing: Convert to kstrtoul_from_user 2011-06-14 22:48:50 -04:00
trace_stat.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
trace_stat.h tracing/stat: Add stat_release() callback 2009-07-10 12:14:05 +02:00
trace_syscalls.c tracing/syscalls: Early terminate search for sys_ni_syscall 2011-02-07 21:30:14 -05:00
trace_workqueue.c jump label: Initialize workqueue tracepoints *before* they are registered 2010-09-22 16:30:03 -04:00