ring-buffer: discard timestamps that are at the start of the buffer
authorSteven Rostedt <srostedt@redhat.com>
Wed, 3 Jun 2009 13:30:10 +0000 (09:30 -0400)
committerSteven Rostedt <rostedt@goodmis.org>
Wed, 3 Jun 2009 14:15:25 +0000 (10:15 -0400)
commitea05b57cc19234d8de9887c8a32c2e58e84b56ba
tree6153db3dab161d495207114359b8c09944567f0c
parentedd813bffc62a980bb4fb9b1243f31c1cce78da3
ring-buffer: discard timestamps that are at the start of the buffer

Every buffer page in the ring buffer includes its own time stamp.
When an event is recorded to the ring buffer with a delta time greater
than what can be held in the event header, a time stamp event is created.

If the the create timestamp falls over to the next buffer page, it is
redundant because the buffer page holds a full time stamp. This patch
will try to discard the time stamp when it falls to the start of the
next page.

This change also fixes a issues with disarding events. If most events are
discarded, timestamps will start to creep into the ring buffer. If we
do not discard the timestamps then they can fill up the ring buffer over
time and waste space.

This change will keep time stamps from filling up over another page. If
something is recorded in the buffer page, and the rest is filtered, then
the time stamps can only fill up to the end of the page.

[ Impact: prevent time stamps from filling ring buffer ]

Reported-by: Tim Bird <tim.bird@am.sony.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
kernel/trace/ring_buffer.c