public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] timers/tick_sched: combine WARN_ON_ONCE and print_once
@ 2024-06-10 10:35 Anna-Maria Behnsen
  2024-07-01 11:31 ` Anna-Maria Behnsen
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Anna-Maria Behnsen @ 2024-06-10 10:35 UTC (permalink / raw)
  To: linux-kernel
  Cc: Frederic Weisbecker, Ingo Molnar, Thomas Gleixner,
	Anna-Maria Behnsen

When the WARN_ON_ONCE() triggers, the printk of the additional information
related to the warning will not happen in print level "warn". When reading
the dmesg with a restriction to level "warn", the information published by
the printk_once() will not show up there.

Transform WARN_ON_ONCE() and printk_once() into a WARN_ONCE().

Signed-off-by: Anna-Maria Behnsen <anna-maria@linutronix.de>
---
 kernel/time/tick-sched.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
index 71a792cd8936..afeae34e2a09 100644
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
@@ -1026,10 +1026,10 @@ static void tick_nohz_stop_tick(struct tick_sched *ts, int cpu)
 		if (expires == KTIME_MAX || ts->next_tick == hrtimer_get_expires(&ts->sched_timer))
 			return;
 
-		WARN_ON_ONCE(1);
-		printk_once("basemono: %llu ts->next_tick: %llu dev->next_event: %llu timer->active: %d timer->expires: %llu\n",
-			    basemono, ts->next_tick, dev->next_event,
-			    hrtimer_active(&ts->sched_timer), hrtimer_get_expires(&ts->sched_timer));
+		WARN_ONCE(1, "basemono: %llu ts->next_tick: %llu dev->next_event: %llu "
+			  "timer->active: %d timer->expires: %llu\n", basemono, ts->next_tick,
+			  dev->next_event, hrtimer_active(&ts->sched_timer),
+			  hrtimer_get_expires(&ts->sched_timer));
 	}
 
 	/*
-- 
2.39.2


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

end of thread, other threads:[~2024-07-03 19:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-10 10:35 [PATCH] timers/tick_sched: combine WARN_ON_ONCE and print_once Anna-Maria Behnsen
2024-07-01 11:31 ` Anna-Maria Behnsen
2024-07-01 21:57 ` Frederic Weisbecker
2024-07-03 19:36 ` [tip: timers/core] tick/sched: Combine " tip-bot2 for Anna-Maria Behnsen

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