On 9/20/21 7:43 PM, Andrii Nakryiko wrote: > Convert all SEC("classifier*") uses to strict SEC("classifier") with no > extra characters. In reference_tracking selftests also drop the usage of > broken bpf_program__load(). Along the way switch from ambiguous searching by > program title (section name) to non-ambiguous searching by name in some > selftests, getting closer to completely removing > bpf_object__find_program_by_title(). > > Signed-off-by: Andrii Nakryiko <andrii@xxxxxxxxxx> > --- Looks like you feel similarly about the SEC("version") comment from patch 1. > .../bpf/prog_tests/reference_tracking.c | 22 ++++--- > .../selftests/bpf/prog_tests/sk_assign.c | 2 +- > .../selftests/bpf/prog_tests/tailcalls.c | 58 +++++++++---------- > .../testing/selftests/bpf/progs/skb_pkt_end.c | 2 +- > tools/testing/selftests/bpf/progs/tailcall1.c | 5 +- > tools/testing/selftests/bpf/progs/tailcall2.c | 21 ++++--- > tools/testing/selftests/bpf/progs/tailcall3.c | 5 +- > tools/testing/selftests/bpf/progs/tailcall4.c | 5 +- > tools/testing/selftests/bpf/progs/tailcall5.c | 5 +- > tools/testing/selftests/bpf/progs/tailcall6.c | 4 +- > .../selftests/bpf/progs/tailcall_bpf2bpf1.c | 5 +- > .../selftests/bpf/progs/tailcall_bpf2bpf2.c | 5 +- > .../selftests/bpf/progs/tailcall_bpf2bpf3.c | 9 ++- > .../selftests/bpf/progs/tailcall_bpf2bpf4.c | 13 ++--- > .../bpf/progs/test_btf_skc_cls_ingress.c | 2 +- > .../selftests/bpf/progs/test_cls_redirect.c | 2 +- > .../selftests/bpf/progs/test_global_data.c | 2 +- > .../selftests/bpf/progs/test_global_func1.c | 2 +- > .../selftests/bpf/progs/test_global_func3.c | 2 +- > .../selftests/bpf/progs/test_global_func5.c | 2 +- > .../selftests/bpf/progs/test_global_func6.c | 2 +- > .../selftests/bpf/progs/test_global_func7.c | 2 +- > .../selftests/bpf/progs/test_pkt_access.c | 2 +- > .../selftests/bpf/progs/test_pkt_md_access.c | 4 +- > .../selftests/bpf/progs/test_sk_assign.c | 3 +- > .../selftests/bpf/progs/test_sk_lookup_kern.c | 37 ++++++------ > .../selftests/bpf/progs/test_skb_helpers.c | 2 +- > .../selftests/bpf/progs/test_sockmap_update.c | 2 +- > .../selftests/bpf/progs/test_tc_neigh.c | 6 +- > .../selftests/bpf/progs/test_tc_neigh_fib.c | 6 +- > .../selftests/bpf/progs/test_tc_peer.c | 10 ++-- > 31 files changed, 117 insertions(+), 132 deletions(-) > > diff --git a/tools/testing/selftests/bpf/prog_tests/reference_tracking.c b/tools/testing/selftests/bpf/prog_tests/reference_tracking.c > index ded2dc8ddd79..836b8bf17fff 100644 > --- a/tools/testing/selftests/bpf/prog_tests/reference_tracking.c > +++ b/tools/testing/selftests/bpf/prog_tests/reference_tracking.c > @@ -2,14 +2,14 @@ > #include <test_progs.h> > > static void toggle_object_autoload_progs(const struct bpf_object *obj, > - const char *title_load) > + const char *name_load) > { > struct bpf_program *prog; > > bpf_object__for_each_program(prog, obj) { > - const char *title = bpf_program__section_name(prog); > + const char *name = bpf_program__name(prog); > > - if (!strcmp(title_load, title)) > + if (!strcmp(name_load, name)) > bpf_program__set_autoload(prog, true); > else > bpf_program__set_autoload(prog, false); > @@ -39,23 +39,20 @@ void test_reference_tracking(void) > goto cleanup; > > bpf_object__for_each_program(prog, obj_iter) { > - const char *title; > + const char *name; > > /* Ignore .text sections */ I think this comment should go as well, no longer helps understand the test