Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

tracing: Add warnings for unused tracepoints for modules

If a modules has TRACE_EVENT() but does not use it, add a warning about it
at build time.

Currently, the build must be made by adding "UT=1" to the make command
line in order for this to trigger.

Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Masahiro Yamada <masahiroy@kernel.org>
Cc: Nathan Chancellor <nathan@kernel.org>
Cc: Nicolas Schier <nicolas.schier@linux.dev>
Cc: Nick Desaulniers <nick.desaulniers+lkml@gmail.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Randy Dunlap <rdunlap@infradead.org>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Link: https://lore.kernel.org/20251022004453.422000794@kernel.org
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>

+5
+5
scripts/Makefile.modfinal
··· 28 28 .module-common.o: $(srctree)/scripts/module-common.c FORCE 29 29 $(call if_changed_rule,cc_o_c) 30 30 31 + ifneq ($(WARN_ON_UNUSED_TRACEPOINTS),) 32 + cmd_check_tracepoint = $(objtree)/scripts/tracepoint-update --module $<; 33 + endif 34 + 31 35 quiet_cmd_ld_ko_o = LD [M] $@ 32 36 cmd_ld_ko_o = \ 33 37 $(LD) -r $(KBUILD_LDFLAGS) \ ··· 61 57 ifdef CONFIG_DEBUG_INFO_BTF_MODULES 62 58 +$(if $(newer-prereqs),$(call cmd,btf_ko)) 63 59 endif 60 + +$(call cmd,check_tracepoint) 64 61 65 62 targets += $(modules:%.o=%.ko) $(modules:%.o=%.mod.o) .module-common.o 66 63