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

kunit: fix longest symbol length test

The kunit test that checks the longests symbol length [1], has triggered
warnings in some pilelines when symbol prefixes are used [2][3]. The test
will to depend on !PREFIX_SYMBOLS and !CFI_CLANG as sujested in [4] and
on !GCOV_KERNEL.

[1] https://lore.kernel.org/rust-for-linux/CABVgOSm=5Q0fM6neBhxSbOUHBgNzmwf2V22vsYC10YRBT=kN1g@mail.gmail.com/T/#t
[2] https://lore.kernel.org/all/20250328112156.2614513-1-arnd@kernel.org/T/#u
[3] https://lore.kernel.org/rust-for-linux/bbd03b37-c4d9-4a92-9be2-75aaf8c19815@infradead.org/T/#t
[4] https://lore.kernel.org/linux-kselftest/20250427200916.GA1661412@ax162/T/#t

Link: https://lore.kernel.org/r/20250706201855.232451-1-sergio.collado@gmail.com
Reviewed-by: Rae Moar <rmoar@google.com>
Signed-off-by: Sergio González Collado <sergio.collado@gmail.com>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Tested-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>

authored by

Sergio González Collado and committed by
Shuah Khan
34db4fba 5ac244b9

+2 -2
+1
lib/Kconfig.debug
··· 2885 2885 config LONGEST_SYM_KUNIT_TEST 2886 2886 tristate "Test the longest symbol possible" if !KUNIT_ALL_TESTS 2887 2887 depends on KUNIT && KPROBES 2888 + depends on !PREFIX_SYMBOLS && !CFI_CLANG && !GCOV_KERNEL 2888 2889 default KUNIT_ALL_TESTS 2889 2890 help 2890 2891 Tests the longest symbol possible
+1 -2
lib/tests/longest_symbol_kunit.c
··· 3 3 * Test the longest symbol length. Execute with: 4 4 * ./tools/testing/kunit/kunit.py run longest-symbol 5 5 * --arch=x86_64 --kconfig_add CONFIG_KPROBES=y --kconfig_add CONFIG_MODULES=y 6 - * --kconfig_add CONFIG_RETPOLINE=n --kconfig_add CONFIG_CFI_CLANG=n 7 - * --kconfig_add CONFIG_MITIGATION_RETPOLINE=n 6 + * --kconfig_add CONFIG_CPU_MITIGATIONS=n --kconfig_add CONFIG_GCOV_KERNEL=n 8 7 */ 9 8 10 9 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt