* PATCH] tracing: Fix unused tracepoints when module uses only exported ones
@ 2025-12-08 13:53 Steven Rostedt
2025-12-08 14:22 ` Mathieu Desnoyers
0 siblings, 1 reply; 3+ messages in thread
From: Steven Rostedt @ 2025-12-08 13:53 UTC (permalink / raw)
To: LKML, Linux trace kernel
Cc: Masami Hiramatsu, Mathieu Desnoyers, Masahiro Yamada
From: Steven Rostedt <rostedt@goodmis.org>
Building the KVM intel module failed to build with UT=1:
no __tracepoint_strings in file: arch/x86/kvm/kvm-intel.o
make[3]: *** [/work/git/test-linux.git/scripts/Makefile.modfinal:62: arch/x86/kvm/kvm-intel.ko] Error 1
The reason is that the module only uses the tracepoints defined and
exported by the main kvm module. The tracepoint-udpate.c code fails the
build if a tracepoint is used, but there's no tracepoints defined. But
this is acceptable in modules if the tracepoints is defined in the vmlinux
proper or another module and exported.
Do not fail to build if a tracepoint is used but no tracepoints are
defined if the code is a module. This should still never happen for the
vmlinux itself.
Fixes: e30f8e61e2518 ("tracing: Add a tracepoint verification check at build time")
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---
scripts/tracepoint-update.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/scripts/tracepoint-update.c b/scripts/tracepoint-update.c
index 7f7d90df14ce..90046aedc97b 100644
--- a/scripts/tracepoint-update.c
+++ b/scripts/tracepoint-update.c
@@ -210,6 +210,9 @@ static int process_tracepoints(bool mod, void *addr, const char *fname)
}
if (!tracepoint_data_sec) {
+ /* A module may reference only exported tracepoints */
+ if (mod)
+ return 0;
fprintf(stderr, "no __tracepoint_strings in file: %s\n", fname);
return -1;
}
--
2.51.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: PATCH] tracing: Fix unused tracepoints when module uses only exported ones
2025-12-08 13:53 PATCH] tracing: Fix unused tracepoints when module uses only exported ones Steven Rostedt
@ 2025-12-08 14:22 ` Mathieu Desnoyers
2025-12-10 1:25 ` Steven Rostedt
0 siblings, 1 reply; 3+ messages in thread
From: Mathieu Desnoyers @ 2025-12-08 14:22 UTC (permalink / raw)
To: Steven Rostedt, LKML, Linux trace kernel
Cc: Masami Hiramatsu, Masahiro Yamada
On 2025-12-08 08:53, Steven Rostedt wrote:
> From: Steven Rostedt <rostedt@goodmis.org>
Missing bracket for [PATCH] in subject.
>
> Building the KVM intel module failed to build with UT=1:
failed -> fails (present ?)
>
> no __tracepoint_strings in file: arch/x86/kvm/kvm-intel.o
> make[3]: *** [/work/git/test-linux.git/scripts/Makefile.modfinal:62: arch/x86/kvm/kvm-intel.ko] Error 1
>
> The reason is that the module only uses the tracepoints defined and
> exported by the main kvm module. The tracepoint-udpate.c code fails the
I guess you mean "tracepoint-update.c" ?
> build if a tracepoint is used, but there's no tracepoints defined. But
tracepoint
> this is acceptable in modules if the tracepoints is defined in the vmlinux
tracepoint
> proper or another module and exported.
>
> Do not fail to build if a tracepoint is used but no tracepoints are
tracepoint .. is
Thanks,
Mathieu
> defined if the code is a module. This should still never happen for the
> vmlinux itself.
>
> Fixes: e30f8e61e2518 ("tracing: Add a tracepoint verification check at build time")
> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
> ---
> scripts/tracepoint-update.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/scripts/tracepoint-update.c b/scripts/tracepoint-update.c
> index 7f7d90df14ce..90046aedc97b 100644
> --- a/scripts/tracepoint-update.c
> +++ b/scripts/tracepoint-update.c
> @@ -210,6 +210,9 @@ static int process_tracepoints(bool mod, void *addr, const char *fname)
> }
>
> if (!tracepoint_data_sec) {
> + /* A module may reference only exported tracepoints */
> + if (mod)
> + return 0;
> fprintf(stderr, "no __tracepoint_strings in file: %s\n", fname);
> return -1;
> }
--
Mathieu Desnoyers
EfficiOS Inc.
https://www.efficios.com
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: PATCH] tracing: Fix unused tracepoints when module uses only exported ones
2025-12-08 14:22 ` Mathieu Desnoyers
@ 2025-12-10 1:25 ` Steven Rostedt
0 siblings, 0 replies; 3+ messages in thread
From: Steven Rostedt @ 2025-12-10 1:25 UTC (permalink / raw)
To: Mathieu Desnoyers
Cc: LKML, Linux trace kernel, Masami Hiramatsu, Masahiro Yamada
On Mon, 8 Dec 2025 09:22:48 -0500
Mathieu Desnoyers <mathieu.desnoyers@efficios.com> wrote:
> On 2025-12-08 08:53, Steven Rostedt wrote:
> > From: Steven Rostedt <rostedt@goodmis.org>
>
> Missing bracket for [PATCH] in subject.
>
> >
> > Building the KVM intel module failed to build with UT=1:
>
> failed -> fails (present ?)
After the patch is applied it will be in the past ;-)
>
> >
> > no __tracepoint_strings in file: arch/x86/kvm/kvm-intel.o
> > make[3]: *** [/work/git/test-linux.git/scripts/Makefile.modfinal:62: arch/x86/kvm/kvm-intel.ko] Error 1
> >
> > The reason is that the module only uses the tracepoints defined and
> > exported by the main kvm module. The tracepoint-udpate.c code fails the
>
> I guess you mean "tracepoint-update.c" ?
Oops
>
> > build if a tracepoint is used, but there's no tracepoints defined. But
>
> tracepoint
Actually, plural is fine here. Because it means one or more here.
>
> > this is acceptable in modules if the tracepoints is defined in the vmlinux
>
> tracepoint
Actually, it should stay plural (as it is more than one), but needs s/is/are/
>
> > proper or another module and exported.
> >
> > Do not fail to build if a tracepoint is used but no tracepoints are
>
> tracepoint .. is
>
Again, plural is OK here, but the other fixes can be done.
Although I see this right after I send a pull request to Linus, but
because I'm currently at the Maintainers Summit with Linus, and I don't
need to test this to fix it, I'll set up another pull request and tell
him to take the second one.
Thanks,
-- Steve
But, because it's just a change log fix and
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-12-10 1:26 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-08 13:53 PATCH] tracing: Fix unused tracepoints when module uses only exported ones Steven Rostedt
2025-12-08 14:22 ` Mathieu Desnoyers
2025-12-10 1:25 ` Steven Rostedt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).