Re: [PATCH bpf-next 10/16] libbpf: implement generalized .BTF.ext func/line info adjustment
From: Andrii Nakryiko <hidden>
Date: 2020-08-20 23:31:25
Also in:
bpf
On Thu, Aug 20, 2020 at 4:13 PM Andrii Nakryiko [off-list ref] wrote:
Complete multi-prog sections and multi sub-prog support in libbpf by properly adjusting .BTF.ext's line and function information. Mark exposed btf_ext__reloc_func_info() and btf_ext__reloc_func_info() APIs as deprecated. These APIs have simplistic assumption that all sub-programs are going to be appended to all main BPF programs, which doesn't hold in real life. It's unlikely there are any users of this API, as it's very libbpf internals-specific. Signed-off-by: Andrii Nakryiko <redacted> --- tools/lib/bpf/btf.h | 18 +-- tools/lib/bpf/libbpf.c | 217 ++++++++++++++++++++++------------ tools/lib/bpf/libbpf_common.h | 2 + 3 files changed, 153 insertions(+), 84 deletions(-)
[...]
quoted hunk ↗ jump to hunk
diff --git a/tools/lib/bpf/libbpf_common.h b/tools/lib/bpf/libbpf_common.h index a23ae1ac27eb..145ddff57235 100644 --- a/tools/lib/bpf/libbpf_common.h +++ b/tools/lib/bpf/libbpf_common.h@@ -15,6 +15,8 @@ #define LIBBPF_API __attribute__((visibility("default"))) #endif +#define DEPRECATED(msg) __attribute__((deprecated(msg)))
Given this will end up in user code, it seems like using LIBBPF_DEPRECATED would be a better choice. I'll update for v2.
+ /* Helper macro to declare and initialize libbpf options struct * * This dance with uninitialized declaration, followed by memset to zero, -- 2.24.1