PATCH] tracing: Fix unused tracepoints when module uses only exported ones
Steven Rostedt
maintainerFrom: Steven Rostedt <[email protected]>
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.
--- scripts/tracepoint-update.c | 3 +++ 1 file changed, 3 insertions(+)
scripts/tracepoint-update.c +3 -0
@@ -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 ; }
Signature · 1 line
2.51.0
Mathieu Desnoyers
reviewerQuoted 1 line · Steven Rostedt
From: Steven Rostedt <[email protected]>
Missing bracket for [PATCH] in subject.
Quoted 2 lines
Building the KVM intel module failed to build with UT=1:
failed -> fails (present ?)
Quoted 6 lines
no
__tracepoint_stringsin 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 1The reason is that the module only uses the tracepoints defined and exported by the main kvm module. The
tracepoint-udpate.ccode fails the
I guess you mean "tracepoint-update.c" ?
Quoted 1 line
build if a tracepoint is used, but there's no tracepoints defined. But
tracepoint
Quoted 1 line
this is acceptable in modules if the tracepoints is defined in the vmlinux
tracepoint
Quoted 3 lines
proper or another module and exported.
Do not fail to build if a tracepoint is used but no tracepoints are
tracepoint .. is
Thanks,
Mathieu
Quoted 23 lines
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) <[email protected]>--- scripts/tracepoint-update.c | 3 +++ 1 file changed, 3 insertions(+)scripts/tracepoint-update.c +3
-0@@ -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 ; }
Signature · 3 lines
Mathieu Desnoyers EfficiOS Inc. https://www.efficios.com
Steven Rostedt
maintainerQuoted 9 lines · On Mon, 8 Dec 2025 09:22:48 -0500 Mathieu Desnoyers…
Quoted 1 line · Steven Rostedt
From: Steven Rostedt <[email protected]>
Missing bracket for [PATCH] in subject.
Quoted 2 lines
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 ;-)
Quoted 9 lines
Quoted 7 lines
no
__tracepoint_stringsin 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 1The reason is that the module only uses the tracepoints defined and exported by the main kvm module. The
tracepoint-udpate.ccode fails theI guess you mean "
tracepoint-update.c" ?
Oops
Quoted 4 lines
Quoted 2 lines
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.
Quoted 4 lines
Quoted 2 lines
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/
Quoted 7 lines
Quoted 4 lines
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