selftests/bpf: Make res_spin_lock test less verbose
Subsystems (3)
Kumar Kartikeya Dwivedi
maintainerPATCH 1/1 selftests/bpf: Make res_spin_lock test less verbose
Currently, the res_spin_lock test is too chatty as it constantly prints the test_run results for each iteration in each thread, so in case verbose output is requested or things go wrong, it will flood the logs of CI and other systems with repeated messages that offer no valuable insight. Reduce this by doing assertions when the condition actually flips, and proceed to break out and exit the threads. We still assert to mark the test as failed and print the expected and reported values.
--- tools/testing/selftests/bpf/prog_tests/res_spin_lock.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
tools/testing/selftests/bpf/prog_tests/res_spin_lock.c +5 -2
@@ -25,8 +25,11 @@ static void *spin_lock_thread(void *arg)while (!READ_ONCE (skip)) { err =bpf_prog_test_run_opts (prog_fd, &topts); -ASSERT_OK (err,"test_run" ); -ASSERT_OK (topts.retval,"test_run retval" ); +if (err || topts.retval) { +ASSERT_OK (err,"test_run" ); +ASSERT_OK (topts.retval,"test_run retval" ); +break ; + } }pthread_exit (arg); }
--
2.47.1
A message that is not in the archive (sent off-list or not yet received): e7ab8fdc788c43a552334e7322cf3ccf68c370372ce0291d6c5b762292e98333@mail.kernel.org
+ bpf
Quoted 28 lines · On Thu, Apr 3, 2025 at 4:31 PM <[email protected]> wrote:
Dear patch submitter,
CI has tested the following submission:
Status: FAILURE Name: [bpf-next,v1] selftests/bpf: Make res_spin_lock test less verbose Patchwork: https://patchwork.kernel.org/project/netdevbpf/list/?series=949804&state=* Matrix: https://github.com/kernel-patches/bpf/actions/runs/14254087541Failed jobs:
test_progs-aarch64-gcc: https://github.com/kernel-patches/bpf/actions/runs/14254087541/job/39953770223
test_progs_no_alu32-aarch64-gcc: https://github.com/kernel-patches/bpf/actions/runs/14254087541/job/39953770235First
test_progsfailure (test_progs-aarch64-gcc):
#345res_spin_lock_successtest_res_spin_lock_success:PASS:res_spin_lock__open_and_load 0 nsec test_res_spin_lock_success:PASS:error 0 nsec test_res_spin_lock_success:PASS:retval 0 nsec test_res_spin_lock_success:PASS:error 0 nsec test_res_spin_lock_success:PASS:retval 0 nsec test_res_spin_lock_success:PASS:pthread_create 0 nsec test_res_spin_lock_success:PASS:pthread_create 0 nsec test_res_spin_lock_success:PASS:pthread_create 0 nsec test_res_spin_lock_success:PASS:pthread_create 0 nsec test_res_spin_lock_success:PASS:pthread_create 0 nsec test_res_spin_lock_success:PASS:pthread_create 0 nsec test_res_spin_lock_success:PASS:pthread_create 0 nsec test_res_spin_lock_success:PASS:pthread_create 0 nsec
Quoted 9 lines
test_res_spin_lock_success:PASS:pthread_create 0 nsec test_res_spin_lock_success:PASS:pthread_create 0 nsec test_res_spin_lock_success:PASS:pthread_create 0 nsec test_res_spin_lock_success:PASS:pthread_create 0 nsec test_res_spin_lock_success:PASS:pthread_create 0 nsec test_res_spin_lock_success:PASS:pthread_create 0 nsec test_res_spin_lock_success:PASS:pthread_create 0 nsec test_res_spin_lock_success:PASS:pthread_create 0 nsec
This one is strange, according to the log everything is successful, but test_progs returned with an error. So some uninitialized variable or something? Can you please check, Kumar?
Quoted 4 lines
Please note: this email is coming from an unmonitored mailbox. If you have questions or feedback, please reach out to the Meta Kernel CI team at [email protected].