diff mbox series

[v2,bpf-next,4/4] libbpf: deprecate bpf_program__get_prog_info_linear

Message ID 20211011082031.4148337-5-davemarchevsky@fb.com (mailing list archive)
State Changes Requested
Delegated to: BPF
Headers show
Series libbpf: deprecate bpf_program__get_prog_info_linear | expand

Checks

Context Check Description
bpf/vmtest-bpf-next-PR success PR summary
netdev/cover_letter success Series has a cover letter
netdev/fixes_present success Fixes tag not required for -next series
netdev/patch_count success Link
netdev/tree_selection success Clearly marked for bpf-next
netdev/subject_prefix success Link
netdev/cc_maintainers warning 5 maintainers not CCed: yhs@fb.com john.fastabend@gmail.com kafai@fb.com netdev@vger.kernel.org kpsingh@kernel.org
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/kdoc success Errors and warnings before: 10 this patch: 10
netdev/verify_fixes success No Fixes tag
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 15 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/header_inline success No static functions without inline keyword in header files
bpf/vmtest-bpf-next success VM_Test

Commit Message

Dave Marchevsky Oct. 11, 2021, 8:20 a.m. UTC
As part of the road to libbpf 1.0, and discussed in libbpf issue tracker
[0], bpf_program__get_prog_info_linear and its associated structs and
helper functions should be deprecated. The functionality is too specific
to the needs of 'perf', and there's little/no out-of-tree usage to
preclude introduction of a more general helper in the future.

[0] Closes: https://github.com/libbpf/libbpf/issues/313

Signed-off-by: Dave Marchevsky <davemarchevsky@fb.com>
---
 tools/lib/bpf/libbpf.h | 3 +++
 1 file changed, 3 insertions(+)

Comments

Andrii Nakryiko Oct. 20, 2021, 5:37 p.m. UTC | #1
On Mon, Oct 11, 2021 at 1:20 AM Dave Marchevsky <davemarchevsky@fb.com> wrote:
>
> As part of the road to libbpf 1.0, and discussed in libbpf issue tracker
> [0], bpf_program__get_prog_info_linear and its associated structs and
> helper functions should be deprecated. The functionality is too specific
> to the needs of 'perf', and there's little/no out-of-tree usage to
> preclude introduction of a more general helper in the future.
>
> [0] Closes: https://github.com/libbpf/libbpf/issues/313

styling nit: don't know if it's described anywhere or not, but when
people do references like this, they use 2 spaces of indentation. No
idea how it came to be, but that's what I did for a while and see
others doing the same.

>
> Signed-off-by: Dave Marchevsky <davemarchevsky@fb.com>
> ---
>  tools/lib/bpf/libbpf.h | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/tools/lib/bpf/libbpf.h b/tools/lib/bpf/libbpf.h
> index 89ca9c83ed4e..285008b46e1b 100644
> --- a/tools/lib/bpf/libbpf.h
> +++ b/tools/lib/bpf/libbpf.h
> @@ -877,12 +877,15 @@ struct bpf_prog_info_linear {
>         __u8                    data[];
>  };
>
> +LIBBPF_DEPRECATED_SINCE(0, 7, "use a custom linear prog_info wrapper")
>  LIBBPF_API struct bpf_prog_info_linear *
>  bpf_program__get_prog_info_linear(int fd, __u64 arrays);
>
> +LIBBPF_DEPRECATED_SINCE(0, 7, "use a custom linear prog_info wrapper")
>  LIBBPF_API void
>  bpf_program__bpil_addr_to_offs(struct bpf_prog_info_linear *info_linear);
>
> +LIBBPF_DEPRECATED_SINCE(0, 7, "use a custom linear prog_info wrapper")

we can actually deprecate all this starting from v0.6, because perf is
building libbpf statically, so no worries about releases (also there
are no replacement APIs we have to wait full release for)


>  LIBBPF_API void
>  bpf_program__bpil_offs_to_addr(struct bpf_prog_info_linear *info_linear);
>
> --
> 2.30.2
>
Toke Høiland-Jørgensen Oct. 20, 2021, 9:01 p.m. UTC | #2
Andrii Nakryiko <andrii.nakryiko@gmail.com> writes:

> On Mon, Oct 11, 2021 at 1:20 AM Dave Marchevsky <davemarchevsky@fb.com> wrote:
>>
>> As part of the road to libbpf 1.0, and discussed in libbpf issue tracker
>> [0], bpf_program__get_prog_info_linear and its associated structs and
>> helper functions should be deprecated. The functionality is too specific
>> to the needs of 'perf', and there's little/no out-of-tree usage to
>> preclude introduction of a more general helper in the future.
>>
>> [0] Closes: https://github.com/libbpf/libbpf/issues/313
>
> styling nit: don't know if it's described anywhere or not, but when
> people do references like this, they use 2 spaces of indentation. No
> idea how it came to be, but that's what I did for a while and see
> others doing the same.
>
>>
>> Signed-off-by: Dave Marchevsky <davemarchevsky@fb.com>
>> ---
>>  tools/lib/bpf/libbpf.h | 3 +++
>>  1 file changed, 3 insertions(+)
>>
>> diff --git a/tools/lib/bpf/libbpf.h b/tools/lib/bpf/libbpf.h
>> index 89ca9c83ed4e..285008b46e1b 100644
>> --- a/tools/lib/bpf/libbpf.h
>> +++ b/tools/lib/bpf/libbpf.h
>> @@ -877,12 +877,15 @@ struct bpf_prog_info_linear {
>>         __u8                    data[];
>>  };
>>
>> +LIBBPF_DEPRECATED_SINCE(0, 7, "use a custom linear prog_info wrapper")
>>  LIBBPF_API struct bpf_prog_info_linear *
>>  bpf_program__get_prog_info_linear(int fd, __u64 arrays);
>>
>> +LIBBPF_DEPRECATED_SINCE(0, 7, "use a custom linear prog_info wrapper")
>>  LIBBPF_API void
>>  bpf_program__bpil_addr_to_offs(struct bpf_prog_info_linear *info_linear);
>>
>> +LIBBPF_DEPRECATED_SINCE(0, 7, "use a custom linear prog_info wrapper")
>
> we can actually deprecate all this starting from v0.6, because perf is
> building libbpf statically, so no worries about releases (also there
> are no replacement APIs we have to wait full release for)

Just FYI, we're also using this in libxdp, and that does link
dynamically to libbpf. It's not an issue to move away from it[0], but
perf is not the only user :)

-Toke

[0] Track that here: https://github.com/xdp-project/xdp-tools/issues/127
Andrii Nakryiko Oct. 22, 2021, 7:26 p.m. UTC | #3
On Fri, Oct 22, 2021 at 12:18 PM Dave Marchevsky <davemarchevsky@fb.com> wrote:
>
> On 10/20/21 5:01 PM, Toke Høiland-Jørgensen wrote:
> > Andrii Nakryiko <andrii.nakryiko@gmail.com> writes:
> >
> >> On Mon, Oct 11, 2021 at 1:20 AM Dave Marchevsky <davemarchevsky@fb.com> wrote:
> >>>
> >>> As part of the road to libbpf 1.0, and discussed in libbpf issue tracker
> >>> [0], bpf_program__get_prog_info_linear and its associated structs and
> >>> helper functions should be deprecated. The functionality is too specific
> >>> to the needs of 'perf', and there's little/no out-of-tree usage to
> >>> preclude introduction of a more general helper in the future.
> >>>
> >>> [0] Closes: https://github.com/libbpf/libbpf/issues/313
> >>
> >> styling nit: don't know if it's described anywhere or not, but when
> >> people do references like this, they use 2 spaces of indentation. No
> >> idea how it came to be, but that's what I did for a while and see
> >> others doing the same.
> >>
> >>>
> >>> Signed-off-by: Dave Marchevsky <davemarchevsky@fb.com>
> >>> ---
>
> [...]
>
> >> we can actually deprecate all this starting from v0.6, because perf is
> >> building libbpf statically, so no worries about releases (also there
> >> are no replacement APIs we have to wait full release for)
> >
> > Just FYI, we're also using this in libxdp, and that does link
> > dynamically to libbpf. It's not an issue to move away from it[0], but
> > perf is not the only user :)
> >
> > -Toke
> >
> > [0] Track that here: https://github.com/xdp-project/xdp-tools/issues/127
> >
>
> I submitted a PR to migrate the xdp-tools usage as well. Strange that
> this didn't show up in an "all github" search.
>
> Andrii, should the DEPRECATED_SINCE stay at 0.7 in light of this?

There is no replacement API that we need to wait to go through full
libbpf release, so no, it can stay as is.
diff mbox series

Patch

diff --git a/tools/lib/bpf/libbpf.h b/tools/lib/bpf/libbpf.h
index 89ca9c83ed4e..285008b46e1b 100644
--- a/tools/lib/bpf/libbpf.h
+++ b/tools/lib/bpf/libbpf.h
@@ -877,12 +877,15 @@  struct bpf_prog_info_linear {
 	__u8			data[];
 };
 
+LIBBPF_DEPRECATED_SINCE(0, 7, "use a custom linear prog_info wrapper")
 LIBBPF_API struct bpf_prog_info_linear *
 bpf_program__get_prog_info_linear(int fd, __u64 arrays);
 
+LIBBPF_DEPRECATED_SINCE(0, 7, "use a custom linear prog_info wrapper")
 LIBBPF_API void
 bpf_program__bpil_addr_to_offs(struct bpf_prog_info_linear *info_linear);
 
+LIBBPF_DEPRECATED_SINCE(0, 7, "use a custom linear prog_info wrapper")
 LIBBPF_API void
 bpf_program__bpil_offs_to_addr(struct bpf_prog_info_linear *info_linear);