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

Gabriele Monaco <[email protected]>
Newsgroups org.kernel.vger.linux-trace-kernel,org.kernel.vger.linux-kernel,org.kernel.vger.linux-kselftest
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.