diff options
author | doko <doko@6ca36cf4-e1d1-0310-8c6f-e303bb2178ca> | 2015-01-20 11:55:49 +0000 |
---|---|---|
committer | doko <doko@6ca36cf4-e1d1-0310-8c6f-e303bb2178ca> | 2015-01-20 11:55:49 +0000 |
commit | 227ef40ee3f5b76329437be96fc7306be872c5fa (patch) | |
tree | 3bacf37cc9d3fedc71441072ed87cfe825a9887b /debian/acats-killer.sh | |
download | gcc-5-227ef40ee3f5b76329437be96fc7306be872c5fa.tar.gz |
- branch for GCC 5
git-svn-id: svn://anonscm.debian.org/gcccvs/branches/sid/gcc-5@7781 6ca36cf4-e1d1-0310-8c6f-e303bb2178ca
Diffstat (limited to 'debian/acats-killer.sh')
-rw-r--r-- | debian/acats-killer.sh | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/debian/acats-killer.sh b/debian/acats-killer.sh new file mode 100644 index 0000000..29a2550 --- /dev/null +++ b/debian/acats-killer.sh @@ -0,0 +1,62 @@ +#! /bin/sh + +# on ia64 systems, the acats hangs in unaligned memory accesses. +# kill these testcases. + +pidfile=acats-killer.pid + +usage() +{ + echo >&2 "usage: `basename $0` [-p <pidfile>] <ada logfile> <next logfile>" + exit 1 +} + +while [ $# -gt 0 ]; do + case $1 in + -p) + pidfile=$2 + shift + shift + ;; + -*) + usage + ;; + *) + break + esac +done + +[ $# -eq 2 ] || usage + +logfile=$1 +stopfile=$2 +interval=30 + +echo $$ > $pidfile + +while true; do + if [ -f "$stopfile" ]; then + echo "`basename $0`: finished." + rm -f $pidfile + exit 0 + fi + sleep $interval + if [ ! -f "$logfile" ]; then + continue + fi + pids=$(ps aux | awk '/testsuite\/ada\/acats\/tests/ { print $2 }') + if [ -n "$pids" ]; then + sleep $interval + pids2=$(ps aux | awk '/testsuite\/ada\/acats\/tests/ { print $2 }') + if [ "$pids" = "$pids2" ]; then + #echo kill: $pids + kill $pids + sleep 1 + pids2=$(ps aux | awk '/testsuite\/ada\/acats\/tests/ { print $2 }') + if [ "$pids" = "$pids2" ]; then + #echo kill -9: $pids + kill -9 $pids + fi + fi + fi +done |