diff options
author | Eduard Zingerman <eddyz87@gmail.com> | 2023-03-25 03:54:42 +0100 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2023-03-26 01:02:02 +0100 |
commit | 3e5329e193f463e6aaf98c33f7cb1308160880ab (patch) | |
tree | 575ac69bdf06d6d4c205fef5ca0fe044bf138094 /tools/testing/selftests/bpf/test_loader.c | |
parent | Merge branch 'Don't invoke KPTR_REF destructor on NULL xchg' (diff) | |
download | linux-3e5329e193f463e6aaf98c33f7cb1308160880ab.tar.xz linux-3e5329e193f463e6aaf98c33f7cb1308160880ab.zip |
selftests/bpf: Report program name on parse_test_spec error
Change test_loader.c:run_subtest() behavior to show BPF program name
when test spec for that program can't be parsed.
Signed-off-by: Eduard Zingerman <eddyz87@gmail.com>
Link: https://lore.kernel.org/r/20230325025524.144043-2-eddyz87@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/testing/selftests/bpf/test_loader.c')
-rw-r--r-- | tools/testing/selftests/bpf/test_loader.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/testing/selftests/bpf/test_loader.c b/tools/testing/selftests/bpf/test_loader.c index bf41390157bf..8ca5121b5329 100644 --- a/tools/testing/selftests/bpf/test_loader.c +++ b/tools/testing/selftests/bpf/test_loader.c @@ -232,8 +232,11 @@ void run_subtest(struct test_loader *tester, /* if we can't derive test specification, go to the next test */ err = parse_test_spec(tester, obj, prog, &spec); - if (!ASSERT_OK(err, "parse_test_spec")) + if (err) { + PRINT_FAIL("Can't parse test spec for program '%s'\n", + bpf_program__name(prog)); continue; + } tobj = bpf_object__open_mem(obj_bytes, obj_byte_cnt, &open_opts); if (!ASSERT_OK_PTR(tobj, "obj_open_mem")) /* shouldn't happen */ |