Commit c493f1c9 authored by Paul E. McKenney's avatar Paul E. McKenney

torture: Use gawk instead of awk for systime() function

In many environments, gawk provides systime(), but awk doesn't.
This commit therefore changes awk scripts using systime() to instead be
gawk scripts.
Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
parent e42617b8
...@@ -23,12 +23,12 @@ spinmax=${4-1000} ...@@ -23,12 +23,12 @@ spinmax=${4-1000}
n=1 n=1
starttime=`awk 'BEGIN { print systime(); }' < /dev/null` starttime=`gawk 'BEGIN { print systime(); }' < /dev/null`
while : while :
do do
# Check for done. # Check for done.
t=`awk -v s=$starttime 'BEGIN { print systime() - s; }' < /dev/null` t=`gawk -v s=$starttime 'BEGIN { print systime() - s; }' < /dev/null`
if test "$t" -gt "$duration" if test "$t" -gt "$duration"
then then
exit 0; exit 0;
......
...@@ -123,7 +123,7 @@ qemu_args=$5 ...@@ -123,7 +123,7 @@ qemu_args=$5
boot_args=$6 boot_args=$6
cd $KVM cd $KVM
kstarttime=`awk 'BEGIN { print systime() }' < /dev/null` kstarttime=`gawk 'BEGIN { print systime() }' < /dev/null`
if test -z "$TORTURE_BUILDONLY" if test -z "$TORTURE_BUILDONLY"
then then
echo ' ---' `date`: Starting kernel echo ' ---' `date`: Starting kernel
...@@ -177,7 +177,7 @@ do ...@@ -177,7 +177,7 @@ do
then then
qemu_pid=`cat "$resdir/qemu_pid"` qemu_pid=`cat "$resdir/qemu_pid"`
fi fi
kruntime=`awk 'BEGIN { print systime() - '"$kstarttime"' }' < /dev/null` kruntime=`gawk 'BEGIN { print systime() - '"$kstarttime"' }' < /dev/null`
if test -z "$qemu_pid" || kill -0 "$qemu_pid" > /dev/null 2>&1 if test -z "$qemu_pid" || kill -0 "$qemu_pid" > /dev/null 2>&1
then then
if test $kruntime -ge $seconds if test $kruntime -ge $seconds
...@@ -213,7 +213,7 @@ then ...@@ -213,7 +213,7 @@ then
oldline="`tail $resdir/console.log`" oldline="`tail $resdir/console.log`"
while : while :
do do
kruntime=`awk 'BEGIN { print systime() - '"$kstarttime"' }' < /dev/null` kruntime=`gawk 'BEGIN { print systime() - '"$kstarttime"' }' < /dev/null`
if kill -0 $qemu_pid > /dev/null 2>&1 if kill -0 $qemu_pid > /dev/null 2>&1
then then
: :
......
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