diff options
author | Andrii Nakryiko <andriin@fb.com> | 2020-09-03 13:35:37 -0700 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2020-09-03 17:14:40 -0700 |
commit | a7659cc30bc9210d885692d175f4bc6f3a9a2175 (patch) | |
tree | 664dfb5ebfa1ae5faf58e61bca6050f99d2e40c8 /tools/testing/selftests/bpf/flow_dissector_load.h | |
parent | fd17e272be9c50190f1185a1007d72dc1eedb903 (diff) | |
download | lwn-a7659cc30bc9210d885692d175f4bc6f3a9a2175.tar.gz lwn-a7659cc30bc9210d885692d175f4bc6f3a9a2175.zip |
selftests/bpf: Don't use deprecated libbpf APIs
Remove all uses of bpf_program__title() and
bpf_program__find_program_by_title().
Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20200903203542.15944-10-andriin@fb.com
Diffstat (limited to 'tools/testing/selftests/bpf/flow_dissector_load.h')
-rw-r--r-- | tools/testing/selftests/bpf/flow_dissector_load.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/testing/selftests/bpf/flow_dissector_load.h b/tools/testing/selftests/bpf/flow_dissector_load.h index daeaeb518894..7290401ec172 100644 --- a/tools/testing/selftests/bpf/flow_dissector_load.h +++ b/tools/testing/selftests/bpf/flow_dissector_load.h @@ -23,7 +23,13 @@ static inline int bpf_flow_load(struct bpf_object **obj, if (ret) return ret; - main_prog = bpf_object__find_program_by_title(*obj, section_name); + main_prog = NULL; + bpf_object__for_each_program(prog, *obj) { + if (strcmp(section_name, bpf_program__section_name(prog)) == 0) { + main_prog = prog; + break; + } + } if (!main_prog) return -1; |