• Steven Rostedt's avatar
    ring-buffer: do not count discarded events · a1863c21
    Steven Rostedt authored
    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: default avatarSteven Rostedt <rostedt@goodmis.org>
    a1863c21
ring_buffer.c 95.4 KB