public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Xiao Yang <yangx.jy@cn.fujitsu.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v2] rcu/rcu_torture.sh: Rewrite test
Date: Wed, 10 Jul 2019 13:32:58 +0800	[thread overview]
Message-ID: <5D25788A.6040506@cn.fujitsu.com> (raw)
In-Reply-To: <20190709154536.GA8195@rei.lan>

On 2019/07/09 23:45, Cyril Hrubis wrote:
> Hi!
>> +rcutorture_setup()
>> +{
>> +	# do test by inserting and removing rcutorture module
>> +	# so check if it is built-in, loaded or unbuilt
>> +	modprobe -n --first-time rcutorture>/dev/null 2>&1 || \
>> +		tst_brk TCONF "built-in, loaded or unbuilt rcutorture"
> Wouldn't the --first-time disable the test on subsequent runs? Or do I
> misunderstand how --first-time is supposed to work?
Hi,
No, -n option doesn't execute any operations.

We has to build rcutorture as a module if we want to run the test, so I 
just want to check
if rcutorture is built as a module instead of built-in or unbuilt by 
--first-time.

> Also I guess that some modprobe implementations may not support
> --first-time e.g. busybox.
Is there any way to check if rcutorture is only built as a module?
>> +}
>>
>> -trap cleanup INT
>> +rcutorture_test()
>> +{
>> +	local rcu_type=$1
>>
>> -rcu_type="rcu rcu_bh srcu sched"
>> +	tst_res TINFO "${rcu_type}-torture: running ${test_time} sec..."
>>
>> -if tst_kvcmp -lt "3.12"; then
>> -	rcu_type="$rcu_type rcu_sync rcu_expedited rcu_bh_sync rcu_bh_expedited \
>> -	          srcu_sync srcu_expedited sched_sync sched_expedited"
>> +	modprobe rcutorture nfakewriters=${num_writers} \
>> +		torture_type=${rcu_type}>/dev/null 2>&1
>> +	if [ $? -ne 0 ]; then
>> +		dmesg | grep -q "invalid torture type: \"${rcu_type}\""&&  \
>> +			tst_brk TCONF "invalid ${rcu_type} type"
>>
>> -	if tst_kvcmp -lt "3.11"; then
>> -		rcu_type="$rcu_type srcu_raw srcu_raw_sync"
>> +		tst_brk TBROK "failed to load module"
>>   	fi
>> -fi
>> -
>> -TST_TOTAL=$(echo "$rcu_type" | wc -w)
>> -
>> -est_time=`echo "scale=2; $test_time * $TST_TOTAL / 60 " | bc`
>> -tst_resm TINFO "estimate time $est_time min"
>> -
>> -for type in $rcu_type; do
>> -
>> -	tst_resm TINFO "$type: running $test_time sec..."
>> -
>> -	modprobe rcutorture nfakewriters=$num_writers \
>> -	         stat_interval=60 test_no_idle_hz=1 shuffle_interval=3 \
>> -	         stutter=5 irqreader=1 fqs_duration=0 fqs_holdoff=0 \
>> -	         fqs_stutter=3 test_boost=1 test_boost_interval=7 \
>> -	         test_boost_duration=4 shutdown_secs=0 \
>> -	         stall_cpu=0 stall_cpu_holdoff=10 n_barrier_cbs=0 \
>> -	         onoff_interval=0 onoff_holdoff=0 torture_type=$type \
>> -	>  /dev/null 2>&1 || tst_brkm TBROK "failed to load module"
>>
>> -	sleep $test_time
>> +	sleep ${test_time}
>>
>> -	rmmod rcutorture>  /dev/null 2>&1 || \
>> -		tst_brkm TBROK "failed to unload module"
>> +	rmmod rcutorture>/dev/null 2>&1 || \
>> +		tst_brk TBROK "failed to unload module"
> This should be modprobe -r, rmmod has been deprecated for quite some
> time.
I will use modprobe -r instead.

Best Regards,
Xiao Yang
>>   	# check module status in dmesg
>> -	result_str=`dmesg | sed -nE '$s/.*End of test: ([A-Z]+):.*/\1/p'`
>> -	if [ "$result_str" = "SUCCESS" ]; then
>> -		tst_resm TPASS "$type: completed"
>> +	local res=$(dmesg | sed -nE "s/.* ${rcu_type}-torture:.* End of test: (.*): .*/\1/p" | tail -n1)
>> +	if [ "$res" = "SUCCESS" ]; then
>> +		tst_res TPASS "${rcu_type}-torture: $res"
>>   	else
>> -		tst_resm TFAIL "$type: $result_str, see dmesg"
>> +		tst_res TFAIL "${rcu_type}-torture: $res, see dmesg"
>>   	fi
>> -done
>> +}
>> +
>> +do_test()
>> +{
>> +	case $1 in
>> +	1) rcutorture_test rcu;;
>> +	2) rcutorture_test srcu;;
>> +	3) rcutorture_test srcud;;
>> +	4) rcutorture_test tasks;;
>> +	esac
>> +}
>>
>> -tst_exit
>> +tst_run
>> -- 
>> 1.8.3.1
>>
>>
>>
>> -- 
>> Mailing list info: https://lists.linux.it/listinfo/ltp




  reply	other threads:[~2019-07-10  5:32 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-02 14:23 [LTP] [PATCH] rcu/rcu_torture.sh: Rewrite test Xiao Yang
2019-06-05 17:11 ` Alexey Kodanev
2019-06-06  2:35   ` Xiao Yang
2019-06-07 15:23   ` [LTP] [PATCH v2] " Xiao Yang
2019-06-07 15:38     ` Xiao Yang
2019-06-07 15:40   ` Xiao Yang
2019-07-09 15:45     ` Cyril Hrubis
2019-07-10  5:32       ` Xiao Yang [this message]
2019-07-10  9:11         ` Cyril Hrubis

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=5D25788A.6040506@cn.fujitsu.com \
    --to=yangx.jy@cn.fujitsu.com \
    --cc=ltp@lists.linux.it \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox