Skip to content

Commit

Permalink
ring-buffer: fix check of try_to_discard result
Browse files Browse the repository at this point in the history
The function ring_buffer_discard_commit inversed the code path
of the result of try_to_discard. It should skip incrementing the
entry counter if try_to_discard succeeded. But instead, it increments
the entry conder if it succeeded to discard, and does not increment
it if it fails.

The result of this bug is that filtering will make the stat counters
incorrect.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
  • Loading branch information
Steven Rostedt authored and Steven Rostedt committed Aug 6, 2009
1 parent e16852c commit 0f2541d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/trace/ring_buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -1785,7 +1785,7 @@ void ring_buffer_discard_commit(struct ring_buffer *buffer,
*/
RB_WARN_ON(buffer, !local_read(&cpu_buffer->committing));

if (!rb_try_to_discard(cpu_buffer, event))
if (rb_try_to_discard(cpu_buffer, event))
goto out;

/*
Expand Down

0 comments on commit 0f2541d

Please sign in to comment.