* [PATCH] rv: sts, nrp: Fix UP build with CONFIG_X86_LOCAL_APIC
@ 2026-11-28 20:01 Karl Mehltretter
0 siblings, 0 replies; only message in thread
From: Karl Mehltretter @ 2026-11-28 20:01 UTC (permalink / raw)
To: Steven Rostedt, Gabriele Monaco
Cc: Karl Mehltretter, Masami Hiramatsu, Mathieu Desnoyers, Nam Cao,
linux-trace-kernel, linux-kernel
Building sts.c or nrp.c on x86 with CONFIG_SMP=n and
CONFIG_X86_LOCAL_APIC=y fails:
include/rv/instrumentation.h:18:17: error: implicit declaration of function 'check_trace_callback_type_reschedule_entry'
include/rv/instrumentation.h:19:27: error: implicit declaration of function 'register_trace_reschedule_entry'
arch/x86/include/asm/trace/irq_vectors.h only declares reschedule_entry,
call_function_entry, and call_function_single_entry when CONFIG_SMP is
enabled (and irq_work_entry when CONFIG_IRQ_WORK is enabled), so
if (IS_ENABLED(...)) still references undeclared helpers when disabled.
Guard these probes with preprocessor conditionals in attach_vector_irq()
and detach_vector_irq() to match the header.
Fixes: d0096c2f9cfc ("rv: Replace tss and sncid monitors with more complete sts")
Fixes: e8440a88e56b ("rv: Add nrp and sssw per-task monitors")
Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com>
---
kernel/trace/rv/monitors/nrp/nrp.c | 30 ++++++++++++++++--------------
kernel/trace/rv/monitors/sts/sts.c | 30 ++++++++++++++++--------------
2 files changed, 32 insertions(+), 28 deletions(-)
diff --git a/kernel/trace/rv/monitors/nrp/nrp.c b/kernel/trace/rv/monitors/nrp/nrp.c
index 4b5646a..48a268b 100644
--- a/kernel/trace/rv/monitors/nrp/nrp.c
+++ b/kernel/trace/rv/monitors/nrp/nrp.c
@@ -29,25 +29,27 @@ static void handle_vector_irq_entry(void *data, int vector)
static void attach_vector_irq(void)
{
rv_attach_trace_probe("nrp", local_timer_entry, handle_vector_irq_entry);
- if (IS_ENABLED(CONFIG_IRQ_WORK))
- rv_attach_trace_probe("nrp", irq_work_entry, handle_vector_irq_entry);
- if (IS_ENABLED(CONFIG_SMP)) {
- rv_attach_trace_probe("nrp", reschedule_entry, handle_vector_irq_entry);
- rv_attach_trace_probe("nrp", call_function_entry, handle_vector_irq_entry);
- rv_attach_trace_probe("nrp", call_function_single_entry, handle_vector_irq_entry);
- }
+#ifdef CONFIG_IRQ_WORK
+ rv_attach_trace_probe("nrp", irq_work_entry, handle_vector_irq_entry);
+#endif
+#ifdef CONFIG_SMP
+ rv_attach_trace_probe("nrp", reschedule_entry, handle_vector_irq_entry);
+ rv_attach_trace_probe("nrp", call_function_entry, handle_vector_irq_entry);
+ rv_attach_trace_probe("nrp", call_function_single_entry, handle_vector_irq_entry);
+#endif
}
static void detach_vector_irq(void)
{
rv_detach_trace_probe("nrp", local_timer_entry, handle_vector_irq_entry);
- if (IS_ENABLED(CONFIG_IRQ_WORK))
- rv_detach_trace_probe("nrp", irq_work_entry, handle_vector_irq_entry);
- if (IS_ENABLED(CONFIG_SMP)) {
- rv_detach_trace_probe("nrp", reschedule_entry, handle_vector_irq_entry);
- rv_detach_trace_probe("nrp", call_function_entry, handle_vector_irq_entry);
- rv_detach_trace_probe("nrp", call_function_single_entry, handle_vector_irq_entry);
- }
+#ifdef CONFIG_IRQ_WORK
+ rv_detach_trace_probe("nrp", irq_work_entry, handle_vector_irq_entry);
+#endif
+#ifdef CONFIG_SMP
+ rv_detach_trace_probe("nrp", reschedule_entry, handle_vector_irq_entry);
+ rv_detach_trace_probe("nrp", call_function_entry, handle_vector_irq_entry);
+ rv_detach_trace_probe("nrp", call_function_single_entry, handle_vector_irq_entry);
+#endif
}
#else
diff --git a/kernel/trace/rv/monitors/sts/sts.c b/kernel/trace/rv/monitors/sts/sts.c
index 2a044cf..b5ff582 100644
--- a/kernel/trace/rv/monitors/sts/sts.c
+++ b/kernel/trace/rv/monitors/sts/sts.c
@@ -30,25 +30,27 @@ static void handle_vector_irq_entry(void *data, int vector)
static void attach_vector_irq(void)
{
rv_attach_trace_probe("sts", local_timer_entry, handle_vector_irq_entry);
- if (IS_ENABLED(CONFIG_IRQ_WORK))
- rv_attach_trace_probe("sts", irq_work_entry, handle_vector_irq_entry);
- if (IS_ENABLED(CONFIG_SMP)) {
- rv_attach_trace_probe("sts", reschedule_entry, handle_vector_irq_entry);
- rv_attach_trace_probe("sts", call_function_entry, handle_vector_irq_entry);
- rv_attach_trace_probe("sts", call_function_single_entry, handle_vector_irq_entry);
- }
+#ifdef CONFIG_IRQ_WORK
+ rv_attach_trace_probe("sts", irq_work_entry, handle_vector_irq_entry);
+#endif
+#ifdef CONFIG_SMP
+ rv_attach_trace_probe("sts", reschedule_entry, handle_vector_irq_entry);
+ rv_attach_trace_probe("sts", call_function_entry, handle_vector_irq_entry);
+ rv_attach_trace_probe("sts", call_function_single_entry, handle_vector_irq_entry);
+#endif
}
static void detach_vector_irq(void)
{
rv_detach_trace_probe("sts", local_timer_entry, handle_vector_irq_entry);
- if (IS_ENABLED(CONFIG_IRQ_WORK))
- rv_detach_trace_probe("sts", irq_work_entry, handle_vector_irq_entry);
- if (IS_ENABLED(CONFIG_SMP)) {
- rv_detach_trace_probe("sts", reschedule_entry, handle_vector_irq_entry);
- rv_detach_trace_probe("sts", call_function_entry, handle_vector_irq_entry);
- rv_detach_trace_probe("sts", call_function_single_entry, handle_vector_irq_entry);
- }
+#ifdef CONFIG_IRQ_WORK
+ rv_detach_trace_probe("sts", irq_work_entry, handle_vector_irq_entry);
+#endif
+#ifdef CONFIG_SMP
+ rv_detach_trace_probe("sts", reschedule_entry, handle_vector_irq_entry);
+ rv_detach_trace_probe("sts", call_function_entry, handle_vector_irq_entry);
+ rv_detach_trace_probe("sts", call_function_single_entry, handle_vector_irq_entry);
+#endif
}
#else
--
2.39.5 (Apple Git-154)
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-11-28 20:02 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-28 20:01 [PATCH] rv: sts, nrp: Fix UP build with CONFIG_X86_LOCAL_APIC Karl Mehltretter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox