Re: [PATCH] tracepoints: Use new static branch API

From
Josh Poimboeuf <jpoimboe@kernel.org>
Date
2024-10-07 18:25:23
Also in
lkml
Reply to
Josh Poimboeuf, 2024-10-01
On Tue, Oct 01, 2024 at 03:24:01PM -0700, Josh Poimboeuf wrote:
The old static key API based on 'struct static_key' is deprecated.
Convert tracepoints to use the new API.

Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
Steven,

The kernel test robot found this patch breaks the build with
CONFIG_HIST_TRIGGERS:

  https://lore.kernel.org/202410040333.vJSL1NXx-lkp@intel.com (local)

Here's the fix, do you want to squash it in or should I post a v2?
diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c
index 5f9119eb7c67..cc2924ad32a3 100644
--- a/kernel/trace/trace_events_hist.c
+++ b/kernel/trace/trace_events_hist.c
@@ -822,7 +822,7 @@ static inline void trace_synth(struct synth_event *event, u64 *var_ref_vals,
 {
 	struct tracepoint *tp = event->tp;
 
-	if (unlikely(atomic_read(&tp->key.enabled) > 0)) {
+	if (unlikely(static_key_enabled(&tp->key))) {
 		struct tracepoint_func *probe_func_ptr;
 		synth_probe_func_t probe_func;
 		void *__data;
Thread (3 messages) 3 messages, 2 authors, last reply 2024-10-07
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help