Netdev List
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@redhat.com>
To: Andrii Nakryiko <andriin@fb.com>
Cc: bpf@vger.kernel.org, netdev@vger.kernel.org, ast@fb.com,
	daniel@iogearbox.net, acme@kernel.org, andrii.nakryiko@gmail.com,
	kernel-team@fb.com
Subject: Re: [PATCH bpf-next] perf: stop using deprecated bpf_program__title()
Date: Wed, 9 Sep 2020 09:21:00 +0200	[thread overview]
Message-ID: <20200909072100.GB1498025@krava> (raw)
In-Reply-To: <20200908180127.1249-1-andriin@fb.com>

On Tue, Sep 08, 2020 at 11:01:27AM -0700, Andrii Nakryiko wrote:
> Switch from deprecated bpf_program__title() API to
> bpf_program__section_name(). Also drop unnecessary error checks because
> neither bpf_program__title() nor bpf_program__section_name() can fail or
> return NULL.
> 
> Fixes: 521095842027 ("libbpf: Deprecate notion of BPF program "title" in favor of "section name"")
> Signed-off-by: Andrii Nakryiko <andriin@fb.com>

Acked-by: Jiri Olsa <jolsa@redhat.com>

thanks,
jirka

> ---
>  tools/perf/util/bpf-loader.c | 12 ++----------
>  1 file changed, 2 insertions(+), 10 deletions(-)
> 
> diff --git a/tools/perf/util/bpf-loader.c b/tools/perf/util/bpf-loader.c
> index 2feb751516ab..0374adcb223c 100644
> --- a/tools/perf/util/bpf-loader.c
> +++ b/tools/perf/util/bpf-loader.c
> @@ -328,12 +328,6 @@ config_bpf_program(struct bpf_program *prog)
>  	probe_conf.no_inlines = false;
>  	probe_conf.force_add = false;
>  
> -	config_str = bpf_program__title(prog, false);
> -	if (IS_ERR(config_str)) {
> -		pr_debug("bpf: unable to get title for program\n");
> -		return PTR_ERR(config_str);
> -	}
> -
>  	priv = calloc(sizeof(*priv), 1);
>  	if (!priv) {
>  		pr_debug("bpf: failed to alloc priv\n");
> @@ -341,6 +335,7 @@ config_bpf_program(struct bpf_program *prog)
>  	}
>  	pev = &priv->pev;
>  
> +	config_str = bpf_program__section_name(prog);
>  	pr_debug("bpf: config program '%s'\n", config_str);
>  	err = parse_prog_config(config_str, &main_str, &is_tp, pev);
>  	if (err)
> @@ -454,10 +449,7 @@ preproc_gen_prologue(struct bpf_program *prog, int n,
>  	if (err) {
>  		const char *title;
>  
> -		title = bpf_program__title(prog, false);
> -		if (!title)
> -			title = "[unknown]";
> -
> +		title = bpf_program__section_name(prog);
>  		pr_debug("Failed to generate prologue for program %s\n",
>  			 title);
>  		return err;
> -- 
> 2.24.1
> 


  reply	other threads:[~2020-09-09  7:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-08 18:01 [PATCH bpf-next] perf: stop using deprecated bpf_program__title() Andrii Nakryiko
2020-09-09  7:21 ` Jiri Olsa [this message]
2020-09-09  9:12 ` Tobias Klauser
2020-09-09 18:29   ` Alexei Starovoitov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200909072100.GB1498025@krava \
    --to=jolsa@redhat.com \
    --cc=acme@kernel.org \
    --cc=andrii.nakryiko@gmail.com \
    --cc=andriin@fb.com \
    --cc=ast@fb.com \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=kernel-team@fb.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox