summaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/bpf/prog_tests/dummy_st_ops.c
AgeCommit message (Collapse)AuthorFilesLines
2022-03-30bpf: selftests: Test fentry tracing a struct_ops programMartin KaFai Lau1-0/+23
This patch tests attaching an fentry prog to a struct_ops prog. Signed-off-by: Martin KaFai Lau <kafai@fb.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Acked-by: Yonghong Song <yhs@fb.com> Link: https://lore.kernel.org/bpf/20220330011502.2985292-1-kafai@fb.com
2022-02-02selftests/bpf: Migrate from bpf_prog_test_run_xattrDelyan Kratunov1-15/+12
bpf_prog_test_run_xattr is being deprecated in favor of the OPTS-based bpf_prog_test_run_opts. We end up unable to use CHECK_ATTR so replace usages with ASSERT_* calls. Also, prog_run_xattr is now prog_run_opts. Signed-off-by: Delyan Kratunov <delyank@fb.com> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Link: https://lore.kernel.org/bpf/20220202235423.1097270-3-delyank@fb.com
2021-11-01selftests/bpf: Add test cases for struct_ops progHou Tao1-0/+115
Running a BPF_PROG_TYPE_STRUCT_OPS prog for dummy_st_ops::test_N() through bpf_prog_test_run(). Four test cases are added: (1) attach dummy_st_ops should fail (2) function return value of bpf_dummy_ops::test_1() is expected (3) pointer argument of bpf_dummy_ops::test_1() works as expected (4) multiple arguments passed to bpf_dummy_ops::test_2() are correct Signed-off-by: Hou Tao <houtao1@huawei.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Acked-by: Martin KaFai Lau <kafai@fb.com> Link: https://lore.kernel.org/bpf/20211025064025.2567443-5-houtao1@huawei.com