Hi, Here is the v10 of the series to improve backup instances of the persistent ring buffer. The previous version is here:
https://lore.kernel.org/all/177497473558.569199.6527680985537865638.st...@mhiramat.tok.corp.google.com/ In this version, I fixed to use trace_array_destroy() and cancel_work_sync() to avoid possible race. And remove unneeded work_pending() check in trace_array_kick_autoremove() (for trace_array_cancel_autoremove() to avoid deadlock of workqueue, it still use work_pending() check) [2/3] and add a newline at EOF [3/3] Series Description ------------------ Since backup instances are a kind of snapshot of the persistent ring buffer, it should be readonly. And if it is readonly there is no reason to keep it after reading all data via trace_pipe because the data has been consumed. But user should be able to remove the readonly instance by rmdir or truncating `trace` file. Thus, [1/3] makes backup instances readonly (not able to write any events, cleanup trace, change buffer size). Also, [2/3] removes the backup instance after consuming all data via trace_pipe. With this improvements, even if we makes a backup instance (using the same amount of memory of the persistent ring buffer), it will be removed after reading the data automatically. Thanks, --- Masami Hiramatsu (Google) (3): tracing: Make the backup instance non-reusable tracing: Remove the backup instance automatically after read tracing/Documentation: Add a section about backup instance Documentation/trace/debugging.rst | 19 ++++ kernel/trace/trace.c | 160 ++++++++++++++++++++++++++++--------- kernel/trace/trace.h | 13 +++ kernel/trace/trace_boot.c | 5 + kernel/trace/trace_events.c | 76 ++++++++++-------- 5 files changed, 202 insertions(+), 71 deletions(-) -- Masami Hiramatsu (Google) <[email protected]>
