aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace
diff options
context:
space:
mode:
authorFrederic Weisbecker <fweisbec@gmail.com>2009-03-22 19:18:39 -0400
committerIngo Molnar <mingo@elte.hu>2009-03-23 04:22:15 -0400
commitb118415bfad6d75792a85ac999e25149db8e6919 (patch)
tree21d3a6caf595bdf090fc9432d13003aef977fc1c /kernel/trace
parent7e6ea92df3fd7cbe74e7985c6f3e40255c44b201 (diff)
tracing/events: don't discard an event after commit
When we want to filter an event, the filter test is done after the event is commited to the ring-buffer to be discarded later if needed. But a reader could be reading this event while we are trying to discard it. Other kind of racy events can even happen because the event is commited and can be read and/or consumed. What we want is to discard the event before committing it. Reported-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com> Cc: Tom Zanussi <tzanussi@gmail.com> LKML-Reference: <1237763919-21505-1-git-send-email-fweisbec@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/trace')
-rw-r--r--kernel/trace/trace_events_stage_3.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/kernel/trace/trace_events_stage_3.h b/kernel/trace/trace_events_stage_3.h
index 9a3bd49b52e5..9d2fa78cecca 100644
--- a/kernel/trace/trace_events_stage_3.h
+++ b/kernel/trace/trace_events_stage_3.h
@@ -222,10 +222,11 @@ static void ftrace_raw_event_##call(proto) \
222 \ 222 \
223 assign; \ 223 assign; \
224 \ 224 \
225 trace_nowake_buffer_unlock_commit(event, irq_flags, pc); \
226 \
227 if (call->preds && !filter_match_preds(call, entry)) \ 225 if (call->preds && !filter_match_preds(call, entry)) \
228 ring_buffer_event_discard(event); \ 226 ring_buffer_event_discard(event); \
227 \
228 trace_nowake_buffer_unlock_commit(event, irq_flags, pc); \
229 \
229} \ 230} \
230 \ 231 \
231static int ftrace_raw_reg_event_##call(void) \ 232static int ftrace_raw_reg_event_##call(void) \