aboutsummaryrefslogtreecommitdiffstats
path: root/tools/lib/bpf/libbpf_common.h
diff options
context:
space:
mode:
authorAlexei Starovoitov <ast@kernel.org>2021-09-17 09:04:13 -0700
committerAlexei Starovoitov <ast@kernel.org>2021-09-17 09:05:41 -0700
commitf706f6c66c4360e41dd650bcf24a45880e75bb39 (patch)
tree41c2d3963751330b621ff21f8e1014f3d058ba88 /tools/lib/bpf/libbpf_common.h
parentbpf: Update bpf_get_smp_processor_id() documentation (diff)
parentlibbpf: Constify all high-level program attach APIs (diff)
downloadlinux-dev-f706f6c66c4360e41dd650bcf24a45880e75bb39.tar.xz
linux-dev-f706f6c66c4360e41dd650bcf24a45880e75bb39.zip
Merge branch 'Improve set_attach_target() and deprecate open_opts.attach_prog_fd'
Andrii Nakryiko says: ==================== This patch set deprecates bpf_object_open_opts.attach_prog_fd (in libbpf 0.7+) by extending bpf_program__set_attach_target() to support some more flexible scenarios. Existing fexit_bpf2bpf selftest is updated accordingly to not use deprecated APIs. While at it, also deprecate no-op relaxed_core_relocs option (they are always "relaxed"). Last patch also const-ifies all high-level libbpf attach APIs, as there is no reason for them to assume bpf_program/bpf_map modifications. Patch #1 also removes one more unneeded use of find_sec_def(), relying on prog->sec_def that's set during bpf_object__open() operation, simplifying upcoming refactoring a little bit more. All these changes are preparatory patches before SEC() handling refactoring that will come next. ==================== Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/lib/bpf/libbpf_common.h')
-rw-r--r--tools/lib/bpf/libbpf_common.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/lib/bpf/libbpf_common.h b/tools/lib/bpf/libbpf_common.h
index 36ac77f2bea2..aaa1efbf6f51 100644
--- a/tools/lib/bpf/libbpf_common.h
+++ b/tools/lib/bpf/libbpf_common.h
@@ -35,6 +35,11 @@
#else
#define __LIBBPF_MARK_DEPRECATED_0_6(X)
#endif
+#if __LIBBPF_CURRENT_VERSION_GEQ(0, 7)
+#define __LIBBPF_MARK_DEPRECATED_0_7(X) X
+#else
+#define __LIBBPF_MARK_DEPRECATED_0_7(X)
+#endif
/* Helper macro to declare and initialize libbpf options struct
*