From: Wander Lairson Costa <wander@redhat.com>
To: Ingo Molnar <mingo@redhat.com>,
Peter Zijlstra <peterz@infradead.org>,
Juri Lelli <juri.lelli@redhat.com>,
Vincent Guittot <vincent.guittot@linaro.org>,
Dietmar Eggemann <dietmar.eggemann@arm.com>,
Steven Rostedt <rostedt@goodmis.org>,
Ben Segall <bsegall@google.com>, Mel Gorman <mgorman@suse.de>,
Valentin Schneider <vschneid@redhat.com>,
Masami Hiramatsu <mhiramat@kernel.org>,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
Andrew Morton <akpm@linux-foundation.org>,
linux-kernel@vger.kernel.org (open list:SCHEDULER),
linux-trace-kernel@vger.kernel.org (open list:TRACING)
Cc: acme@kernel.org, williams@redhat.com, gmonaco@redhat.com,
Wander Lairson Costa <wander@redhat.com>
Subject: [PATCH v3 3/4] trace/preemptirq: add TRACE_IRQFLAGS_TOGGLE
Date: Wed, 11 Mar 2026 09:50:17 -0300 [thread overview]
Message-ID: <20260311125021.197638-4-wander@redhat.com> (raw)
In-Reply-To: <20260311125021.197638-1-wander@redhat.com>
The IRQ disable/enable tracepoints are currently gated behind
TRACE_IRQFLAGS, a hidden config that cannot be selected directly by
users. It is only enabled when selected by PROVE_LOCKING or
IRQSOFF_TRACER, both of which carry overhead beyond what is needed
for just the tracepoints.
Introduce TRACE_IRQFLAGS_TOGGLE, a user-selectable config that enables
the irq_disable and irq_enable tracepoints independently. It is
mutually exclusive with TRACE_IRQFLAGS and mirrors how
TRACE_PREEMPT_TOGGLE works for preemption tracepoints.
Make this option depend on CONFIG_JUMP_LABEL to avoid a circular header
dependency. Without TRACE_IRQFLAGS, irqflags.h must check the static
key before invoking the tracepoint. Using tracepoint_enabled() for this
check pulls in tracepoint_defs.h, which eventually includes atomic.h
and cmpxchg.h, circling back to irqflags.h. Enforcing CONFIG_JUMP_LABEL
allows the use of static_key_false() directly, avoiding the inclusion
of the full tracepoint header chain and preventing the cycle.
Signed-off-by: Wander Lairson Costa <wander@redhat.com>
---
kernel/trace/Kconfig | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/kernel/trace/Kconfig b/kernel/trace/Kconfig
index e007459ecf361..8bea77b5f1200 100644
--- a/kernel/trace/Kconfig
+++ b/kernel/trace/Kconfig
@@ -162,7 +162,7 @@ config RING_BUFFER_ALLOW_SWAP
config PREEMPTIRQ_TRACEPOINTS
bool
- depends on TRACE_PREEMPT_TOGGLE || TRACE_IRQFLAGS
+ depends on TRACE_PREEMPT_TOGGLE || TRACE_IRQFLAGS || TRACE_IRQFLAGS_TOGGLE
select TRACING
default y
help
@@ -418,6 +418,17 @@ config TRACE_PREEMPT_TOGGLE
Enables hooks into preemption disable and enable paths for
tracing or latency measurement.
+config TRACE_IRQFLAGS_TOGGLE
+ bool "IRQ disable/enable tracing hooks"
+ default n
+ depends on TRACE_IRQFLAGS_SUPPORT && JUMP_LABEL && !TRACE_IRQFLAGS
+ help
+ Enables hooks into IRQ disable and enable paths for tracing.
+
+ This provides the irq_disable and irq_enable tracepoints
+ without pulling in the full TRACE_IRQFLAGS infrastructure
+ used by lockdep and the irqsoff latency tracer.
+
config IRQSOFF_TRACER
bool "Interrupts-off Latency Tracer"
default n
--
2.53.0
next prev parent reply other threads:[~2026-03-11 13:02 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-11 12:50 [PATCH v3 0/4] tracing/preemptirq: Optimize disabled tracepoint overhead Wander Lairson Costa
2026-03-11 12:50 ` [PATCH v3 1/4] tracing/preemptirq: Optimize preempt_disable/enable() " Wander Lairson Costa
2026-03-11 19:35 ` Peter Zijlstra
2026-03-12 17:19 ` Wander Lairson Costa
2026-03-13 9:04 ` Peter Zijlstra
2026-03-13 15:36 ` Wander Lairson Costa
2026-03-11 12:50 ` [PATCH v3 2/4] trace/preemptirq: make TRACE_PREEMPT_TOGGLE user-selectable Wander Lairson Costa
2026-03-11 12:50 ` Wander Lairson Costa [this message]
2026-03-11 12:50 ` [PATCH v3 4/4] trace/preemptirq: Implement trace_irqflags hooks Wander Lairson Costa
2026-03-11 19:43 ` Peter Zijlstra
2026-03-11 19:48 ` Steven Rostedt
2026-03-11 19:53 ` Peter Zijlstra
2026-03-11 20:07 ` Steven Rostedt
2026-03-11 20:46 ` Peter Zijlstra
2026-03-11 23:16 ` Steven Rostedt
2026-03-12 17:09 ` Wander Lairson Costa
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=20260311125021.197638-4-wander@redhat.com \
--to=wander@redhat.com \
--cc=acme@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=bsegall@google.com \
--cc=dietmar.eggemann@arm.com \
--cc=gmonaco@redhat.com \
--cc=juri.lelli@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=mgorman@suse.de \
--cc=mhiramat@kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=vincent.guittot@linaro.org \
--cc=vschneid@redhat.com \
--cc=williams@redhat.com \
/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