mbox series

[v6,perf/core,0/2] perf: stop using deprecated bpf APIs

Message ID 20220212155125.3406232-1-andrii@kernel.org (mailing list archive)
Headers show
Series perf: stop using deprecated bpf APIs | expand

Message

Andrii Nakryiko Feb. 12, 2022, 3:51 p.m. UTC
libbpf's bpf_prog_load() and bpf__object_next() APIs are deprecated.
remove perf's usage of these deprecated functions. After this patch
set, the only remaining libbpf deprecated APIs in perf would be
bpf_program__set_prep() and bpf_program__nth_fd().

v5 -> v6:
  - rebase onto perf/core tree (Arnaldo);
v4 -> v5:
  - add bpf_perf_object__add() and use it where appropriate (Jiri);
  - use __maybe_unused in first patch;
v3 -> v4:
  - Fixed commit title
  - Added weak definition for deprecated function
v2 -> v3:
  - Fixed commit message to use upstream perf
v1 -> v2:
  - Added missing commit message
  - Added more details to commit message and added steps to reproduce
    original test case.

Christy Lee (2):
  perf: Stop using deprecated bpf_load_program() API
  perf: Stop using deprecated bpf_object__next() API

 tools/perf/tests/bpf.c       | 14 ++----
 tools/perf/util/bpf-event.c  | 13 +++++
 tools/perf/util/bpf-loader.c | 98 +++++++++++++++++++++++++++++-------
 3 files changed, 96 insertions(+), 29 deletions(-)

Comments

Jiri Olsa Feb. 12, 2022, 6:18 p.m. UTC | #1
On Sat, Feb 12, 2022 at 07:51:23AM -0800, Andrii Nakryiko wrote:
> libbpf's bpf_prog_load() and bpf__object_next() APIs are deprecated.
> remove perf's usage of these deprecated functions. After this patch
> set, the only remaining libbpf deprecated APIs in perf would be
> bpf_program__set_prep() and bpf_program__nth_fd().
> 
> v5 -> v6:
>   - rebase onto perf/core tree (Arnaldo);

looks good, tests are passing for me

jirka

> v4 -> v5:
>   - add bpf_perf_object__add() and use it where appropriate (Jiri);
>   - use __maybe_unused in first patch;
> v3 -> v4:
>   - Fixed commit title
>   - Added weak definition for deprecated function
> v2 -> v3:
>   - Fixed commit message to use upstream perf
> v1 -> v2:
>   - Added missing commit message
>   - Added more details to commit message and added steps to reproduce
>     original test case.
> 
> Christy Lee (2):
>   perf: Stop using deprecated bpf_load_program() API
>   perf: Stop using deprecated bpf_object__next() API
> 
>  tools/perf/tests/bpf.c       | 14 ++----
>  tools/perf/util/bpf-event.c  | 13 +++++
>  tools/perf/util/bpf-loader.c | 98 +++++++++++++++++++++++++++++-------
>  3 files changed, 96 insertions(+), 29 deletions(-)
> 
> -- 
> 2.30.2
>
Andrii Nakryiko Feb. 13, 2022, 1:47 a.m. UTC | #2
On Sat, Feb 12, 2022 at 10:18 AM Jiri Olsa <olsajiri@gmail.com> wrote:
>
> On Sat, Feb 12, 2022 at 07:51:23AM -0800, Andrii Nakryiko wrote:
> > libbpf's bpf_prog_load() and bpf__object_next() APIs are deprecated.
> > remove perf's usage of these deprecated functions. After this patch
> > set, the only remaining libbpf deprecated APIs in perf would be
> > bpf_program__set_prep() and bpf_program__nth_fd().
> >
> > v5 -> v6:
> >   - rebase onto perf/core tree (Arnaldo);
>
> looks good, tests are passing for me

great, thanks for checking!

>
> jirka
>
> > v4 -> v5:
> >   - add bpf_perf_object__add() and use it where appropriate (Jiri);
> >   - use __maybe_unused in first patch;
> > v3 -> v4:
> >   - Fixed commit title
> >   - Added weak definition for deprecated function
> > v2 -> v3:
> >   - Fixed commit message to use upstream perf
> > v1 -> v2:
> >   - Added missing commit message
> >   - Added more details to commit message and added steps to reproduce
> >     original test case.
> >
> > Christy Lee (2):
> >   perf: Stop using deprecated bpf_load_program() API
> >   perf: Stop using deprecated bpf_object__next() API
> >
> >  tools/perf/tests/bpf.c       | 14 ++----
> >  tools/perf/util/bpf-event.c  | 13 +++++
> >  tools/perf/util/bpf-loader.c | 98 +++++++++++++++++++++++++++++-------
> >  3 files changed, 96 insertions(+), 29 deletions(-)
> >
> > --
> > 2.30.2
> >
Arnaldo Carvalho de Melo Feb. 14, 2022, 6:58 p.m. UTC | #3
Em Sat, Feb 12, 2022 at 05:47:25PM -0800, Andrii Nakryiko escreveu:
> On Sat, Feb 12, 2022 at 10:18 AM Jiri Olsa <olsajiri@gmail.com> wrote:
> >
> > On Sat, Feb 12, 2022 at 07:51:23AM -0800, Andrii Nakryiko wrote:
> > > libbpf's bpf_prog_load() and bpf__object_next() APIs are deprecated.
> > > remove perf's usage of these deprecated functions. After this patch
> > > set, the only remaining libbpf deprecated APIs in perf would be
> > > bpf_program__set_prep() and bpf_program__nth_fd().
> > >
> > > v5 -> v6:
> > >   - rebase onto perf/core tree (Arnaldo);
> >
> > looks good, tests are passing for me
> 
> great, thanks for checking!

All tests passed, patches merged and pushed out to perf/core, thanks!

- Arnaldo
 
> >
> > jirka
> >
> > > v4 -> v5:
> > >   - add bpf_perf_object__add() and use it where appropriate (Jiri);
> > >   - use __maybe_unused in first patch;
> > > v3 -> v4:
> > >   - Fixed commit title
> > >   - Added weak definition for deprecated function
> > > v2 -> v3:
> > >   - Fixed commit message to use upstream perf
> > > v1 -> v2:
> > >   - Added missing commit message
> > >   - Added more details to commit message and added steps to reproduce
> > >     original test case.
> > >
> > > Christy Lee (2):
> > >   perf: Stop using deprecated bpf_load_program() API
> > >   perf: Stop using deprecated bpf_object__next() API
> > >
> > >  tools/perf/tests/bpf.c       | 14 ++----
> > >  tools/perf/util/bpf-event.c  | 13 +++++
> > >  tools/perf/util/bpf-loader.c | 98 +++++++++++++++++++++++++++++-------
> > >  3 files changed, 96 insertions(+), 29 deletions(-)
> > >
> > > --
> > > 2.30.2
> > >