diff options
| author | Eva Kurchatova <eva.kurchatova@virtuozzo.com> | 2026-09-17 04:52:32 +0300 |
|---|---|---|
| committer | Thomas Gleixner <tglx@kernel.org> | 2026-09-29 22:03:31 +0200 |
| commit | b03638013add0609d35aaa8291548dea92cb9484 (patch) | |
| tree | 1e4dac07fcc97b9de3bc6e1af3ee85225db8253b /scripts/basic | |
| parent | a252cb93e1568d9f0754b9b2ac4829d896daa14e (diff) | |
| download | linux-b03638013add0609d35aaa8291548dea92cb9484.tar.gz linux-b03638013add0609d35aaa8291548dea92cb9484.zip | |
selftests: timers: Measure the CPU timers on the clock they count
Commit b00385b8d081 ("selftests/posix_timers: Use CLOCK_THREAD_CPUTIME_ID
for ITIMER_PROF measurements") gave ITIMER_PROF the clock it counts, as
measuring a CPU timer against the wall says nothing on a machine where
the task does not have a CPU to itself. The other CPU timers are still
measured against CLOCK_REALTIME and fail the same way. With four busy
loops on the two CPUs of a test machine:
not ok 2 ITIMER_VIRTUAL
not ok 5 timer_create() per CLOCK_THREAD_CPUTIME_ID
not ok 6 timer_create() per CLOCK_PROCESS_CPUTIME_ID
ITIMER_VIRTUAL counts the time the task spends in userspace, so take
CLOCK_THREAD_CPUTIME_ID for it as well; the loop it runs stays in
userspace, so what that clock adds for system time is far inside the
half a second the check allows. check_timer_create() arms its timer on
the clock it is given, so measure on that one.
The test then passes whole on that machine, 19 of 19, busy or idle.
Signed-off-by: Eva Kurchatova <eva.kurchatova@virtuozzo.com>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Acked-by: John Stultz <jstultz@google.com>
Link: https://patch.msgid.link/20260917015237.2462954-2-eva.kurchatova@virtuozzo.com
Diffstat (limited to 'scripts/basic')
0 files changed, 0 insertions, 0 deletions
