Skip to content

Commit c493f1c

Browse files
committed
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: Paul E. McKenney <[email protected]>
1 parent e42617b commit c493f1c

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

tools/testing/selftests/rcutorture/bin/jitter.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ spinmax=${4-1000}
2323

2424
n=1
2525

26-
starttime=`awk 'BEGIN { print systime(); }' < /dev/null`
26+
starttime=`gawk 'BEGIN { print systime(); }' < /dev/null`
2727

2828
while :
2929
do
3030
# Check for done.
31-
t=`awk -v s=$starttime 'BEGIN { print systime() - s; }' < /dev/null`
31+
t=`gawk -v s=$starttime 'BEGIN { print systime() - s; }' < /dev/null`
3232
if test "$t" -gt "$duration"
3333
then
3434
exit 0;

tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ qemu_args=$5
123123
boot_args=$6
124124

125125
cd $KVM
126-
kstarttime=`awk 'BEGIN { print systime() }' < /dev/null`
126+
kstarttime=`gawk 'BEGIN { print systime() }' < /dev/null`
127127
if test -z "$TORTURE_BUILDONLY"
128128
then
129129
echo ' ---' `date`: Starting kernel
@@ -177,7 +177,7 @@ do
177177
then
178178
qemu_pid=`cat "$resdir/qemu_pid"`
179179
fi
180-
kruntime=`awk 'BEGIN { print systime() - '"$kstarttime"' }' < /dev/null`
180+
kruntime=`gawk 'BEGIN { print systime() - '"$kstarttime"' }' < /dev/null`
181181
if test -z "$qemu_pid" || kill -0 "$qemu_pid" > /dev/null 2>&1
182182
then
183183
if test $kruntime -ge $seconds
@@ -213,7 +213,7 @@ then
213213
oldline="`tail $resdir/console.log`"
214214
while :
215215
do
216-
kruntime=`awk 'BEGIN { print systime() - '"$kstarttime"' }' < /dev/null`
216+
kruntime=`gawk 'BEGIN { print systime() - '"$kstarttime"' }' < /dev/null`
217217
if kill -0 $qemu_pid > /dev/null 2>&1
218218
then
219219
:

0 commit comments

Comments
 (0)