From: Alexei Starovoitov Date: Thu, 28 Mar 2024 01:53:49 +0000 (-0700) Subject: Merge branch 'bpf-fix-a-couple-of-test-failures-with-lto-kernel' X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=e478cf26c556e4ab572ab0ab2306c986901dcd61;p=linux.git Merge branch 'bpf-fix-a-couple-of-test-failures-with-lto-kernel' Yonghong Song says: ==================== bpf: Fix a couple of test failures with LTO kernel With a LTO kernel built with clang, with one of earlier version of kernel, I encountered two test failures, ksyms and kprobe_multi_bench_attach/kernel. Now with latest bpf-next, only kprobe_multi_bench_attach/kernel failed. But it is possible in the future ksyms selftest may fail again. Both test failures are due to static variable/function renaming due to cross-file inlining. For Ksyms failure, the solution is to strip .llvm. suffixes for symbols in /proc/kallsyms before comparing against the ksym in bpf program. For kprobe_multi_bench_attach/kernel failure, the solution is to either provide names in /proc/kallsyms to the kernel or ignore those names who have .llvm. suffix since the kernel sym name comparison is against /proc/kallsyms. Please see each individual patches for details. Changelogs: v2 -> v3: - no need to check config file, directly so strstr with '.llvm.'. - for kprobe_multi_bench with syms, instead of skipping the syms, consult /proc/kallyms to find corresponding names. - add a test with populating addrs to the kernel for kprobe multi attach. v1 -> v2: - Let libbpf handle .llvm. --- e478cf26c556e4ab572ab0ab2306c986901dcd61