blob: c83b9ae4b583fc401a8a1aa9491e33bb2d7a9639 [file] [log] [blame]
#!/bin/sh
## contributed by:
## "Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>
## Peter Zijlstra <peterz@infradead.org>
## updated by:
## "Wenzhong Sun" <wenzhong.sun@intel.com>
## - Limit the test's runtime in 5 minutes
## - Adapt test to use runtime_loop framework
CPUPATH="/sys/devices/system/cpu"
NUMBER_OF_CPUS=$(ls -d $CPUPATH/cpu[0-9]* | wc -l)
: ${runtime:=300}
do_test()
{
for interval in 0 0.1 1
do
for i in $(seq $((NUMBER_OF_CPUS - 1)))
do
sleep $interval
state=$(cat $CPUPATH/cpu$i/online)
echo $((state^1)) > $CPUPATH/cpu$i/online
done
done
}
. $LKP_SRC/lib/runtime_loop.sh
runtime_loop