• Steven Rostedt (VMware)'s avatar
    ring-buffer: Always check to put back before stamp when crossing pages · 68e10d5f
    Steven Rostedt (VMware) authored
    The current ring buffer logic checks to see if the updating of the event
    buffer was interrupted, and if it is, it will try to fix up the before stamp
    with the write stamp to make them equal again. This logic is flawed, because
    if it is not interrupted, the two are guaranteed to be different, as the
    current event just updated the before stamp before allocation. This
    guarantees that the next event (this one or another interrupting one) will
    think it interrupted the time updates of a previous event and inject an
    absolute time stamp to compensate.
    
    The correct logic is to always update the timestamps when traversing to a
    new sub buffer.
    
    Cc: stable@vger.kernel.org
    Fixes: a389d86f ("ring-buffer: Have nested events still record running time stamp")
    Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
    68e10d5f
ring_buffer.c 153 KB