Re: [PATCH] tracing: Add mutex to trace_parser to fix concurrent write races

From: Steven Rostedt

Date: Tue Jul 14 2026 - 07:26:34 EST


On Tue, 14 Jul 2026 18:16:26 +0800
Tengda Wu <wutengda@xxxxxxxxxxxxxxx> wrote:

> _Approach 3_: As you suggested earlier, build on v1 but add proper lockdep
> assertions to enforce that the parser lock is held by all callers,
> regardless of how the parser is used.
>
> Approach 3 seems cleaner and more straightforward.

I thought about having a global lock as writes to tracefs are very much a
slow path, but I think Approach 3 is probably the most "correct" fix.

Yeah, let's go with that.

Thanks,

-- Steve