Skip to content

Commit 8081ede

Browse files
anakryikoAlexei Starovoitov
authored and
Alexei Starovoitov
committed
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: 5210958 ("libbpf: Deprecate notion of BPF program "title" in favor of "section name"") Signed-off-by: Andrii Nakryiko <[email protected]> Signed-off-by: Alexei Starovoitov <[email protected]> Reviewed-by: Tobias Klauser <[email protected]> Acked-by: Jiri Olsa <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
1 parent 7fb5eef commit 8081ede

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

tools/perf/util/bpf-loader.c

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -328,19 +328,14 @@ config_bpf_program(struct bpf_program *prog)
328328
probe_conf.no_inlines = false;
329329
probe_conf.force_add = false;
330330

331-
config_str = bpf_program__title(prog, false);
332-
if (IS_ERR(config_str)) {
333-
pr_debug("bpf: unable to get title for program\n");
334-
return PTR_ERR(config_str);
335-
}
336-
337331
priv = calloc(sizeof(*priv), 1);
338332
if (!priv) {
339333
pr_debug("bpf: failed to alloc priv\n");
340334
return -ENOMEM;
341335
}
342336
pev = &priv->pev;
343337

338+
config_str = bpf_program__section_name(prog);
344339
pr_debug("bpf: config program '%s'\n", config_str);
345340
err = parse_prog_config(config_str, &main_str, &is_tp, pev);
346341
if (err)
@@ -454,10 +449,7 @@ preproc_gen_prologue(struct bpf_program *prog, int n,
454449
if (err) {
455450
const char *title;
456451

457-
title = bpf_program__title(prog, false);
458-
if (!title)
459-
title = "[unknown]";
460-
452+
title = bpf_program__section_name(prog);
461453
pr_debug("Failed to generate prologue for program %s\n",
462454
title);
463455
return err;

0 commit comments

Comments
 (0)