selftests/bpf: add testcase for TRACING with 6+ arguments
authorMenglong Dong <imagedong@tencent.com>
Thu, 13 Jul 2023 04:07:38 +0000 (12:07 +0800)
committerAlexei Starovoitov <ast@kernel.org>
Thu, 13 Jul 2023 23:04:56 +0000 (16:04 -0700)
commit5e9cf77d81f9ba51019157dc55a3b73dc89a7cf4
tree09c88c8019209719b63cc0b7fa916e2235a276bd
parent473e3150e30a2db4199e6bad68c0be11279d1c34
selftests/bpf: add testcase for TRACING with 6+ arguments

Add fentry_many_args.c and fexit_many_args.c to test the fentry/fexit
with 7/11 arguments. As this feature is not supported by arm64 yet, we
disable these testcases for arm64 in DENYLIST.aarch64. We can combine
them with fentry_test.c/fexit_test.c when arm64 is supported too.

Correspondingly, add bpf_testmod_fentry_test7() and
bpf_testmod_fentry_test11() to bpf_testmod.c

Meanwhile, add bpf_modify_return_test2() to test_run.c to test the
MODIFY_RETURN with 7 arguments.

Add bpf_testmod_test_struct_arg_7/bpf_testmod_test_struct_arg_7 in
bpf_testmod.c to test the struct in the arguments.

And the testcases passed on x86_64:

./test_progs -t fexit
Summary: 5/14 PASSED, 0 SKIPPED, 0 FAILED

./test_progs -t fentry
Summary: 3/2 PASSED, 0 SKIPPED, 0 FAILED

./test_progs -t modify_return
Summary: 1/0 PASSED, 0 SKIPPED, 0 FAILED

./test_progs -t tracing_struct
Summary: 1/0 PASSED, 0 SKIPPED, 0 FAILED

Signed-off-by: Menglong Dong <imagedong@tencent.com>
Acked-by: Yonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/r/20230713040738.1789742-4-imagedong@tencent.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
13 files changed:
net/bpf/test_run.c
tools/testing/selftests/bpf/DENYLIST.aarch64
tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.c
tools/testing/selftests/bpf/prog_tests/fentry_test.c
tools/testing/selftests/bpf/prog_tests/fexit_test.c
tools/testing/selftests/bpf/prog_tests/get_func_args_test.c
tools/testing/selftests/bpf/prog_tests/modify_return.c
tools/testing/selftests/bpf/prog_tests/tracing_struct.c
tools/testing/selftests/bpf/prog_tests/trampoline_count.c
tools/testing/selftests/bpf/progs/fentry_many_args.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/fexit_many_args.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/modify_return.c
tools/testing/selftests/bpf/progs/tracing_struct.c