From: Menglong Dong <imagedong@xxxxxxxxxxx>
Add test9/test10 in fexit_test.c and fentry_test.c to test the fentry
and fexit whose target function have 7/11 arguments.
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:
./test_progs -t fexit
Summary: 5/12 PASSED, 0 SKIPPED, 0 FAILED
./test_progs -t fentry
Summary: 3/0 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@xxxxxxxxxxx>
Acked-by: Yonghong Song <yhs@xxxxxx>
---
v6:
- add testcases to tracing_struct.c instead of fentry_test.c and
fexit_test.c
v5:
- add testcases for MODIFY_RETURN
v4:
- use different type for args in bpf_testmod_fentry_test{7,12}
- add testcase for grabage values in ctx
v3:
- move bpf_fentry_test{7,12} to bpf_testmod.c and rename them to
bpf_testmod_fentry_test{7,12} meanwhile
- get return value by bpf_get_func_ret() in
"fexit/bpf_testmod_fentry_test12", as we don't change ___bpf_ctx_cast()
in this version
---
net/bpf/test_run.c | 23 ++++++--
.../selftests/bpf/bpf_testmod/bpf_testmod.c | 49 ++++++++++++++++-
.../selftests/bpf/prog_tests/fentry_fexit.c | 4 +-
.../selftests/bpf/prog_tests/fentry_test.c | 2 +
.../selftests/bpf/prog_tests/fexit_test.c | 2 +
.../selftests/bpf/prog_tests/modify_return.c | 20 ++++++-
.../selftests/bpf/prog_tests/tracing_struct.c | 19 +++++++
.../testing/selftests/bpf/progs/fentry_test.c | 32 +++++++++++
.../testing/selftests/bpf/progs/fexit_test.c | 33 ++++++++++++
.../selftests/bpf/progs/modify_return.c | 40 ++++++++++++++
.../selftests/bpf/progs/tracing_struct.c | 54 +++++++++++++++++++
11 files changed, 271 insertions(+), 7 deletions(-)