[LTP] [PATCH] clock_gettime03: Extend tolerance on slow kernel configs
Wake Liu
wakel@google.com
Fri Jul 31 09:15:45 CEST 2026
Debugging/instrumentation kernel configs (like KASAN, LOCKDEP, etc.)
can significantly degrade performance, causing the time namespace
offset checks to exceed the default 10ms tolerance.
Use tst_has_slow_kconfig() to detect these slow configurations and
multiply the delta tolerance by 10, preventing false test failures
on slow/debug kernels.
Signed-off-by: Wake Liu <wakel@google.com>
---
testcases/kernel/syscalls/clock_gettime/clock_gettime03.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/testcases/kernel/syscalls/clock_gettime/clock_gettime03.c b/testcases/kernel/syscalls/clock_gettime/clock_gettime03.c
index 495030c07e..665a1107b8 100644
--- a/testcases/kernel/syscalls/clock_gettime/clock_gettime03.c
+++ b/testcases/kernel/syscalls/clock_gettime/clock_gettime03.c
@@ -16,6 +16,7 @@
#include "time64_variants.h"
#include "tst_safe_clocks.h"
#include "tst_timer.h"
+#include "tst_kconfig.h"
#include "lapi/sched.h"
static struct tcase {
@@ -117,6 +118,11 @@ static void setup(void)
delta *= 10;
}
+ if (tst_has_slow_kconfig()) {
+ tst_res(TINFO, "Slow kernel config detected, multiply the delta by 10.");
+ delta *= 10;
+ }
+
now.type = then.type = parent_then.type = tv->ts_type;
tst_res(TINFO, "Testing variant: %s", variants[tst_variant].desc);
parent_ns = SAFE_OPEN("/proc/self/ns/time_for_children", O_RDONLY);
--
2.55.0.508.g3f0d502094-goog
More information about the ltp
mailing list