[libevl][PATCH 1/2] tests: sched-quota-accuracy: Augment workload with busy-spinning

Jan Kiszka <[email protected]> Sun, 14 Jun 2026 21:36:56 +0200
Newsgroups dev.linux.lists.xenomai
Message-ID <[email protected]>
From: Jan Kiszka <[email protected]>

This increases calibration accuracy, specifically over virtual
environments.

Signed-off-by: Jan Kiszka <[email protected]>
---
 tests/sched-quota-accuracy.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/tests/sched-quota-accuracy.c b/tests/sched-quota-accuracy.c
index 9ca496d..278ff1b 100644
--- a/tests/sched-quota-accuracy.c
+++ b/tests/sched-quota-accuracy.c
@@ -94,6 +94,13 @@ static const struct option options[] = {
 static unsigned long __attribute__(( noinline ))
 __do_work(unsigned long count)
 {
+	struct timespec now, to;
+	int ret;
+
+	__Tcall_assert(ret, evl_read_clock(EVL_CLOCK_MONOTONIC, &now));
+	timespec_add_ns(&to, &now, 100);
+	while (timespec_sub_ns(&to, &now) > 0)
+		__Tcall_assert(ret, evl_read_clock(EVL_CLOCK_MONOTONIC, &now));
 	return count + 1;
 }
 
-- 
2.47.3