The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@kernel.org>
To: linux-kernel@vger.kernel.org
Cc: Masami Hiramatsu <mhiramat@kernel.org>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Jaewon Jung <jaewon8868@gmail.com>
Subject: [for-next][PATCH 8/8] tracing: Use test_bit() in event_enable_count_probe()
Date: Wed, 02 Dec 2026 03:14:44 -0500	[thread overview]
Message-ID: <20261202081501.186313896@kernel.org> (raw)
In-Reply-To: 20261202081436.100375310@kernel.org

From: Jaewon Jung <jaewon8868@gmail.com>

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.

Link: https://patch.msgid.link/20261130050252.1182166-1-jaewon8868@gmail.com
Fixes: 3cd715de2611 ("tracing: Add function probe triggers to enable/disable events")
Signed-off-by: Jaewon Jung <jaewon8868@gmail.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 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 ebf712d7de35..4722d9a8b222 100644
--- a/kernel/trace/trace_events.c
+++ b/kernel/trace/trace_events.c
@@ -4448,7 +4448,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.53.0

      parent reply	other threads:[~2026-12-02  8:15 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-02  8:14 [for-next][PATCH 0/8] tracing: Updates for v7.5 Steven Rostedt
2026-12-02  8:14 ` [for-next][PATCH 1/8] tracing: Rename __dynamic_array() to __dynamic_field() for ftrace events Steven Rostedt
2026-12-02  8:14 ` [for-next][PATCH 2/8] tracing: Do not bother getting user space stacktraces for kernel threads Steven Rostedt
2026-12-02  8:14 ` [for-next][PATCH 3/8] tracing: Drop duplicated NO_CMDLINE_MAP check in saved_cmdlines_next() Steven Rostedt
2026-12-02  8:14 ` [for-next][PATCH 4/8] tracing: Add __print_sym() to replace __print_symbolic() Steven Rostedt
2026-12-02  8:14 ` [for-next][PATCH 5/8] net: dropreason: use new __print_sym() in tracing Steven Rostedt
2026-12-02  8:14 ` [for-next][PATCH 6/8] net: drop_monitor: use drop_reason_lookup() Steven Rostedt
2026-12-02  8:14 ` [for-next][PATCH 7/8] tracing: Dont use TRACE_BRANCH_BIT as a mask Steven Rostedt
2026-12-02  8:14 ` Steven Rostedt [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261202081501.186313896@kernel.org \
    --to=rostedt@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=jaewon8868@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mhiramat@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox