linux/tools/testing
Yonghong Song 898ac74c5b selftests/bpf: Ignore .llvm.<hash> suffix in kallsyms_find()
I hit the following failure when running selftests with
internal backported upstream kernel:
  test_ksyms:PASS:kallsyms_fopen 0 nsec
  test_ksyms:FAIL:ksym_find symbol 'bpf_link_fops' not found
  #123     ksyms:FAIL

In /proc/kallsyms, we have
  $ cat /proc/kallsyms | grep bpf_link_fops
  ffffffff829f0cb0 d bpf_link_fops.llvm.12608678492448798416
The CONFIG_LTO_CLANG_THIN is enabled in the kernel which is responsible
for bpf_link_fops.llvm.12608678492448798416 symbol name.

In prog_tests/ksyms.c we have
  kallsyms_find("bpf_link_fops", &link_fops_addr)
and kallsyms_find() compares "bpf_link_fops" with symbols
in /proc/kallsyms in order to find the entry. With
bpf_link_fops.llvm.<hash> in /proc/kallsyms, the kallsyms_find()
failed.

To fix the issue, in kallsyms_find(), if a symbol has suffix
.llvm.<hash>, that suffix will be ignored for comparison.
This fixed the test failure.

Signed-off-by: Yonghong Song <yonghong.song@linux.dev>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20240604180034.1356016-1-yonghong.song@linux.dev
2024-06-04 12:49:44 -07:00
..
crypto/chacha20-s390
cxl CXL changes for v6.10 merge window 2024-05-15 14:32:27 -07:00
fault-injection
ktest ktest: force $buildonly = 1 for 'make_warnings_file' test type 2024-03-15 12:36:19 -04:00
kunit RISC-V SoC Kconfig Updates for v6.10 2024-05-07 11:02:56 +02:00
memblock
nvdimm ndtest: Convert to platform remove callback returning void 2024-04-25 12:37:12 -07:00
radix-tree tools: fix userspace compilation with new test_xarray changes 2024-05-05 17:28:05 -07:00
scatterlist
selftests selftests/bpf: Ignore .llvm.<hash> suffix in kallsyms_find() 2024-06-04 12:49:44 -07:00
vsock