[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3612840f-0c05-4797-8e75-872a306da45c@efficios.com>
Date: Mon, 8 Dec 2025 09:22:48 -0500
From: Mathieu Desnoyers <mathieu.desnoyers@...icios.com>
To: Steven Rostedt <rostedt@...dmis.org>, LKML
<linux-kernel@...r.kernel.org>,
Linux trace kernel <linux-trace-kernel@...r.kernel.org>
Cc: Masami Hiramatsu <mhiramat@...nel.org>,
Masahiro Yamada <masahiroy@...nel.org>
Subject: Re: PATCH] tracing: Fix unused tracepoints when module uses only
exported ones
On 2025-12-08 08:53, Steven Rostedt wrote:
> From: Steven Rostedt <rostedt@...dmis.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@...dmis.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
Powered by blists - more mailing lists