linux/tools/lib/bpf
Andrii Nakryiko f8a05692de libbpf: Work around kernel inconsistently stripping '.llvm.' suffix
Some versions of kernel were stripping out '.llvm.<hash>' suffix from
kerne symbols (produced by Clang LTO compilation) from function names
reported in available_filter_functions, while kallsyms reported full
original name. This confuses libbpf's multi-kprobe logic of finding all
matching kernel functions for specified user glob pattern by joining
available_filter_functions and kallsyms contents, because joining by
full symbol name won't work for symbols containing '.llvm.<hash>' suffix.

This was eventually fixed by [0] in the kernel, but we'd like to not
regress multi-kprobe experience and add a work around for this bug on
libbpf side, stripping kallsym's name if it matches user pattern and
contains '.llvm.' suffix.

  [0] fb6a421fb6 ("kallsyms: Match symbols exactly with CONFIG_LTO_CLANG")

Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Yonghong Song <yonghong.song@linux.dev>
Link: https://lore.kernel.org/bpf/20250117003957.179331-1-andrii@kernel.org
2025-01-17 15:16:56 +01:00
..
.gitignore tools build: Correct bpf fixdep dependencies 2024-08-05 12:19:48 -03:00
Build libbpf: Split field iter code into its own file kernel 2024-06-21 14:45:07 -07:00
Makefile libbpf: Add missing per-arch include path 2024-10-07 20:20:55 -07:00
bpf.c libbpf: prog load: Allow to use fd_array_cnt 2024-12-13 14:48:39 -08:00
bpf.h libbpf: prog load: Allow to use fd_array_cnt 2024-12-13 14:48:39 -08:00
bpf_core_read.h bpf: Avoid uninitialized value in BPF_CORE_READ_BITFIELD 2024-05-08 15:00:55 -07:00
bpf_endian.h
bpf_gen_internal.h libbpf: Support creating light skeleton of either endianness 2024-10-03 17:47:36 -07:00
bpf_helpers.h libbpf: define __uptr. 2024-10-24 10:25:59 -07:00
bpf_prog_linfo.c
bpf_tracing.h libbpf: Fix some typos in comments 2024-09-09 16:05:40 -07:00
btf.c libbpf: Fix return zero when elf_begin failed 2025-01-16 15:34:18 -08:00
btf.h libbpf: Support BTF.ext loading and output in either endianness 2024-10-03 17:47:36 -07:00
btf_dump.c libbpf: Stringify errno in log messages in btf*.c 2024-11-11 20:29:45 -08:00
btf_iter.c libbpf,bpf: Share BTF relocate-related code with kernel 2024-06-21 14:45:07 -07:00
btf_relocate.c libbpf: Fix incorrect traversal end type ID when marking BTF_IS_EMBEDDED 2025-01-16 15:34:18 -08:00
elf.c libbpf: Stringify errno in log messages in the remaining code 2024-11-11 20:29:45 -08:00
features.c libbpf: Stringify errno in log messages in the remaining code 2024-11-11 20:29:45 -08:00
gen_loader.c libbpf: Stringify errno in log messages in the remaining code 2024-11-11 20:29:45 -08:00
hashmap.c libbpf: Hashmap interface update to allow both long and void* keys/values 2022-11-09 20:45:14 -08:00
hashmap.h libbpf: Fix possible compiler warnings in hashmap 2024-10-11 12:36:59 -07:00
libbpf.c libbpf: Work around kernel inconsistently stripping '.llvm.' suffix 2025-01-17 15:16:56 +01:00
libbpf.h libbpf: Add unique_match option for multi kprobe 2025-01-10 13:11:42 -08:00
libbpf.map libbpf: Extend linker API to support in-memory ELF files 2024-12-12 15:16:53 -08:00
libbpf.pc.template
libbpf_common.h libbpf: Fix potential uninitialized tail padding with LIBBPF_OPTS_RESET 2023-11-09 19:07:51 -08:00
libbpf_errno.c libbpf: Optimized return value in libbpf_strerror when errno is libbpf errno 2022-12-14 18:39:33 +01:00
libbpf_internal.h libbpf: Support opening bpf objects of either endianness 2024-10-03 17:47:36 -07:00
libbpf_legacy.h libbpf: Fix some typos in comments 2024-09-09 16:05:40 -07:00
libbpf_probes.c bpf: improve error message for unsupported helper 2024-03-28 18:30:53 -07:00
libbpf_version.h libbpf: start v1.6 development cycle 2024-10-29 13:42:52 -07:00
linker.c libbpf: Extend linker API to support in-memory ELF files 2024-12-12 15:16:53 -08:00
netlink.c libbpf: Use OPTS_SET() macro in bpf_xdp_query() 2024-02-06 09:51:26 -08:00
nlattr.c libbpf: Fix alen calculation in libbpf_nla_dump_errormsg() 2023-02-10 15:27:22 -08:00
nlattr.h libbpf: add API to get XDP/XSK supported features 2023-02-02 20:48:24 -08:00
relo_core.c libbpf: Improve log message formatting 2024-10-03 17:47:36 -07:00
relo_core.h
ringbuf.c libbpf: Stringify errno in log messages in the remaining code 2024-11-11 20:29:45 -08:00
skel_internal.h libbpf: Support creating light skeleton of either endianness 2024-10-03 17:47:36 -07:00
str_error.c libbpf: Introduce errstr() for stringifying errno 2024-11-11 20:29:20 -08:00
str_error.h libbpf: Introduce errstr() for stringifying errno 2024-11-11 20:29:20 -08:00
strset.c libbpf: Hashmap interface update to allow both long and void* keys/values 2022-11-09 20:45:14 -08:00
strset.h
usdt.bpf.h libbpf: fix some typos in libbpf 2024-09-05 13:07:47 -07:00
usdt.c libbpf: don't adjust USDT semaphore address if .stapsdt.base addr is missing 2024-12-02 08:41:17 -08:00
zip.c libbpf: Remove unneeded semicolon 2024-10-03 17:47:35 -07:00
zip.h libbpf: Implement basic zip archive parsing support 2023-03-01 16:05:34 -08:00