Kunit to check the longest symbol length
authorSergio González Collado <sergio.collado@gmail.com>
Sun, 2 Mar 2025 22:15:18 +0000 (23:15 +0100)
committerShuah Khan <shuah@kernel.org>
Sun, 16 Mar 2025 00:13:31 +0000 (18:13 -0600)
commitc104c16073b7fdb3e4eae18f66f4009f6b073d6f
tree1d49dc244e46baf70efd6ef9fb021b70c3064b4e
parent0619a4868fc1b32b07fb9ed6c69adc5e5cf4e4b2
Kunit to check the longest symbol length

The longest length of a symbol (KSYM_NAME_LEN) was increased to 512
in the reference [1]. This patch adds kunit test suite to check the longest
symbol length. These tests verify that the longest symbol length defined
is supported.

This test can also help other efforts for longer symbol length,
like [2].

The test suite defines one symbol with the longest possible length.

The first test verify that functions with names of the created
symbol, can be called or not.

The second test, verify that the symbols are created (or
not) in the kernel symbol table.

[1] https://lore.kernel.org/lkml/20220802015052.10452-6-ojeda@kernel.org/
[2] https://lore.kernel.org/lkml/20240605032120.3179157-1-song@kernel.org/

Link: https://lore.kernel.org/r/20250302221518.76874-1-sergio.collado@gmail.com
Tested-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com>
Reviewed-by: Shuah Khan <skhan@linuxfoundation.org>
Reviewed-by: Rae Moar <rmoar@google.com>
Signed-off-by: Sergio González Collado <sergio.collado@gmail.com>
Link: https://github.com/Rust-for-Linux/linux/issues/504
Reviewed-by: Rae Moar <rmoar@google.com>
Acked-by: David Gow <davidgow@google.com>
Signed-off-by: Shuah Khan <shuah@kernel.org>
arch/x86/tools/insn_decoder_test.c
lib/Kconfig.debug
lib/Makefile
lib/longest_symbol_kunit.c [new file with mode: 0644]