Skip to content

Commit 776b194

Browse files
paulmckrcuKAGA-KOKO
authored andcommitted
clocksource/wdtest: Print time values for short udelay(1)
When a pair of clocksource reads separated by a udelay(1) claim less than a full microsecond of elapsed time, print the measured delay as part of the splat. Signed-off-by: Paul E. McKenney <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Link: https://lore.kernel.org/all/717a2ddf-a80f-490b-aa3a-4e4b74fa56ca@paulmck-laptop
1 parent 9f38e83 commit 776b194

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

kernel/time/clocksource-wdtest.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,8 @@ static int wdtest_func(void *arg)
137137
udelay(1);
138138
j2 = clocksource_wdtest_ktime.read(&clocksource_wdtest_ktime);
139139
pr_info("--- tsc-like times: %lu - %lu = %lu.\n", j2, j1, j2 - j1);
140-
WARN_ON_ONCE(time_before(j2, j1 + NSEC_PER_USEC));
140+
WARN_ONCE(time_before(j2, j1 + NSEC_PER_USEC),
141+
"Expected at least 1000ns, got %lu.\n", j2 - j1);
141142

142143
/* Verify tsc-like stability with various numbers of errors injected. */
143144
max_retries = clocksource_get_max_watchdog_retry();

0 commit comments

Comments
 (0)