From: Karl Mehltretter <kmehltretter@gmail.com>
To: Steven Rostedt <rostedt@goodmis.org>,
Gabriele Monaco <gmonaco@redhat.com>
Cc: Karl Mehltretter <kmehltretter@gmail.com>,
Masami Hiramatsu <mhiramat@kernel.org>,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
Nam Cao <namcao@linutronix.de>,
linux-trace-kernel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] rv: sts, nrp: Fix UP build with CONFIG_X86_LOCAL_APIC
Date: Sat, 28 Nov 2026 21:01:57 +0100 [thread overview]
Message-ID: <20261128200157.6496-1-kmehltretter@gmail.com> (raw)
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)
reply other threads:[~2026-11-28 20:02 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20261128200157.6496-1-kmehltretter@gmail.com \
--to=kmehltretter@gmail.com \
--cc=gmonaco@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=mhiramat@kernel.org \
--cc=namcao@linutronix.de \
--cc=rostedt@goodmis.org \
/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