On Thu, Aug 20, 2020 at 4:13 PM Andrii Nakryiko <[email protected]> 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 <[email protected]>
> ---
> 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(-)
>
[...]
> 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
>