Commit 1adb5d6b authored by Paul E. McKenney's avatar Paul E. McKenney

torture: Make torture.sh use common time-duration bash functions

This commit makes torture.sh use the new bash functions get_starttime()
and get_starttime_duration() created for kvm.sh.
Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
parent bfc19c13
...@@ -13,6 +13,10 @@ ...@@ -13,6 +13,10 @@
scriptname=$0 scriptname=$0
args="$*" args="$*"
KVM="`pwd`/tools/testing/selftests/rcutorture"; export KVM
PATH=${KVM}/bin:$PATH; export PATH
. functions.sh
# Default duration and apportionment. # Default duration and apportionment.
duration_base=10 duration_base=10
duration_rcutorture_frac=7 duration_rcutorture_frac=7
...@@ -172,7 +176,7 @@ touch $T/successes ...@@ -172,7 +176,7 @@ touch $T/successes
ds="`date +%Y.%m.%d-%H.%M.%S`-torture" ds="`date +%Y.%m.%d-%H.%M.%S`-torture"
startdate="`date`" startdate="`date`"
starttime="`awk 'BEGIN { print systime() }' < /dev/null`" starttime="`get_starttime`"
# tortureme flavor command # tortureme flavor command
# Note that "flavor" is an arbitrary string. Supply --torture if needed. # Note that "flavor" is an arbitrary string. Supply --torture if needed.
...@@ -274,17 +278,7 @@ then ...@@ -274,17 +278,7 @@ then
nfailures="`wc -l "$T/failures" | awk '{ print $1 }'`" nfailures="`wc -l "$T/failures" | awk '{ print $1 }'`"
ret=2 ret=2
fi fi
duration="`awk -v starttime=$starttime ' echo Started at $startdate, ended at `date`, duration `get_starttime_duration $starttime`. | tee -a $T/log
BEGIN {
s = systime() - starttime;
h = s / 3600;
d = h /24;
if (d < 1)
print h " hours";
else
print d " days (" h " hours)";
}' < /dev/null`"
echo Started at $startdate, ended at `date`, duration $duration. | tee -a $T/log
echo Summary: Successes: $nsuccesses Failures: $nfailures. | tee -a $T/log echo Summary: Successes: $nsuccesses Failures: $nfailures. | tee -a $T/log
tdir="`cat $T/successes $T/failures | head -1 | awk '{ print $NF }' | sed -e 's,/[^/]\+/*$,,'`" tdir="`cat $T/successes $T/failures | head -1 | awk '{ print $NF }' | sed -e 's,/[^/]\+/*$,,'`"
if test -n "$tdir" if test -n "$tdir"
...@@ -293,9 +287,9 @@ then ...@@ -293,9 +287,9 @@ then
fi fi
exit $ret exit $ret
# @@@
# RCU CPU stall warnings? # RCU CPU stall warnings?
# scftorture warnings? # scftorture warnings?
# Need a way for the invoker to specify clang. # Need a way for the invoker to specify clang.
# Work out --configs based on number of available CPUs? # Work out --configs based on number of available CPUs?
# Need a way to specify --configs. --configs--rcutorture?
# Need to sense CPUs to size scftorture run. Ditto rcuscale and refscale. # Need to sense CPUs to size scftorture run. Ditto rcuscale and refscale.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment