Files
linux/include/linux
Steven Rostedt 1e67bb60bb tracing: Add a no-rcu-check version of trace_##event##_enabled()
Tracepoints require that RCU is watching. To prevent them from being used
in places that RCU is not watching, the trace_##event() macro always
calls rcu_is_watching() even when the event is not enabled and warns if
RCU is not watching. This is to make sure a warning is triggered even if
the tracepoint is never enabled (as it is only a bug when it is).

It was noticed that tracepoints could be hidden within
trace_#event#_enabled() calls, which are used to do extra work for the
tracepoint only if the tracepoint is enabled. But this also can hide the
fact that a tracepoint is placed in a location that can be called when RCU
is not watching.

Commit 9764e731ef ("tracepoint: Add lockdep rcu_is_watching() check to
trace_##name##_enabled()") added a check to the trace_##event##_enabled()
macro to make sure RCU is watching when it is called to make sure not to
hide the bug of a tracepoint being called when RCU is not watching.

There is one case in the irq_disable tracepoint where it is within a
trace_irq_disable_enabled() block, but it checks if RCU is watching, and
if it isn't, it makes a call to ct_irq_enter() that makes RCU watch again.
But because trace_irq_disable_enabled() now checks if RCU is watching and
will trigger if it isn't. This is a false warning as the code within
the block handles this case.

Add a new internal macro __trace_##event##_enabled() that doesn't check if
RCU is watching, and convert the irq_enable/disable tracepoints over to
it.

Link: https://patch.msgid.link/20260701132744.6a7fc68b@robin
Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Closes: https://lore.kernel.org/all/CAMuHMdXud_RpWag_hFqa2ByBGRxg6KnxGL1ObCWZrpTsk3TfAw@mail.gmail.com/
Fixes: 9764e731ef ("tracepoint: Add lockdep rcu_is_watching() check to trace_##name##_enabled()")
Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2026-07-07 10:42:29 -04:00
..
2026-02-11 13:44:47 +01:00
2026-04-02 15:52:49 +02:00
2026-03-18 15:11:40 +05:30
2026-05-21 13:04:42 +02:00
2026-03-19 23:55:27 +01:00
2026-06-17 11:32:14 +01:00
2026-05-28 21:24:54 -07:00
2026-06-16 08:53:53 -07:00
2026-04-03 16:53:50 -04:00
2026-06-07 10:03:01 -07:00
2026-03-02 17:08:05 -05:00
2026-05-28 17:45:46 -07:00
2026-06-05 00:34:55 -04:00
2026-05-18 11:16:29 +02:00
2026-05-19 17:26:07 +02:00
2026-05-28 11:36:59 -04:00
2026-04-07 17:38:07 +02:00
2026-02-27 16:40:16 +01:00
2026-06-05 17:46:17 -07:00
2026-05-28 21:24:43 -07:00
2026-02-06 07:29:14 -07:00
2026-07-01 15:26:47 +02:00
2026-06-10 10:42:55 -04:00
2026-04-05 13:53:28 -07:00
2026-04-01 10:19:41 +02:00
2026-04-03 16:53:50 -04:00
2026-04-03 16:53:50 -04:00
2026-03-18 09:59:57 +00:00
2026-04-05 13:53:00 -07:00
2026-01-26 20:02:27 -08:00
2026-03-08 11:06:53 +01:00
2026-06-26 22:18:34 -04:00
2026-03-27 07:35:05 -07:00
2026-01-30 11:34:34 +00:00
2026-04-05 13:53:10 -07:00
2026-02-10 11:39:31 +01:00
2026-04-20 11:35:17 -07:00
2026-05-26 11:02:01 +02:00
2026-02-27 16:40:16 +01:00
2026-03-08 11:06:53 +01:00
2026-03-31 07:04:00 -06:00
2026-03-25 20:11:29 +01:00
2026-03-13 08:22:54 +01:00
2026-05-11 16:59:43 +02:00
2026-03-12 15:05:34 +01:00
2026-03-30 16:43:24 -06:00
2026-01-30 18:26:59 -08:00
2026-06-06 15:22:44 +02:00