Linux Trace Kernel
 help / color / mirror / Atom feed
* [PATCH] tracing: Use test_bit() in event_enable_count_probe()
@ 2026-11-30  5:02 Jaewon Jung
  0 siblings, 0 replies; only message in thread
From: Jaewon Jung @ 2026-11-30  5:02 UTC (permalink / raw)
  To: Steven Rostedt, Masami Hiramatsu, Mathieu Desnoyers
  Cc: linux-kernel, linux-trace-kernel

The ftrace callback reads SOFT_DISABLED without event_mutex while
update_event_probe() updates it with set_bit()/clear_bit().  Use test_bit()
for the lockless read.

Fixes: 3cd715de2611 ("tracing: Add function probe triggers to enable/disable events")
Signed-off-by: Jaewon Jung <jaewon8868@gmail.com>
---
 kernel/trace/trace_events.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
index 394d7cde1a70..ab4950c497f2 100644
--- a/kernel/trace/trace_events.c
+++ b/kernel/trace/trace_events.c
@@ -4353,7 +4353,8 @@ event_enable_count_probe(unsigned long ip, unsigned long parent_ip,
 		return;
 
 	/* Skip if the event is in a state we want to switch to */
-	if (edata->enable == !(edata->file->flags & EVENT_FILE_FL_SOFT_DISABLED))
+	if (edata->enable == !test_bit(EVENT_FILE_FL_SOFT_DISABLED_BIT,
+				       &edata->file->flags))
 		return;
 
 	if (edata->count != -1)
-- 
2.43.0


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-30  5:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-30  5:02 [PATCH] tracing: Use test_bit() in event_enable_count_probe() Jaewon Jung

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox