diff mbox series

[1/2] fstests: Always dump dmesg for failed test cases

Message ID 20200120070938.30247-1-wqu@suse.com (mailing list archive)
State New, archived
Headers show
Series [1/2] fstests: Always dump dmesg for failed test cases | expand

Commit Message

Qu Wenruo Jan. 20, 2020, 7:09 a.m. UTC
When hard-to-hit bugs happened, we really want every piece of info to
help us debugging.

Although we already have KEEP_DMESG config, not everyone is utilizing
it, thus when hard-to-hit bugs happened, one could only set it and retry
until next hit.

This patch will change the behavior by always dumping the dmesg for
failed tests, so that developers can always get extra info from any
failure.

Signed-off-by: Qu Wenruo <wqu@suse.com>
---
 check | 3 +++
 1 file changed, 3 insertions(+)

Comments

Eryu Guan Feb. 9, 2020, 3:48 p.m. UTC | #1
On Mon, Jan 20, 2020 at 03:09:37PM +0800, Qu Wenruo wrote:
> When hard-to-hit bugs happened, we really want every piece of info to
> help us debugging.
> 
> Although we already have KEEP_DMESG config, not everyone is utilizing
> it, thus when hard-to-hit bugs happened, one could only set it and retry
> until next hit.
> 
> This patch will change the behavior by always dumping the dmesg for
> failed tests, so that developers can always get extra info from any
> failure.
> 
> Signed-off-by: Qu Wenruo <wqu@suse.com>
> ---
>  check | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/check b/check
> index 2e148e5776e5..e580b2249f06 100755
> --- a/check
> +++ b/check
> @@ -840,6 +840,9 @@ for section in $HOST_OPTIONS_SECTIONS; do
>  
>  	# make sure we record the status of the last test we ran.
>  	if $err ; then
> +		if [ ! -f $seqres.dmesg ]; then
> +			_dmesg_since_test_start >$seqres.dmesg
> +		fi

So this only saves the dmesg of the last test?

And I don't think this is necessary, even if it saves the dmesgs of all
failed tests, this behavior change requires some more diskspace and may
fulfill / more easily.

I think if one knows he/she's debugging a hard-to-hit bug, set
KEEP_DMESG. Or again, make "save dmesg of every failed test" a tunable
behavior.

Thanks,
Eryu

>  		bad="$bad $seqnum"
>  		n_bad=`expr $n_bad + 1`
>  		tc_status="fail"
> -- 
> 2.24.1
>
Qu Wenruo Feb. 10, 2020, 12:29 a.m. UTC | #2
On 2020/2/9 下午11:48, Eryu Guan wrote:
> On Mon, Jan 20, 2020 at 03:09:37PM +0800, Qu Wenruo wrote:
>> When hard-to-hit bugs happened, we really want every piece of info to
>> help us debugging.
>>
>> Although we already have KEEP_DMESG config, not everyone is utilizing
>> it, thus when hard-to-hit bugs happened, one could only set it and retry
>> until next hit.
>>
>> This patch will change the behavior by always dumping the dmesg for
>> failed tests, so that developers can always get extra info from any
>> failure.
>>
>> Signed-off-by: Qu Wenruo <wqu@suse.com>
>> ---
>>  check | 3 +++
>>  1 file changed, 3 insertions(+)
>>
>> diff --git a/check b/check
>> index 2e148e5776e5..e580b2249f06 100755
>> --- a/check
>> +++ b/check
>> @@ -840,6 +840,9 @@ for section in $HOST_OPTIONS_SECTIONS; do
>>  
>>  	# make sure we record the status of the last test we ran.
>>  	if $err ; then
>> +		if [ ! -f $seqres.dmesg ]; then
>> +			_dmesg_since_test_start >$seqres.dmesg
>> +		fi
> 
> So this only saves the dmesg of the last test?
> 
> And I don't think this is necessary, even if it saves the dmesgs of all
> failed tests, this behavior change requires some more diskspace and may
> fulfill / more easily.
> 
> I think if one knows he/she's debugging a hard-to-hit bug, set
> KEEP_DMESG. Or again, make "save dmesg of every failed test" a tunable
> behavior.

Makes sense.

As I just went the same solution.

Thanks,
Qu
> 
> Thanks,
> Eryu
> 
>>  		bad="$bad $seqnum"
>>  		n_bad=`expr $n_bad + 1`
>>  		tc_status="fail"
>> -- 
>> 2.24.1
>>
diff mbox series

Patch

diff --git a/check b/check
index 2e148e5776e5..e580b2249f06 100755
--- a/check
+++ b/check
@@ -840,6 +840,9 @@  for section in $HOST_OPTIONS_SECTIONS; do
 
 	# make sure we record the status of the last test we ran.
 	if $err ; then
+		if [ ! -f $seqres.dmesg ]; then
+			_dmesg_since_test_start >$seqres.dmesg
+		fi
 		bad="$bad $seqnum"
 		n_bad=`expr $n_bad + 1`
 		tc_status="fail"