diff mbox series

[bpf-next] selftests/bpf: Add test result messages for test_task_storage_map_stress_lookup

Message ID 20220919035714.2195144-1-houtao@huaweicloud.com (mailing list archive)
State Accepted
Commit fe8152a0f9644ff658b14cba0d9012af99b793a8
Delegated to: BPF
Headers show
Series [bpf-next] selftests/bpf: Add test result messages for test_task_storage_map_stress_lookup | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for bpf-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix success Link
netdev/cover_letter success Single patches do not need cover letters
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers warning 5 maintainers not CCed: shuah@kernel.org linux-kselftest@vger.kernel.org song@kernel.org martin.lau@linux.dev mykolal@fb.com
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 31 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
bpf/vmtest-bpf-next-VM_Test-4 success Logs for llvm-toolchain
bpf/vmtest-bpf-next-VM_Test-5 success Logs for set-matrix
bpf/vmtest-bpf-next-VM_Test-2 success Logs for build for x86_64 with gcc
bpf/vmtest-bpf-next-VM_Test-3 success Logs for build for x86_64 with llvm-16
bpf/vmtest-bpf-next-VM_Test-1 success Logs for build for s390x with gcc
bpf/vmtest-bpf-next-VM_Test-15 success Logs for test_verifier on s390x with gcc
bpf/vmtest-bpf-next-VM_Test-16 success Logs for test_verifier on x86_64 with gcc
bpf/vmtest-bpf-next-VM_Test-17 success Logs for test_verifier on x86_64 with llvm-16
bpf/vmtest-bpf-next-VM_Test-9 success Logs for test_progs on s390x with gcc
bpf/vmtest-bpf-next-VM_Test-12 success Logs for test_progs_no_alu32 on s390x with gcc
bpf/vmtest-bpf-next-VM_Test-13 success Logs for test_progs_no_alu32 on x86_64 with gcc
bpf/vmtest-bpf-next-VM_Test-14 success Logs for test_progs_no_alu32 on x86_64 with llvm-16
bpf/vmtest-bpf-next-VM_Test-6 success Logs for test_maps on s390x with gcc
bpf/vmtest-bpf-next-VM_Test-10 success Logs for test_progs on x86_64 with gcc
bpf/vmtest-bpf-next-VM_Test-11 success Logs for test_progs on x86_64 with llvm-16
bpf/vmtest-bpf-next-VM_Test-7 success Logs for test_maps on x86_64 with gcc
bpf/vmtest-bpf-next-VM_Test-8 success Logs for test_maps on x86_64 with llvm-16
bpf/vmtest-bpf-next-PR success PR summary

Commit Message

Hou Tao Sept. 19, 2022, 3:57 a.m. UTC
From: Hou Tao <houtao1@huawei.com>

Add test result message when test_task_storage_map_stress_lookup()
succeeds or is skipped. The test case can be skipped due to the choose
of preemption model in kernel config, so export skips in test_maps.c and
increase it when needed.

The following is the output of test_maps when the test case succeeds or
is skipped:

  test_task_storage_map_stress_lookup:PASS
  test_maps: OK, 0 SKIPPED

  test_task_storage_map_stress_lookup SKIP (no CONFIG_PREEMPT)
  test_maps: OK, 1 SKIPPED

Signed-off-by: Hou Tao <houtao1@huawei.com>
---
 tools/testing/selftests/bpf/map_tests/task_storage_map.c | 6 +++++-
 tools/testing/selftests/bpf/test_maps.c                  | 2 +-
 tools/testing/selftests/bpf/test_maps.h                  | 2 ++
 3 files changed, 8 insertions(+), 2 deletions(-)

Comments

patchwork-bot+netdevbpf@kernel.org Sept. 19, 2022, 6:20 p.m. UTC | #1
Hello:

This patch was applied to bpf/bpf-next.git (master)
by Martin KaFai Lau <martin.lau@kernel.org>:

On Mon, 19 Sep 2022 11:57:14 +0800 you wrote:
> From: Hou Tao <houtao1@huawei.com>
> 
> Add test result message when test_task_storage_map_stress_lookup()
> succeeds or is skipped. The test case can be skipped due to the choose
> of preemption model in kernel config, so export skips in test_maps.c and
> increase it when needed.
> 
> [...]

Here is the summary with links:
  - [bpf-next] selftests/bpf: Add test result messages for test_task_storage_map_stress_lookup
    https://git.kernel.org/bpf/bpf-next/c/fe8152a0f964

You are awesome, thank you!
Martin KaFai Lau Sept. 19, 2022, 6:25 p.m. UTC | #2
On 9/18/22 8:57 PM, Hou Tao wrote:
> From: Hou Tao <houtao1@huawei.com>
> 
> Add test result message when test_task_storage_map_stress_lookup()
> succeeds or is skipped. The test case can be skipped due to the choose
> of preemption model in kernel config, so export skips in test_maps.c and
> increase it when needed.
> 
> The following is the output of test_maps when the test case succeeds or
> is skipped:
> 
>    test_task_storage_map_stress_lookup:PASS
>    test_maps: OK, 0 SKIPPED
> 
>    test_task_storage_map_stress_lookup SKIP (no CONFIG_PREEMPT)
>    test_maps: OK, 1 SKIPPED
> 
> Signed-off-by: Hou Tao <houtao1@huawei.com>

Applied with a Fixes tag,
Fixes: 73b97bc78b32 ("selftests/bpf: ......

Please remember to add it next time for fixes.

Also, ...


> ---
>   tools/testing/selftests/bpf/map_tests/task_storage_map.c | 6 +++++-
>   tools/testing/selftests/bpf/test_maps.c                  | 2 +-
>   tools/testing/selftests/bpf/test_maps.h                  | 2 ++
>   3 files changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/testing/selftests/bpf/map_tests/task_storage_map.c b/tools/testing/selftests/bpf/map_tests/task_storage_map.c
> index 1adc9c292eb2..aac08c85240b 100644
> --- a/tools/testing/selftests/bpf/map_tests/task_storage_map.c
> +++ b/tools/testing/selftests/bpf/map_tests/task_storage_map.c
> @@ -77,8 +77,11 @@ void test_task_storage_map_stress_lookup(void)
>   	CHECK(err, "open_and_load", "error %d\n", err);
>   
>   	/* Only for a fully preemptible kernel */
> -	if (!skel->kconfig->CONFIG_PREEMPT)
> +	if (!skel->kconfig->CONFIG_PREEMPT) {
> +		printf("%s SKIP (no CONFIG_PREEMPT)\n", __func__);
> +		skips++;

I noticed it is missing a read_bpf_task_storage_busy__destroy() here. 
Please fix.
Hou Tao Sept. 20, 2022, 1:12 a.m. UTC | #3
Hi,

On 9/20/2022 2:25 AM, Martin KaFai Lau wrote:
> On 9/18/22 8:57 PM, Hou Tao wrote:
>> From: Hou Tao <houtao1@huawei.com>
>>
>> Add test result message when test_task_storage_map_stress_lookup()
>> succeeds or is skipped. The test case can be skipped due to the choose
>> of preemption model in kernel config, so export skips in test_maps.c and
>> increase it when needed.
>>
>> The following is the output of test_maps when the test case succeeds or
>> is skipped:
>>
>>    test_task_storage_map_stress_lookup:PASS
>>    test_maps: OK, 0 SKIPPED
>>
>>    test_task_storage_map_stress_lookup SKIP (no CONFIG_PREEMPT)
>>    test_maps: OK, 1 SKIPPED
>>
>> Signed-off-by: Hou Tao <houtao1@huawei.com>
>
> Applied with a Fixes tag,
> Fixes: 73b97bc78b32 ("selftests/bpf: ......
>
> Please remember to add it next time for fixes.
>
> Also, ...
>
>
>> ---
>>   tools/testing/selftests/bpf/map_tests/task_storage_map.c | 6 +++++-
>>   tools/testing/selftests/bpf/test_maps.c                  | 2 +-
>>   tools/testing/selftests/bpf/test_maps.h                  | 2 ++
>>   3 files changed, 8 insertions(+), 2 deletions(-)
>>
>> diff --git a/tools/testing/selftests/bpf/map_tests/task_storage_map.c
>> b/tools/testing/selftests/bpf/map_tests/task_storage_map.c
>> index 1adc9c292eb2..aac08c85240b 100644
>> --- a/tools/testing/selftests/bpf/map_tests/task_storage_map.c
>> +++ b/tools/testing/selftests/bpf/map_tests/task_storage_map.c
>> @@ -77,8 +77,11 @@ void test_task_storage_map_stress_lookup(void)
>>       CHECK(err, "open_and_load", "error %d\n", err);
>>         /* Only for a fully preemptible kernel */
>> -    if (!skel->kconfig->CONFIG_PREEMPT)
>> +    if (!skel->kconfig->CONFIG_PREEMPT) {
>> +        printf("%s SKIP (no CONFIG_PREEMPT)\n", __func__);
>> +        skips++;
>
> I noticed it is missing a read_bpf_task_storage_busy__destroy() here. Please fix.
Oops. Sorry for missing that. Will send a v2.
>
> .
diff mbox series

Patch

diff --git a/tools/testing/selftests/bpf/map_tests/task_storage_map.c b/tools/testing/selftests/bpf/map_tests/task_storage_map.c
index 1adc9c292eb2..aac08c85240b 100644
--- a/tools/testing/selftests/bpf/map_tests/task_storage_map.c
+++ b/tools/testing/selftests/bpf/map_tests/task_storage_map.c
@@ -77,8 +77,11 @@  void test_task_storage_map_stress_lookup(void)
 	CHECK(err, "open_and_load", "error %d\n", err);
 
 	/* Only for a fully preemptible kernel */
-	if (!skel->kconfig->CONFIG_PREEMPT)
+	if (!skel->kconfig->CONFIG_PREEMPT) {
+		printf("%s SKIP (no CONFIG_PREEMPT)\n", __func__);
+		skips++;
 		return;
+	}
 
 	/* Save the old affinity setting */
 	sched_getaffinity(getpid(), sizeof(old), &old);
@@ -119,4 +122,5 @@  void test_task_storage_map_stress_lookup(void)
 	read_bpf_task_storage_busy__destroy(skel);
 	/* Restore affinity setting */
 	sched_setaffinity(getpid(), sizeof(old), &old);
+	printf("%s:PASS\n", __func__);
 }
diff --git a/tools/testing/selftests/bpf/test_maps.c b/tools/testing/selftests/bpf/test_maps.c
index 1581a33b3f70..127c5c438a16 100644
--- a/tools/testing/selftests/bpf/test_maps.c
+++ b/tools/testing/selftests/bpf/test_maps.c
@@ -30,7 +30,7 @@ 
 #define ENOTSUPP 524
 #endif
 
-static int skips;
+int skips;
 
 static struct bpf_map_create_opts map_opts = { .sz = sizeof(map_opts) };
 
diff --git a/tools/testing/selftests/bpf/test_maps.h b/tools/testing/selftests/bpf/test_maps.h
index 77d8587ac4ed..f6fbca761732 100644
--- a/tools/testing/selftests/bpf/test_maps.h
+++ b/tools/testing/selftests/bpf/test_maps.h
@@ -14,4 +14,6 @@ 
 	}								\
 })
 
+extern int skips;
+
 #endif