Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lib: tst_has_slow_kconfig() cache the result
The result from the tst_has_slow_kconfig() is not going to change so we can cache the result as there are several places where the function may end up being called from. For instance any test that calls SAFE_CLONE() will call the function repeatedly. This change makes the tests slightly faster and also avoids repeated messages in the test output. For example before: tst_kconfig.c:88: TINFO: Parsing kernel config '/lib/modules/6.12.3/build/.config' tst_test.c:1722: TINFO: Overall timeout per run is 0h 00m 30s tst_kconfig.c:88: TINFO: Parsing kernel config '/lib/modules/6.12.3/build/.config' pidns05.c:34: TPASS: cpid == 1 (1) pidns05.c:35: TPASS: ppid == 0 (0) tst_kconfig.c:88: TINFO: Parsing kernel config '/lib/modules/6.12.3/build/.config' pidns05.c:34: TPASS: cpid == 1 (1) pidns05.c:35: TPASS: ppid == 0 (0) tst_kconfig.c:88: TINFO: Parsing kernel config '/lib/modules/6.12.3/build/.config' pidns05.c:34: TPASS: cpid == 1 (1) pidns05.c:35: TPASS: ppid == 0 (0) tst_kconfig.c:88: TINFO: Parsing kernel config '/lib/modules/6.12.3/build/.config' pidns05.c:34: TPASS: cpid == 1 (1) pidns05.c:35: TPASS: ppid == 0 (0) tst_kconfig.c:88: TINFO: Parsing kernel config '/lib/modules/6.12.3/build/.config' pidns05.c:34: TPASS: cpid == 1 (1) pidns05.c:35: TPASS: ppid == 0 (0) pidns05.c:94: TPASS: find_cinit_pids(pids) returned 5 pidns05.c:112: TPASS: No children left after sending SIGKILL to the first child And after: tst_kconfig.c:88: TINFO: Parsing kernel config '/lib/modules/6.12.3/build/.config' tst_test.c:1722: TINFO: Overall timeout per run is 0h 00m 30s pidns05.c:34: TPASS: cpid == 1 (1) pidns05.c:35: TPASS: ppid == 0 (0) pidns05.c:34: TPASS: cpid == 1 (1) pidns05.c:35: TPASS: ppid == 0 (0) pidns05.c:34: TPASS: cpid == 1 (1) pidns05.c:35: TPASS: ppid == 0 (0) pidns05.c:34: TPASS: cpid == 1 (1) pidns05.c:35: TPASS: ppid == 0 (0) pidns05.c:34: TPASS: cpid == 1 (1) pidns05.c:35: TPASS: ppid == 0 (0) pidns05.c:94: TPASS: find_cinit_pids(pids) returned 5 pidns05.c:112: TPASS: No children left after sending SIGKILL to the first child Signed-off-by: Cyril Hrubis <[email protected]> Reviewed-by: Li Wang <[email protected]> Reviewed-by: Petr Vorel <[email protected]>
- Loading branch information