diff options
| author | Thomas Zimmermann <[email protected]> | 2023-10-11 09:50:59 +0200 | 
|---|---|---|
| committer | Thomas Zimmermann <[email protected]> | 2023-10-11 09:50:59 +0200 | 
| commit | 57390019b68b83f96eb98f490367b9df1f2d77cb (patch) | |
| tree | e6d4b6c75efdd2d7fb7d37f980688c491be3ff6a /tools/testing/selftests/bpf/prog_tests/fentry_test.c | |
| parent | e5f9d543419c78ac58f3b3557bc5a76b20ff600b (diff) | |
| parent | 389af786f92ecdff35883551d54bf4e507ffcccb (diff) | |
Merge drm/drm-next into drm-misc-next
Updating drm-misc-next to the state of Linux v6.6-rc2.
Signed-off-by: Thomas Zimmermann <[email protected]>
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/fentry_test.c')
| -rw-r--r-- | tools/testing/selftests/bpf/prog_tests/fentry_test.c | 43 | 
1 files changed, 39 insertions, 4 deletions
diff --git a/tools/testing/selftests/bpf/prog_tests/fentry_test.c b/tools/testing/selftests/bpf/prog_tests/fentry_test.c index c0d1d61d5f66..aee1bc77a17f 100644 --- a/tools/testing/selftests/bpf/prog_tests/fentry_test.c +++ b/tools/testing/selftests/bpf/prog_tests/fentry_test.c @@ -2,8 +2,9 @@  /* Copyright (c) 2019 Facebook */  #include <test_progs.h>  #include "fentry_test.lskel.h" +#include "fentry_many_args.skel.h" -static int fentry_test(struct fentry_test_lskel *fentry_skel) +static int fentry_test_common(struct fentry_test_lskel *fentry_skel)  {  	int err, prog_fd, i;  	int link_fd; @@ -37,7 +38,7 @@ static int fentry_test(struct fentry_test_lskel *fentry_skel)  	return 0;  } -void test_fentry_test(void) +static void fentry_test(void)  {  	struct fentry_test_lskel *fentry_skel = NULL;  	int err; @@ -46,13 +47,47 @@ void test_fentry_test(void)  	if (!ASSERT_OK_PTR(fentry_skel, "fentry_skel_load"))  		goto cleanup; -	err = fentry_test(fentry_skel); +	err = fentry_test_common(fentry_skel);  	if (!ASSERT_OK(err, "fentry_first_attach"))  		goto cleanup; -	err = fentry_test(fentry_skel); +	err = fentry_test_common(fentry_skel);  	ASSERT_OK(err, "fentry_second_attach");  cleanup:  	fentry_test_lskel__destroy(fentry_skel);  } + +static void fentry_many_args(void) +{ +	struct fentry_many_args *fentry_skel = NULL; +	int err; + +	fentry_skel = fentry_many_args__open_and_load(); +	if (!ASSERT_OK_PTR(fentry_skel, "fentry_many_args_skel_load")) +		goto cleanup; + +	err = fentry_many_args__attach(fentry_skel); +	if (!ASSERT_OK(err, "fentry_many_args_attach")) +		goto cleanup; + +	ASSERT_OK(trigger_module_test_read(1), "trigger_read"); + +	ASSERT_EQ(fentry_skel->bss->test1_result, 1, +		  "fentry_many_args_result1"); +	ASSERT_EQ(fentry_skel->bss->test2_result, 1, +		  "fentry_many_args_result2"); +	ASSERT_EQ(fentry_skel->bss->test3_result, 1, +		  "fentry_many_args_result3"); + +cleanup: +	fentry_many_args__destroy(fentry_skel); +} + +void test_fentry_test(void) +{ +	if (test__start_subtest("fentry")) +		fentry_test(); +	if (test__start_subtest("fentry_many_args")) +		fentry_many_args(); +}  |