Skip to contentSkip to conversation

x86: irq: define trace events conditionally

PATCH Applied Arnd Bergmann 2 participants 2 messages Feb 25, 2025 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86: irq: define trace events conditionally

From: Arnd Bergmann <[email protected]>

When both of X86_LOCAL_APIC and X86_THERMAL_VECTOR are disabled, the irq tracing produces a W=1 build warning for the tracing definitions:

In file included from include/trace/trace_events.h:27,

                 from include/trace/define_trace.h:113,
                 from arch/x86/include/asm/trace/irq_vectors.h:383,
                 from arch/x86/kernel/irq.c:29:

include/trace/stages/init.h:2:23: error: 'str__irq_vectors__trace_system_name' defined but not used [-Werror=unused-const-variable=]

Make the tracepoints conditional on the same symbosl that guard their usage.

---
 arch/x86/kernel/irq.c | 2 ++
 1 file changed, 2 insertions(+)
arch/x86/kernel/irq.c +2 -0
index 385e3a5fc304..feca4f20b06a 100644
@@ -25,8 +25,10 @@
 #include <asm/posted_intr.h>
 #include <asm/irq_remapping.h>
 
+#if defined(CONFIG_X86_LOCAL_APIC) || defined(CONFIG_X86_THERMAL_VECTOR)
 #define CREATE_TRACE_POINTS
 #include <asm/trace/irq_vectors.h>
+#endif
 
 DEFINE_PER_CPU_SHARED_ALIGNED(irq_cpustat_t, irq_stat);
 EXPORT_PER_CPU_SYMBOL(irq_stat);
Signature · 1 line
2.39.5
merge bot Applied
#1 lore raw

[tip: x86/urgent] x86/irq: Define trace events conditionally

The following commit has been merged into the x86/urgent branch of tip:

The following commit has been merged into the x86/urgent branch of tip:

Commit-ID:     9de7695925d5d2d2085681ba935857246eb2817d
Gitweb:        https://git.kernel.org/tip/9de7695925d5d2d2085681ba935857246eb2817d
Author:        Arnd Bergmann <[email protected]>
AuthorDate:    Tue, 25 Feb 2025 22:32:33 +01:00
Committer:     Ingo Molnar <[email protected]>
CommitterDate: Tue, 25 Feb 2025 22:44:35 +01:00

x86/irq: Define trace events conditionally

When both of X86_LOCAL_APIC and X86_THERMAL_VECTOR are disabled, the irq tracing produces a W=1 build warning for the tracing definitions:

In file included from include/trace/trace_events.h:27,

                 from include/trace/define_trace.h:113,
                 from arch/x86/include/asm/trace/irq_vectors.h:383,
                 from arch/x86/kernel/irq.c:29:

include/trace/stages/init.h:2:23: error: 'str__irq_vectors__trace_system_name' defined but not used [-Werror=unused-const-variable=]

Make the tracepoints conditional on the same symbosl that guard their usage.

---
 arch/x86/kernel/irq.c | 2 ++
 1 file changed, 2 insertions(+)
arch/x86/kernel/irq.c +2 -0
index 385e3a5..feca4f2 100644
@@ -25,8 +25,10 @@
 #include <asm/posted_intr.h>
 #include <asm/irq_remapping.h>
 
+#if defined(CONFIG_X86_LOCAL_APIC) || defined(CONFIG_X86_THERMAL_VECTOR)
 #define CREATE_TRACE_POINTS
 #include <asm/trace/irq_vectors.h>
+#endif
 
 DEFINE_PER_CPU_SHARED_ALIGNED(irq_cpustat_t, irq_stat);
 EXPORT_PER_CPU_SYMBOL(irq_stat);