[PATCH 0/9] tracing: Use trace_call__FOO() for tracepoints behind trace_FOO_enabled()

From: Steven Rostedt

Date: Tue Oct 27 2026 - 12:18:32 EST


This is a rebase of patches Vineeth Pillai created back in May[1].
This series fixes the "double static_branch" that Peter Zijlstra complained
about. When there's some extra work that needs to be done specifically
for a tracepoint, that work should be behind a trace_FOO_enabled() "if"
statement so that the work is only done when the tracepoint FOO is enabled.
The issue that Peter complained about is that both the trace_FOO_enabled()
and the trace_FOO() use a static branch which has the nop/jmp switch.
There's no reason to have the trace_FOO() use that if it is behind a
trace_FOO_enabled() as that test has already been checked.

Vineeth created a trace_call__FOO() which calls the tracepoint logic
directly without doing the static_branch. This is to only be used when
the tracepoint is called behind a trace_FOO_enabled() check. That code[2]
has been upstream since 7.1. Vineeth also sent out changes to update
all trace_FOO() callers behind a trace_FOO_enabled() to use the new
API. But not all maintainers took it nor gave an ack.

This is a rebase of that work for the maintainers that did not ack nor
take the patches. This is to give those maintainers another chance to do so.
Maintainers may either take the patches or ACK them and I'll take it.

[1] https://lore.kernel.org/linux-trace-kernel/20260515135903.2238731-1-vineeth@xxxxxxxxxxxxxxx/
[2] 677a3d82b6407 ("tracepoint: Add trace_call__##name() API")


Vineeth Pillai (9):
net: Use trace_call__##name() at guarded tracepoint call sites
accel/habanalabs: Use trace_call__##name() at guarded tracepoint call sites
devfreq: Use trace_call__##name() at guarded tracepoint call sites
dma-buf: Use trace_call__##name() at guarded tracepoint call sites
drm: Use trace_call__##name() at guarded tracepoint call sites
scsi: ufs: Use trace_call__##name() at guarded tracepoint call sites
net: devlink: Use trace_call__##name() at guarded tracepoint call sites
kernel: time, trace: Use trace_call__##name() at guarded tracepoint call sites
x86: msr: Use trace_call__##name() at guarded tracepoint call sites

----
arch/x86/lib/msr.c | 6 +++---
drivers/accel/habanalabs/common/device.c | 9 +++++----
drivers/accel/habanalabs/common/mmu/mmu.c | 3 ++-
drivers/accel/habanalabs/common/pci/pci.c | 6 ++++--
drivers/devfreq/devfreq.c | 2 +-
drivers/dma-buf/dma-fence.c | 2 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 2 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 4 ++--
drivers/gpu/drm/scheduler/sched_entity.c | 5 +++--
drivers/ufs/core/ufshcd.c | 31 ++++++++++++++++---------------
kernel/time/tick-sched.c | 12 ++++++------
kernel/trace/trace_benchmark.c | 2 +-
net/core/dev.c | 2 +-
net/core/xdp.c | 2 +-
net/devlink/trap.c | 2 +-
net/openvswitch/actions.c | 2 +-
net/openvswitch/datapath.c | 2 +-
net/sctp/outqueue.c | 2 +-
net/tipc/node.c | 2 +-
19 files changed, 52 insertions(+), 46 deletions(-)