In order to have the iterator read the buffer even when it's still updating, it requires that the ring buffer iterator saves each event in a separate location outside the ring buffer such that its use is immutable. There's one use case that saves off the event returned from the ring buffer interator and calls it again to look at the next event, before going back to use the first event. As the ring buffer iterator will only have a single copy, this use case will no longer be supported. Instead, have the one use case create its own buffer to store the first event when looking at the next event. This way, when looking at the first event again, it wont be corrupted by the second read. Link: http://lkml.kernel.org/r/20200317213415.722539921@goodmis.org
Showing the changes to include/linux (1 of 3 files). Show all
Unified · Split
| @@ -85,6 +85,8 @@ struct trace_iterator { · 84 unmodified lines | |||
| 85 | struct mutex mutex; | 85 | struct mutex mutex; |
| 86 | struct ring_buffer_iter **buffer_iter; | 86 | struct ring_buffer_iter **buffer_iter; |
| 87 | unsigned long iter_flags; | 87 | unsigned long iter_flags; |
| 88 | void *temp; /* temp holder */ | ||
| 89 | unsigned int temp_size; | ||
| 88 | 90 | ||
| 89 | /* trace_seq for __print_flags() and __print_symbolic() etc. */ | 91 | /* trace_seq for __print_flags() and __print_symbolic() etc. */ |
| 90 | struct trace_seq tmp_seq; | 92 | struct trace_seq tmp_seq; |