linux-xiaomi-chiron/tools/lib/bpf
Andrii Nakryiko 5b3d729877 libbpf: Improve LINUX_VERSION_CODE detection
Ubuntu reports incorrect kernel version through uname(), which on older
kernels leads to kprobe BPF programs failing to load due to the version
check mismatch.

Accommodate Ubuntu's quirks with LINUX_VERSION_CODE by using
Ubuntu-specific /proc/version_code to fetch major/minor/patch versions
to form LINUX_VERSION_CODE.

While at it, consolide libbpf's kernel version detection code between
libbpf.c and libbpf_probes.c.

  [0] Closes: https://github.com/libbpf/libbpf/issues/421

Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Yonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/bpf/20211222231003.2334940-1-andrii@kernel.org
2021-12-28 19:20:31 -08:00
..
.gitignore
bpf.c libbpf: Auto-bump RLIMIT_MEMLOCK if kernel needs it for BPF 2021-12-14 22:16:45 +01:00
bpf.h libbpf: Auto-bump RLIMIT_MEMLOCK if kernel needs it for BPF 2021-12-14 22:16:45 +01:00
bpf_core_read.h
bpf_endian.h
bpf_gen_internal.h
bpf_helpers.h
bpf_prog_linfo.c
bpf_tracing.h libbpf: Use 100-character limit to make bpf_tracing.h easier to read 2021-12-28 19:14:45 -08:00
btf.c
btf.h libbpf: Do not use btf_dump__new() macro in C++ mode 2021-12-23 10:23:16 -08:00
btf_dump.c libbpf: Add sane strncpy alternative and use it internally 2021-12-14 15:47:56 +01:00
Build
gen_loader.c libbpf: Add sane strncpy alternative and use it internally 2021-12-14 15:47:56 +01:00
hashmap.c
hashmap.h
libbpf.c libbpf: Improve LINUX_VERSION_CODE detection 2021-12-28 19:20:31 -08:00
libbpf.h libbpf: Rework feature-probing APIs 2021-12-17 23:10:48 +01:00
libbpf.map libbpf: Rework feature-probing APIs 2021-12-17 23:10:48 +01:00
libbpf.pc.template
libbpf_common.h
libbpf_errno.c
libbpf_internal.h libbpf: Improve LINUX_VERSION_CODE detection 2021-12-28 19:20:31 -08:00
libbpf_legacy.h libbpf: Auto-bump RLIMIT_MEMLOCK if kernel needs it for BPF 2021-12-14 22:16:45 +01:00
libbpf_probes.c libbpf: Improve LINUX_VERSION_CODE detection 2021-12-28 19:20:31 -08:00
libbpf_version.h
linker.c
Makefile tools/libbpf: Enable cross-building with clang 2021-12-16 12:15:05 -08:00
netlink.c
nlattr.c
nlattr.h
relo_core.c libbpf: Fix potential uninit memory read 2021-12-14 15:37:58 +01:00
relo_core.h
ringbuf.c
skel_internal.h
str_error.c
str_error.h
strset.c
strset.h
xsk.c libbpf: Add sane strncpy alternative and use it internally 2021-12-14 15:47:56 +01:00
xsk.h