diff options
author | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2016-04-19 19:50:44 -0400 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2016-06-14 19:02:16 -0400 |
commit | 6e8c66c867f919128855b77623ca9917770f1894 (patch) | |
tree | b37747a9e0c1ce49b14bf1d181fe218acd8410c2 | |
parent | 4e9a073f60367157fd64b65490654c39d4c44321 (diff) |
torture: Forgive lengthy trace dumps and preemption
This commit avoids killing qemu if a trace dump is making progress
or if console log output is continuing and the console log timestamp
does not exceed the total plus grace period.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
-rwxr-xr-x | tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh b/tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh index 4109f306d855..9b17c5252a2e 100755 --- a/tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh +++ b/tools/testing/selftests/rcutorture/bin/kvm-test-1-run.sh | |||
@@ -229,6 +229,7 @@ fi | |||
229 | if test $commandcompleted -eq 0 -a -n "$qemu_pid" | 229 | if test $commandcompleted -eq 0 -a -n "$qemu_pid" |
230 | then | 230 | then |
231 | echo Grace period for qemu job at pid $qemu_pid | 231 | echo Grace period for qemu job at pid $qemu_pid |
232 | oldline="`tail $resdir/console.log`" | ||
232 | while : | 233 | while : |
233 | do | 234 | do |
234 | kruntime=`awk 'BEGIN { print systime() - '"$kstarttime"' }' < /dev/null` | 235 | kruntime=`awk 'BEGIN { print systime() - '"$kstarttime"' }' < /dev/null` |
@@ -238,13 +239,29 @@ then | |||
238 | else | 239 | else |
239 | break | 240 | break |
240 | fi | 241 | fi |
241 | if test $kruntime -ge $((seconds + $TORTURE_SHUTDOWN_GRACE)) | 242 | must_continue=no |
243 | newline="`tail $resdir/console.log`" | ||
244 | if test "$newline" != "$oldline" && echo $newline | grep -q ' [0-9]\+us : ' | ||
245 | then | ||
246 | must_continue=yes | ||
247 | fi | ||
248 | last_ts="`tail $resdir/console.log | grep '^\[ *[0-9]\+\.[0-9]\+]' | tail -1 | sed -e 's/^\[ *//' -e 's/\..*$//'`" | ||
249 | if test -z "last_ts" | ||
250 | then | ||
251 | last_ts=0 | ||
252 | fi | ||
253 | if test "$newline" != "$oldline" -a "$last_ts" -lt $((seconds + $TORTURE_SHUTDOWN_GRACE)) | ||
254 | then | ||
255 | must_continue=yes | ||
256 | fi | ||
257 | if test $must_continue = no -a $kruntime -ge $((seconds + $TORTURE_SHUTDOWN_GRACE)) | ||
242 | then | 258 | then |
243 | echo "!!! PID $qemu_pid hung at $kruntime vs. $seconds seconds" >> $resdir/Warnings 2>&1 | 259 | echo "!!! PID $qemu_pid hung at $kruntime vs. $seconds seconds" >> $resdir/Warnings 2>&1 |
244 | kill -KILL $qemu_pid | 260 | kill -KILL $qemu_pid |
245 | break | 261 | break |
246 | fi | 262 | fi |
247 | sleep 1 | 263 | oldline=$newline |
264 | sleep 10 | ||
248 | done | 265 | done |
249 | elif test -z "$qemu_pid" | 266 | elif test -z "$qemu_pid" |
250 | then | 267 | then |