Thread (24 messages) 24 messages, 2 authors, 1d ago

Re: [PATCH v4 16/17] selftests/verification: Rearrange the wwnr_printk test

From: Gabriele Monaco <gmonaco@redhat.com>
Date: 2026-07-21 06:24:16
Also in: linux-kselftest, lkml

On Fri, 2026-07-17 at 17:46 +0200, Gabriele Monaco wrote:
+# loads may flood the ringbuffer, wait for all pending printks
+wait_dmesg_flush() {
+	local last_before last_after=$(dmesg | grep "rv:" | tail -n 1 ||
true)
+	while [ "$last_before" != "$last_after" ]; do
+		last_before=$last_after
+		sleep .3
+		last_after=$(dmesg | grep "rv:" | tail -n 1 || true)
+	done
 }
 
 echo 1 > monitors/wwnr/enable
 echo printk > monitors/wwnr/reactors
 
 load
+wait_dmesg_flush
On some systems this may trigger wwnr's reactions and run indefinitely, I'm
going to send a V5 moving this after turning monitoring/reacting of and adding a
timeout, just in case those switches don't work.
 
 echo 0 > monitoring_on
 ! load || false
 echo 1 > monitoring_on
 
 load
+wait_dmesg_flush
 
 echo 0 > reacting_on
 ! load || false
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help