Messages in this thread | | | Date | Tue, 27 Sep 2022 19:15:23 -0400 | From | Steven Rostedt <> | Subject | [PATCH 0/5] tracing: Handle ring buffer waiters |
| |
While working on libtracefs functions that allow for reading the raw trace files, I found that my test programs would get stuck waiting on the buffer when they should stop. Signals work fine, but closing the file would not break them out of the wait.
I found this confusing and the reading functions would lose a lot of data. This fixes the wake up issue, which should have always been the case. I also added an ioctl() to the trace_pipe_raw that will wake up all waiters on any ioctl.
Steven Rostedt (Google) (5): ring-buffer: Have the shortest_full queue be the shortest not longest ring-buffer: Check pending waiters when doing wake ups as well ring-buffer: Add ring_buffer_wake_waiters() tracing: Wake up ring buffer waiters on closing of the file tracing: Add ioctl() to force ring buffer waiters to wake up
---- include/linux/ring_buffer.h | 2 +- include/linux/trace_events.h | 1 + kernel/trace/ring_buffer.c | 39 +++++++++++++++++++++++++++++++++++++-- kernel/trace/trace.c | 33 +++++++++++++++++++++++++++++++++ 4 files changed, 72 insertions(+), 3 deletions(-)
| |