diff mbox series

perf tools: Do not use deprecated bpf_program__title

Message ID 20200907110237.1329532-1-jolsa@kernel.org
State Not Applicable
Delegated to: David Miller
Headers show
Series perf tools: Do not use deprecated bpf_program__title | expand

Commit Message

Jiri Olsa Sept. 7, 2020, 11:02 a.m. UTC
The bpf_program__title function got deprecated in libbpf,
use the suggested alternative.

Fixes: 521095842027 ("libbpf: Deprecate notion of BPF program "title" in favor of "section name"")
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
 tools/perf/util/bpf-loader.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Andrii Nakryiko Sept. 8, 2020, 8:11 p.m. UTC | #1
On Mon, Sep 7, 2020 at 10:57 AM Jiri Olsa <jolsa@kernel.org> wrote:
>
> The bpf_program__title function got deprecated in libbpf,
> use the suggested alternative.
>
> Fixes: 521095842027 ("libbpf: Deprecate notion of BPF program "title" in favor of "section name"")
> Signed-off-by: Jiri Olsa <jolsa@kernel.org>
> ---

Hey Jiri,

Didn't see your patch before I sent mine against bpf-next. I also
removed some unnecessary checks there. Please see [0]. I don't care
which one gets applied, btw.

  [0] https://patchwork.ozlabs.org/project/netdev/patch/20200908180127.1249-1-andriin@fb.com/

>  tools/perf/util/bpf-loader.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/tools/perf/util/bpf-loader.c b/tools/perf/util/bpf-loader.c
> index 2feb751516ab..73de3973c8ec 100644
> --- a/tools/perf/util/bpf-loader.c
> +++ b/tools/perf/util/bpf-loader.c
> @@ -328,7 +328,7 @@ config_bpf_program(struct bpf_program *prog)
>         probe_conf.no_inlines = false;
>         probe_conf.force_add = false;
>
> -       config_str = bpf_program__title(prog, false);
> +       config_str = bpf_program__section_name(prog);
>         if (IS_ERR(config_str)) {
>                 pr_debug("bpf: unable to get title for program\n");
>                 return PTR_ERR(config_str);
> @@ -454,7 +454,7 @@ preproc_gen_prologue(struct bpf_program *prog, int n,
>         if (err) {
>                 const char *title;
>
> -               title = bpf_program__title(prog, false);
> +               title = bpf_program__section_name(prog);
>                 if (!title)
>                         title = "[unknown]";
>
> --
> 2.26.2
>
Jiri Olsa Sept. 9, 2020, 7:19 a.m. UTC | #2
On Tue, Sep 08, 2020 at 01:11:36PM -0700, Andrii Nakryiko wrote:
> On Mon, Sep 7, 2020 at 10:57 AM Jiri Olsa <jolsa@kernel.org> wrote:
> >
> > The bpf_program__title function got deprecated in libbpf,
> > use the suggested alternative.
> >
> > Fixes: 521095842027 ("libbpf: Deprecate notion of BPF program "title" in favor of "section name"")
> > Signed-off-by: Jiri Olsa <jolsa@kernel.org>
> > ---
> 
> Hey Jiri,
> 
> Didn't see your patch before I sent mine against bpf-next. I also
> removed some unnecessary checks there. Please see [0]. I don't care
> which one gets applied, btw.
> 
>   [0] https://patchwork.ozlabs.org/project/netdev/patch/20200908180127.1249-1-andriin@fb.com/

perfect, let's take yours with that extra check removed

thanks,
jirka

> 
> >  tools/perf/util/bpf-loader.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/tools/perf/util/bpf-loader.c b/tools/perf/util/bpf-loader.c
> > index 2feb751516ab..73de3973c8ec 100644
> > --- a/tools/perf/util/bpf-loader.c
> > +++ b/tools/perf/util/bpf-loader.c
> > @@ -328,7 +328,7 @@ config_bpf_program(struct bpf_program *prog)
> >         probe_conf.no_inlines = false;
> >         probe_conf.force_add = false;
> >
> > -       config_str = bpf_program__title(prog, false);
> > +       config_str = bpf_program__section_name(prog);
> >         if (IS_ERR(config_str)) {
> >                 pr_debug("bpf: unable to get title for program\n");
> >                 return PTR_ERR(config_str);
> > @@ -454,7 +454,7 @@ preproc_gen_prologue(struct bpf_program *prog, int n,
> >         if (err) {
> >                 const char *title;
> >
> > -               title = bpf_program__title(prog, false);
> > +               title = bpf_program__section_name(prog);
> >                 if (!title)
> >                         title = "[unknown]";
> >
> > --
> > 2.26.2
> >
>
diff mbox series

Patch

diff --git a/tools/perf/util/bpf-loader.c b/tools/perf/util/bpf-loader.c
index 2feb751516ab..73de3973c8ec 100644
--- a/tools/perf/util/bpf-loader.c
+++ b/tools/perf/util/bpf-loader.c
@@ -328,7 +328,7 @@  config_bpf_program(struct bpf_program *prog)
 	probe_conf.no_inlines = false;
 	probe_conf.force_add = false;
 
-	config_str = bpf_program__title(prog, false);
+	config_str = bpf_program__section_name(prog);
 	if (IS_ERR(config_str)) {
 		pr_debug("bpf: unable to get title for program\n");
 		return PTR_ERR(config_str);
@@ -454,7 +454,7 @@  preproc_gen_prologue(struct bpf_program *prog, int n,
 	if (err) {
 		const char *title;
 
-		title = bpf_program__title(prog, false);
+		title = bpf_program__section_name(prog);
 		if (!title)
 			title = "[unknown]";