Re: [PATCH] tracepoints: Use new static branch API
From: Josh Poimboeuf
Date: Mon Oct 07 2024 - 14:25:34 EST
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@xxxxxxxxxx>
Steven,
The kernel test robot found this patch breaks the build with
CONFIG_HIST_TRIGGERS:
https://lore.kernel.org/202410040333.vJSL1NXx-lkp@xxxxxxxxx
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;