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

Merge tag 'linux_kselftest-fixes-6.9-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest

Pull kselftest fixes from Shuah Khan:
"A fix to kselftest harness to prevent infinite loop triggered in an
assert in FIXTURE_TEARDOWN and a fix to a problem seen in being able
to stop subsystem-enable tests when sched events are being traced"

* tag 'linux_kselftest-fixes-6.9-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest:
selftests/harness: Prevent infinite loop due to Assert in FIXTURE_TEARDOWN
selftests/ftrace: Limit length in subsystem-enable tests

+7 -4
+3 -3
tools/testing/selftests/ftrace/test.d/event/subsystem-enable.tc
··· 18 18 19 19 yield 20 20 21 - count=`cat trace | grep -v ^# | awk '{ print $5 }' | sort -u | wc -l` 21 + count=`head -n 100 trace | grep -v ^# | awk '{ print $5 }' | sort -u | wc -l` 22 22 if [ $count -lt 3 ]; then 23 23 fail "at least fork, exec and exit events should be recorded" 24 24 fi ··· 29 29 30 30 yield 31 31 32 - count=`cat trace | grep -v ^# | awk '{ print $5 }' | sort -u | wc -l` 32 + count=`head -n 100 trace | grep -v ^# | awk '{ print $5 }' | sort -u | wc -l` 33 33 if [ $count -lt 3 ]; then 34 34 fail "at least fork, exec and exit events should be recorded" 35 35 fi ··· 40 40 41 41 yield 42 42 43 - count=`cat trace | grep -v ^# | awk '{ print $5 }' | sort -u | wc -l` 43 + count=`head -n 100 trace | grep -v ^# | awk '{ print $5 }' | sort -u | wc -l` 44 44 if [ $count -ne 0 ]; then 45 45 fail "any of scheduler events should not be recorded" 46 46 fi
+4 -1
tools/testing/selftests/kselftest_harness.h
··· 383 383 FIXTURE_DATA(fixture_name) self; \ 384 384 pid_t child = 1; \ 385 385 int status = 0; \ 386 + bool jmp = false; \ 386 387 memset(&self, 0, sizeof(FIXTURE_DATA(fixture_name))); \ 387 388 if (setjmp(_metadata->env) == 0) { \ 388 389 /* Use the same _metadata. */ \ ··· 400 399 _metadata->exit_code = KSFT_FAIL; \ 401 400 } \ 402 401 } \ 402 + else \ 403 + jmp = true; \ 403 404 if (child == 0) { \ 404 - if (_metadata->setup_completed && !_metadata->teardown_parent) \ 405 + if (_metadata->setup_completed && !_metadata->teardown_parent && !jmp) \ 405 406 fixture_name##_teardown(_metadata, &self, variant->data); \ 406 407 _exit(0); \ 407 408 } \