]> git.baikalelectronics.ru Git - kernel.git/commit
libbpf: stop enforcing kern_version, populate it for users
authorAndrii Nakryiko <andriin@fb.com>
Fri, 4 Oct 2019 22:40:34 +0000 (15:40 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Sun, 6 Oct 2019 01:09:47 +0000 (18:09 -0700)
commitd23bba12f976d25d92ed366eb023521f8a9990d0
tree7ebdbfd2ca26562c10862f6d80967b21fd0af5a3
parenta809c21d53c704b678d3d7d156aebac970b51eb4
libbpf: stop enforcing kern_version, populate it for users

Kernel version enforcement for kprobes/kretprobes was removed from
5.0 kernel in 1a4860981cdd ("bpf: remove useless version check for prog load").
Since then, BPF programs were specifying SEC("version") just to please
libbpf. We should stop enforcing this in libbpf, if even kernel doesn't
care. Furthermore, libbpf now will pre-populate current kernel version
of the host system, in case we are still running on old kernel.

This patch also removes __bpf_object__open_xattr from libbpf.h, as
nothing in libbpf is relying on having it in that header. That function
was never exported as LIBBPF_API and even name suggests its internal
version. So this should be safe to remove, as it doesn't break ABI.

Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/lib/bpf/libbpf.c
tools/lib/bpf/libbpf.h
tools/testing/selftests/bpf/progs/test_attach_probe.c
tools/testing/selftests/bpf/progs/test_get_stack_rawtp.c
tools/testing/selftests/bpf/progs/test_perf_buffer.c
tools/testing/selftests/bpf/progs/test_stacktrace_map.c