]> git.baikalelectronics.ru Git - kernel.git/commit
ring-buffer: do not count discarded events
authorSteven Rostedt <srostedt@redhat.com>
Thu, 3 Sep 2009 14:23:58 +0000 (10:23 -0400)
committerSteven Rostedt <rostedt@goodmis.org>
Fri, 4 Sep 2009 15:43:36 +0000 (11:43 -0400)
commit9f45533a24041d4390c61f2c4074b0c67ba83430
tree20ad746370b0d03950f23a349ebb07c913f99fd2
parenta2968e595ff9d007332758ab5c69ea1d4f4e272c
ring-buffer: do not count discarded events

The latency tracers report the number of items in the trace buffer.
This uses the ring buffer data to calculate this. Because discarded
events are also counted, the numbers do not match the number of items
that are printed. The ring buffer also adds a "padding" item to the
end of each buffer page which also gets counted as a discarded item.

This patch decrements the counter to the page entries on a discard.
This allows us to ignore discarded entries while reading the buffer.

Decrementing the counter is still safe since it can only happen while
the committing flag is still set.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
kernel/trace/ring_buffer.c