mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH clocksource-wdtest] Print time values for short udelay(1)
@ 2024-12-12 18:56 Paul E. McKenney
  2025-01-15 18:54 ` [tip: timers/core] clocksource/wdtest: " tip-bot2 for Paul E. McKenney
  0 siblings, 1 reply; 2+ messages in thread
From: Paul E. McKenney @ 2024-12-12 18:56 UTC (permalink / raw)
  To: jstultz, tglx, sboyd; +Cc: linux-kernel, kernel-team, riel

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 <paulmck@kernel.org>
Cc: John Stultz <jstultz@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Stephen Boyd <sboyd@kernel.org>

diff --git a/kernel/time/clocksource-wdtest.c b/kernel/time/clocksource-wdtest.c
index 62e73444ffe45..38dae590b29f5 100644
--- a/kernel/time/clocksource-wdtest.c
+++ b/kernel/time/clocksource-wdtest.c
@@ -137,7 +137,8 @@ static int wdtest_func(void *arg)
 	udelay(1);
 	j2 = clocksource_wdtest_ktime.read(&clocksource_wdtest_ktime);
 	pr_info("--- tsc-like times: %lu - %lu = %lu.\n", j2, j1, j2 - j1);
-	WARN_ON_ONCE(time_before(j2, j1 + NSEC_PER_USEC));
+	WARN_ONCE(time_before(j2, j1 + NSEC_PER_USEC),
+		  "Expected at least 1000ns, got %lu.\n", j2 - j1);
 
 	/* Verify tsc-like stability with various numbers of errors injected. */
 	max_retries = clocksource_get_max_watchdog_retry();

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [tip: timers/core] clocksource/wdtest: Print time values for short udelay(1)
  2024-12-12 18:56 [PATCH clocksource-wdtest] Print time values for short udelay(1) Paul E. McKenney
@ 2025-01-15 18:54 ` tip-bot2 for Paul E. McKenney
  0 siblings, 0 replies; 2+ messages in thread
From: tip-bot2 for Paul E. McKenney @ 2025-01-15 18:54 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: Paul E. McKenney, Thomas Gleixner, x86, linux-kernel

The following commit has been merged into the timers/core branch of tip:

Commit-ID:     776b194116d1a484b6d04abfe4b86272f0700144
Gitweb:        https://git.kernel.org/tip/776b194116d1a484b6d04abfe4b86272f0700144
Author:        Paul E. McKenney <paulmck@kernel.org>
AuthorDate:    Thu, 12 Dec 2024 10:56:20 -08:00
Committer:     Thomas Gleixner <tglx@linutronix.de>
CommitterDate: Wed, 15 Jan 2025 19:49:13 +01:00

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 <paulmck@kernel.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/all/717a2ddf-a80f-490b-aa3a-4e4b74fa56ca@paulmck-laptop


---
 kernel/time/clocksource-wdtest.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/kernel/time/clocksource-wdtest.c b/kernel/time/clocksource-wdtest.c
index 62e7344..38dae59 100644
--- a/kernel/time/clocksource-wdtest.c
+++ b/kernel/time/clocksource-wdtest.c
@@ -137,7 +137,8 @@ static int wdtest_func(void *arg)
 	udelay(1);
 	j2 = clocksource_wdtest_ktime.read(&clocksource_wdtest_ktime);
 	pr_info("--- tsc-like times: %lu - %lu = %lu.\n", j2, j1, j2 - j1);
-	WARN_ON_ONCE(time_before(j2, j1 + NSEC_PER_USEC));
+	WARN_ONCE(time_before(j2, j1 + NSEC_PER_USEC),
+		  "Expected at least 1000ns, got %lu.\n", j2 - j1);
 
 	/* Verify tsc-like stability with various numbers of errors injected. */
 	max_retries = clocksource_get_max_watchdog_retry();

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-01-15 18:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-12-12 18:56 [PATCH clocksource-wdtest] Print time values for short udelay(1) Paul E. McKenney
2025-01-15 18:54 ` [tip: timers/core] clocksource/wdtest: " tip-bot2 for Paul E. McKenney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®