Re: [PATCH RFC 3/3] locking: Wire up contended_release tracepoint

From: Steven Rostedt

Date: Thu Mar 05 2026 - 13:05:37 EST


On Thu, 5 Mar 2026 18:42:23 +0100
Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:

> I still wish you would accept:
>
> if (trace_foo_enabled() && foo)
> __do_trace_foo();
>
> The compilers can't optimize the static branches and thus you'll get it
> twice for no reason.
>
> I really wish they would just accept __pure, but alas.

Makes sense, and that could probably be done. It shouldn't be too hard to
do. If I find some time I could look at it, or perhaps someone lurking on
this thread could possibly give it a try! (I may even Cc some people that
want to learn this code).

-- Steve