• Steven Rostedt's avatar
    ring-buffer: add ring_buffer_discard_commit · fa1b47dd
    Steven Rostedt authored
    The ring_buffer_discard_commit is similar to ring_buffer_event_discard
    but it can only be done on an event that has yet to be commited.
    Unpredictable results can happen otherwise.
    
    The main difference between ring_buffer_discard_commit and
    ring_buffer_event_discard is that ring_buffer_discard_commit will try
    to free the data in the ring buffer if nothing has addded data
    after the reserved event. If something did, then it acts almost the
    same as ring_buffer_event_discard followed by a
    ring_buffer_unlock_commit.
    
    Note, either ring_buffer_commit_discard and ring_buffer_unlock_commit
    can be called on an event, not both.
    
    This commit also exports both discard functions to be usable by
    GPL modules.
    Signed-off-by: default avatarSteven Rostedt <srostedt@redhat.com>
    Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
    fa1b47dd
ring_buffer.c 73 KB