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: Adjust cmd_check_undefined to show unexpected undefined symbols

When the check_undefined command in kernel/trace/Makefile fails, there
is no output, making it hard to understand why the build failed. Capture
the output of the $(NM) + grep command and print it when failing to make
it clearer what the problem is.

Fixes: a717943d8ecc ("tracing: Check for undefined symbols in simple_ring_buffer")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Reviewed-by: Vincent Donnefort <vdonnefort@google.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Link: https://patch.msgid.link/20260320-cmd_check_undefined-verbose-v1-1-54fc5b061f94@kernel.org
Signed-off-by: Marc Zyngier <maz@kernel.org>

authored by

Nathan Chancellor and committed by
Marc Zyngier
58b4bd18 d7729643

+7 -1
+7 -1
kernel/trace/Makefile
··· 174 174 $(shell $(NM) -u $(obj)/undefsyms_base.o 2>/dev/null | awk '{print $$2}') 175 175 176 176 quiet_cmd_check_undefined = NM $< 177 - cmd_check_undefined = test -z "`$(NM) -u $< | grep -v $(addprefix -e , $(UNDEFINED_ALLOWLIST))`" 177 + cmd_check_undefined = \ 178 + undefsyms=$$($(NM) -u $< | grep -v $(addprefix -e , $(UNDEFINED_ALLOWLIST)) || true); \ 179 + if [ -n "$$undefsyms" ]; then \ 180 + echo "Unexpected symbols in $<:" >&2; \ 181 + echo "$$undefsyms" >&2; \ 182 + false; \ 183 + fi 178 184 179 185 $(obj)/%.o.checked: $(obj)/%.o $(obj)/undefsyms_base.o FORCE 180 186 $(call if_changed,check_undefined)