diff options
| author | Wake Liu <wakel@google.com> | 2026-05-26 01:06:34 +0000 |
|---|---|---|
| committer | Thomas Gleixner <tglx@kernel.org> | 2026-07-05 21:49:17 +0200 |
| commit | e531301dd8fa23f1edeee9c8af62310a4e1424c5 (patch) | |
| tree | 0a244957adc7512c12306b2126eed08ece2a72ae /tools/perf/scripts/python | |
| parent | dfa2f2378fb18c1917e097d710b55ae16442c3e3 (diff) | |
selftests/futex: Migrate functional tests to harness
Currently, multiple futex functional tests (wait_timeout, waitv,
wait_wouldblock) mix low-level ksft_* logging and result APIs with the
kselftest_harness.h framework. On older kernels where system calls like
futex_waitv are missing (returning -ENOSYS), this mixed usage triggers
framework inconsistencies, causing the test to fail with: "Illegal usage of
low-level ksft APIs in harness test".
Address this by completely refactoring these tests to exclusively use
the high-level kselftest_harness.h framework (gtest-like API), mapping
all low-level calls to native harness macros:
- Non-fatal assertions: Replace ksft_test_result_fail() with EXPECT_EQ()
and EXPECT_NE().
- Fatal assertions: Replace ksft_exit_fail_msg() with ASSERT_EQ() and
ASSERT_TRUE() to immediately terminate execution upon setup failure.
- Test skipping: Replace ksft_exit_skip() with the graceful SKIP() macro
combined with early runtime availability checks for sys_futex_waitv.
- Debug logging: Replace ksft_print_dbg_msg() with TH_LOG() to inherit
automatic file/line context.
- Success reporting: Remove explicit ksft_test_result_pass() calls,
deferring to automated harness completion reporting.
Additionally:
- Fix a critical SIGSEGV crash in early syscall probing logic caused by
passing a NULL pointer to inline user-space timespec conversions.
- Introduce TEST_TIMEOUT() and GET_ABS_TIMEOUT() macros in wait_timeout
to encapsulate assertions while preserving source line attribution.
- Pass test metadata (_metadata) into secondary threads to allow native
harness assertions during concurrent execution.
[ tglx: Fixup coding style ]
Signed-off-by: Wake Liu <wakel@google.com>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Link: https://patch.msgid.link/20260526010635.23980-2-wakel@google.com
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions
