lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 9 Sep 2020 09:21:00 +0200
From:   Jiri Olsa <jolsa@...hat.com>
To:     Andrii Nakryiko <andriin@...com>
Cc:     bpf@...r.kernel.org, netdev@...r.kernel.org, ast@...com,
        daniel@...earbox.net, acme@...nel.org, andrii.nakryiko@...il.com,
        kernel-team@...com
Subject: Re: [PATCH bpf-next] perf: stop using deprecated bpf_program__title()

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@...com>

Acked-by: Jiri Olsa <jolsa@...hat.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
> 

Powered by blists - more mailing lists