Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selftest: pidfd: Omit long and repeating outputs

An output message:

> # # waitpid WEXITSTATUS=0

will be printed for 30,000+ times in the `pidfd_test` selftest, which
does not seem ideal. This patch removes the print logic in the
`wait_for_pid` function, so each call to this function does not output
a line by default. Any existing call sites where the extra line might
be beneficial have been modified to include extra print statements
outside of the function calls.

Signed-off-by: Ziqi Zhao <astrajoan@yahoo.com>
Reviewed-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>

authored by

Ziqi Zhao and committed by
Shuah Khan
bcda4c86 f6a01213

+3 -2
-1
tools/testing/selftests/pidfd/pidfd.h
··· 90 90 } 91 91 92 92 ret = WEXITSTATUS(status); 93 - ksft_print_msg("waitpid WEXITSTATUS=%d\n", ret); 94 93 return ret; 95 94 } 96 95
+1
tools/testing/selftests/pidfd/pidfd_fdinfo_test.c
··· 143 143 r = -1; 144 144 } 145 145 146 + ksft_print_msg("waitpid WEXITSTATUS=%d\n", r); 146 147 return r; 147 148 } 148 149
+2 -1
tools/testing/selftests/pidfd/pidfd_test.c
··· 115 115 116 116 pidfd = open(buf, O_DIRECTORY | O_CLOEXEC); 117 117 118 - (void)wait_for_pid(pid); 118 + ret = wait_for_pid(pid); 119 + ksft_print_msg("waitpid WEXITSTATUS=%d\n", ret); 119 120 120 121 if (pidfd < 0) 121 122 ksft_exit_fail_msg(