All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wen Yang <wen.yang@linux.dev>
To: Gabriele Monaco <gmonaco@redhat.com>,
	linux-trace-kernel@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Nam Cao <namcao@linutronix.de>,
	Thomas Weissschuh <thomas.weissschuh@linutronix.de>,
	Tomas Glozar <tglozar@redhat.com>, John Kacur <jkacur@redhat.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Shuah Khan <shuah@kernel.org>,
	linux-kselftest@vger.kernel.org
Subject: Re: [PATCH v3 16/17] selftests/verification: Rearrange the wwnr_printk test
Date: Wed, 15 Jul 2026 01:42:58 +0800	[thread overview]
Message-ID: <73295218-eb3f-437d-be5a-fcb5012bf31b@linux.dev> (raw)
In-Reply-To: <b971748dea21a7a6eec3be8b95f4c18aec2d0552.camel@redhat.com>



On 7/10/26 16:31, Gabriele Monaco wrote:
> On Fri, 2026-07-10 at 01:08 +0800, Wen Yang wrote:
>>>    load() { # returns true if there was a reaction
>>> -	local lines_before num
>>> +	local lines_before num load_pid ret
>>>    	num=$((($(nproc) + 1) / 2))
>>>    	lines_before=$(dmesg | wc -l)
>>> -	stress-ng --cpu-sched "$num" --timer "$num" -t 5 -q
>>> -	dmesg | tail -n $((lines_before + 1)) | grep -q "rv: monitor wwnr
>>> does not allow event"
>>> +	stress-ng --cpu-sched "$num" --timer "$num" -t 5 -q &
>>> +	load_pid=$!
>>> +	timeout 5 dmesg -w | tail -n +$((lines_before + 1)) | grep -m 1 -q
>>> "rv: monitor wwnr does not allow event"
>>
>>
>> Minor nit: could we add a small delay (e.g., sleep 0.1) before dmesg?
> 
> I don't get what the benefit would be.
> 
> The intent of that line is to run a continuous dmesg (-w) for up to 5s (timeout)
> but stopping if an occurrence is found (grep -m 1 would close the pipe).
> 
> Do you see a case in which this wouldn't happen?
> 

You're right, the sleep is not needed. My concern was that a reaction
message generated in the brief window between starting stress-ng and the
dmesg pipeline being fully set up might be missed. But that can't
happen: dmesg -w always starts by flushing all currently buffered
messages before entering watch mode, so any reaction already in the ring
buffer will be included in its initial output. The  tail -n +N  offset
then correctly filters to only those messages beyond our pre-test
baseline.

Withdraw the nit. The Reviewed-by stands.

--
Best wishes,
Wen

>>
>> Reviewed-by: Wen Yang <wen.yang@linux.dev>
>>

  reply	other threads:[~2026-07-14 17:43 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-25 12:14 [PATCH v3 00/17] rv: Add selftests to tools and KUnit tests Gabriele Monaco
2026-06-25 12:14 ` [PATCH v3 01/17] rv: Use generic rv_this for the rv_monitor variable in LTL Gabriele Monaco
2026-07-02 13:43   ` Nam Cao
2026-06-25 12:14 ` [PATCH v3 02/17] tools/rv: Fix exit status when monitor execution fails Gabriele Monaco
2026-06-25 12:14 ` [PATCH v3 03/17] verification/rvgen: Improve rv_dir discovery in RVGenerator Gabriele Monaco
2026-07-02 13:53   ` Nam Cao
2026-07-02 14:00     ` Thomas Weissschuh
2026-07-02 14:01     ` Gabriele Monaco
2026-07-02 14:09       ` Thomas Weissschuh
2026-07-02 14:16   ` Nam Cao
2026-06-25 12:14 ` [PATCH v3 04/17] tools/rv: Add selftests Gabriele Monaco
2026-06-28 17:10   ` Wen Yang
2026-06-29  6:51     ` Gabriele Monaco
2026-07-14 18:01       ` Wen Yang
2026-06-25 12:14 ` [PATCH v3 05/17] verification/rvgen: Add golden and spec folders for tests Gabriele Monaco
2026-06-25 12:14 ` [PATCH v3 06/17] verification/rvgen: Add selftests Gabriele Monaco
2026-07-09 17:13   ` Wen Yang
2026-06-25 12:14 ` [PATCH v3 07/17] rv: Add KUnit stub to rv_react() and rv_*_task_monitor_slot() Gabriele Monaco
2026-07-02 13:59   ` Nam Cao
2026-06-25 12:14 ` [PATCH v3 08/17] rv: Export task monitor slot and react symbols Gabriele Monaco
2026-07-02 14:00   ` Nam Cao
2026-06-25 12:14 ` [PATCH v3 09/17] rv: Add KUnit tests for some DA/HA monitors Gabriele Monaco
2026-07-07  6:52   ` Nam Cao
2026-06-25 12:14 ` [PATCH v3 10/17] rv: Add KUnit stub for current Gabriele Monaco
2026-06-25 12:14 ` [PATCH v3 11/17] rv: Prevent unintentional tracepoints during KUnit tests Gabriele Monaco
2026-06-28 17:17   ` Wen Yang
2026-07-07  7:00   ` Nam Cao
2026-07-07  7:23     ` Gabriele Monaco
2026-06-25 12:14 ` [PATCH v3 12/17] rv: Add KUnit tests for some LTL monitors Gabriele Monaco
2026-07-07  7:04   ` Nam Cao
2026-06-25 12:14 ` [PATCH v3 13/17] verification/rvgen: Add the rvgen kunit subcommand Gabriele Monaco
2026-07-09  8:02   ` Nam Cao
2026-06-25 12:14 ` [PATCH v3 14/17] verification/rvgen: Add selftests for rvgen kunit Gabriele Monaco
2026-06-28 17:06   ` Wen Yang
2026-06-29  7:04     ` Gabriele Monaco
2026-07-14 17:49       ` Wen Yang
2026-07-15  9:25         ` Gabriele Monaco
2026-07-09  8:11   ` Nam Cao
2026-07-09 15:52     ` Gabriele Monaco
2026-06-25 12:14 ` [PATCH v3 15/17] selftests/verification: Fix wrong errexit assumption Gabriele Monaco
2026-07-09  8:14   ` Nam Cao
2026-07-09 17:10   ` Wen Yang
2026-06-25 12:14 ` [PATCH v3 16/17] selftests/verification: Rearrange the wwnr_printk test Gabriele Monaco
2026-07-09 17:08   ` Wen Yang
2026-07-10  8:31     ` Gabriele Monaco
2026-07-14 17:42       ` Wen Yang [this message]
2026-07-10  6:18   ` Nam Cao
2026-07-10  8:41     ` Gabriele Monaco
2026-06-25 12:14 ` [PATCH v3 17/17] selftests/verification: Add selftests for deadline and stall monitors Gabriele Monaco
2026-06-28 16:58   ` Wen Yang
2026-07-02 14:05     ` Gabriele Monaco

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=73295218-eb3f-437d-be5a-fcb5012bf31b@linux.dev \
    --to=wen.yang@linux.dev \
    --cc=gmonaco@redhat.com \
    --cc=jkacur@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=namcao@linutronix.de \
    --cc=rostedt@goodmis.org \
    --cc=shuah@kernel.org \
    --cc=tglozar@redhat.com \
    --cc=thomas.weissschuh@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.