diff options
author | Martin KaFai Lau <kafai@fb.com> | 2018-12-07 16:42:27 -0800 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2018-12-09 13:54:38 -0800 |
commit | 05687352c600930058ca4c68048302502e07a572 (patch) | |
tree | 5dd77a18a5410e2cd91a22f585b07187478fc10c /tools/lib/bpf/bpf_prog_linfo.c | |
parent | ee491d8dbe496c510fa06a786460638d78428147 (diff) | |
download | linux-05687352c600930058ca4c68048302502e07a572.tar.gz linux-05687352c600930058ca4c68048302502e07a572.tar.bz2 linux-05687352c600930058ca4c68048302502e07a572.zip |
bpf: Refactor and bug fix in test_func_type in test_btf.c
1) bpf_load_program_xattr() is absorbing the EBIG error
which makes testing this case impossible. It is replaced
with a direct syscall(__NR_bpf, BPF_PROG_LOAD,...).
2) The test_func_type() is renamed to test_info_raw() to
prepare for the new line_info test in the next patch.
3) The bpf_obj_get_info_by_fd() testing for func_info
is refactored to test_get_finfo(). A new
test_get_linfo() will be added in the next patch
for testing line_info purpose.
4) The test->func_info_cnt is checked instead of
a static value "2".
5) Remove unnecessary "\n" in error message.
6) Adding back info_raw_test_num to the cmd arg such
that a specific test case can be tested, like
all other existing tests.
7) Fix a bug in handling expected_prog_load_failure.
A test could pass even if prog_fd != -1 while
expected_prog_load_failure is true.
8) The min rec_size check should be < 8 instead of < 4.
Fixes: 4798c4ba3ba9 ("tools/bpf: extends test_btf to test load/retrieve func_type info")
Signed-off-by: Martin KaFai Lau <kafai@fb.com>
Acked-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/lib/bpf/bpf_prog_linfo.c')
0 files changed, 0 insertions, 0 deletions