From patchwork Sun Nov 24 23:49:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 13884289 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2DBF21607A4; Sun, 24 Nov 2024 23:49:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732492173; cv=none; b=TP7GonF3cLvSDGk0n+Hg6Bb0j3GvTQ3kWc7wWpdgYHntMWNjvOpVCuKVyqvS3Eh2w7vA66wOMYfLv5XQrbxwXxYRiA8qbfUKi8z8cDc3CmyypqQS5Oy737hTpGgyKmJ3SbkZ474PhFmMxrhW81brL5+7kaEANQJDFR9A/+cY6dM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732492173; c=relaxed/simple; bh=yCUNkk6yShU8TZGlAY96O7m0lA5Zg/DBQJ7E8YVPT4w=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=kObRDymY3cxIfjPz4RSQ/f1nSpajimhmP0aiHcjM6ICu1uY7nPO9Dpb39A2W6YYEZM6byA5gv2SXTwIqbWUqaU6QFpqUHGRChh918pxUrsxMSpsLc+FzM74qh/ZJ1KvNmL+jKcIBlBjt9Kdd2YzVjFxvnND247xaH4JVLg8uweQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0BB8CC4CED3; Sun, 24 Nov 2024 23:49:33 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.98) (envelope-from ) id 1tFMMt-00000006vke-140A; Sun, 24 Nov 2024 18:50:19 -0500 Message-ID: <20241124235019.106333158@goodmis.org> User-Agent: quilt/0.68 Date: Sun, 24 Nov 2024 18:49:44 -0500 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Andrew Morton , Linus Torvalds , Thomas Gleixner , Michael Jeanson , Peter Zijlstra , Alexei Starovoitov , Yonghong Song , "Paul E. McKenney" , Ingo Molnar , Arnaldo Carvalho de Melo , Alexander Shishkin , Namhyung Kim , Andrii Nakryiko , bpf@vger.kernel.org, Joel Fernandes , Jordan Rife , linux-trace-kernel@vger.kernel.org Subject: [for-next][PATCH 4/6] rcupdate_trace: Define rcu_tasks_trace lock guard References: <20241124234940.017394686@goodmis.org> Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Mathieu Desnoyers Define a rcu_tasks_trace lock guard for use by the syscall enter/exit tracepoints. Cc: Linus Torvalds Cc: Thomas Gleixner Cc: Michael Jeanson Cc: Masami Hiramatsu Cc: Peter Zijlstra Cc: Alexei Starovoitov Cc: Yonghong Song Cc: Paul E. McKenney Cc: Ingo Molnar Cc: Arnaldo Carvalho de Melo Cc: Mark Rutland Cc: Alexander Shishkin Cc: Namhyung Kim Cc: Andrii Nakryiko Cc: bpf@vger.kernel.org Cc: Joel Fernandes Cc: Jordan Rife Cc: linux-trace-kernel@vger.kernel.org Link: https://lore.kernel.org/20241123153031.2884933-4-mathieu.desnoyers@efficios.com Signed-off-by: Mathieu Desnoyers Signed-off-by: Steven Rostedt (Google) Reviewed-by: Paul E. McKenney --- include/linux/rcupdate_trace.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/linux/rcupdate_trace.h b/include/linux/rcupdate_trace.h index eda493200663..e6c44eb428ab 100644 --- a/include/linux/rcupdate_trace.h +++ b/include/linux/rcupdate_trace.h @@ -10,6 +10,7 @@ #include #include +#include extern struct lockdep_map rcu_trace_lock_map; @@ -98,4 +99,8 @@ static inline void rcu_read_lock_trace(void) { BUG(); } static inline void rcu_read_unlock_trace(void) { BUG(); } #endif /* #ifdef CONFIG_TASKS_TRACE_RCU */ +DEFINE_LOCK_GUARD_0(rcu_tasks_trace, + rcu_read_lock_trace(), + rcu_read_unlock_trace()) + #endif /* __LINUX_RCUPDATE_TRACE_H */