Commit 8081ede1 authored by Andrii Nakryiko's avatar Andrii Nakryiko Committed by Alexei Starovoitov

perf: Stop using deprecated bpf_program__title()

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: 52109584 ("libbpf: Deprecate notion of BPF program "title" in favor of "section name"")
Signed-off-by: default avatarAndrii Nakryiko <andriin@fb.com>
Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
Reviewed-by: default avatarTobias Klauser <tklauser@distanz.ch>
Acked-by: default avatarJiri Olsa <jolsa@redhat.com>
Link: https://lore.kernel.org/bpf/20200908180127.1249-1-andriin@fb.com
parent 7fb5eefd
...@@ -328,12 +328,6 @@ config_bpf_program(struct bpf_program *prog) ...@@ -328,12 +328,6 @@ config_bpf_program(struct bpf_program *prog)
probe_conf.no_inlines = false; probe_conf.no_inlines = false;
probe_conf.force_add = 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); priv = calloc(sizeof(*priv), 1);
if (!priv) { if (!priv) {
pr_debug("bpf: failed to alloc priv\n"); pr_debug("bpf: failed to alloc priv\n");
...@@ -341,6 +335,7 @@ config_bpf_program(struct bpf_program *prog) ...@@ -341,6 +335,7 @@ config_bpf_program(struct bpf_program *prog)
} }
pev = &priv->pev; pev = &priv->pev;
config_str = bpf_program__section_name(prog);
pr_debug("bpf: config program '%s'\n", config_str); pr_debug("bpf: config program '%s'\n", config_str);
err = parse_prog_config(config_str, &main_str, &is_tp, pev); err = parse_prog_config(config_str, &main_str, &is_tp, pev);
if (err) if (err)
...@@ -454,10 +449,7 @@ preproc_gen_prologue(struct bpf_program *prog, int n, ...@@ -454,10 +449,7 @@ preproc_gen_prologue(struct bpf_program *prog, int n,
if (err) { if (err) {
const char *title; const char *title;
title = bpf_program__title(prog, false); title = bpf_program__section_name(prog);
if (!title)
title = "[unknown]";
pr_debug("Failed to generate prologue for program %s\n", pr_debug("Failed to generate prologue for program %s\n",
title); title);
return err; return err;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment