libbpf: add libbpf_set_strict_mode() API to turn on libbpf 1.0 behaviors
Subsystems (4)
Andrii Nakryiko
maintainerPATCH 1/5 libbpf: add libbpf_set_strict_mode() API to turn on libbpf 1.0 behaviors
Add libbpf_set_strict_mode() API that allows application to simulate libbpf 1.0 breaking changes before libbpf 1.0 is released. This will help users migrate gradually and with confidence.
For now only ALL or NONE options are available, subsequent patches will add more flags. This patch is preliminary for selftests/bpf changes.
Signed-off-by Andrii Nakryiko <[email protected]>
--- tools/lib/bpf/Makefile | 1 + tools/lib/bpf/libbpf.h | 1 + tools/lib/bpf/libbpf.map | 5 ++++ tools/lib/bpf/libbpf_legacy.h | 47 +++++++++++++++++++++++++++++++++++ 4 files changed, 54 insertions(+) create mode 100644 tools/lib/bpf/libbpf_legacy.h
tools/lib/bpf/Makefile +1 -0
@@ -229,6 +229,7 @@ install_headers: $(BPF_HELPER_DEFS) $(call do_install,libbpf.h,$(prefix)/include/bpf,644); \ $(call do_install,btf.h,$(prefix)/include/bpf,644); \ $(call do_install,libbpf_common.h,$(prefix)/include/bpf,644); \ + $(call do_install,libbpf_legacy.h,$(prefix)/include/bpf,644); \ $(call do_install,xsk.h,$(prefix)/include/bpf,644); \ $(call do_install,bpf_helpers.h,$(prefix)/include/bpf,644); \ $(call do_install,$(BPF_HELPER_DEFS),$(prefix)/include/bpf,644); \
tools/lib/bpf/libbpf.h +1 -0
@@ -18,6 +18,7 @@#include <linux/bpf.h> #include "libbpf_common.h" +#include "libbpf_legacy.h" #ifdef __cplusplusextern "C" {
tools/lib/bpf/libbpf.map +5 -0
@@ -369,3 +369,8 @@ LIBBPF_0.4.0 { bpf_tc_hook_destroy; bpf_tc_query; } LIBBPF_0.3.0; + +LIBBPF_0.5.0 { + global: + libbpf_set_strict_mode; +} LIBBPF_0.4.0;
tools/lib/bpf/libbpf_legacy.h new file +47 -0
47 lines not on this page · raw message
Signature · 1 line
2.30.2