[llvm-commits] [test-suite] r151237 - in /test-suite/trunk: Makefile.programs RunSafely.sh

Andrew Trick atrick at apple.com
Wed Feb 22 21:03:03 PST 2012


Author: atrick
Date: Wed Feb 22 23:03:03 2012
New Revision: 151237

URL: http://llvm.org/viewvc/llvm-project?rev=151237&view=rev
Log:
Add a *temporary* NO_WATCHDOG option to disable TimedExec.sh.

This is not the right fix. TimedExec.sh needs to be replaced by adding
a timeout option to the timeit tool. But, this has been sitting in my
copy of the test-suite for months and I would like to be able to tell
others to use the option. Disabling TimedExec.sh is the only way to get
meaningful run times for short benchmarks.

Modified:
    test-suite/trunk/Makefile.programs
    test-suite/trunk/RunSafely.sh

Modified: test-suite/trunk/Makefile.programs
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/Makefile.programs?rev=151237&r1=151236&r2=151237&view=diff
==============================================================================
--- test-suite/trunk/Makefile.programs (original)
+++ test-suite/trunk/Makefile.programs Wed Feb 22 23:03:03 2012
@@ -141,6 +141,10 @@
 RUNSAFELYLOCAL := $(RUNSAFELYLOCAL) -t "$(TIMEIT)"
 endif
 
+ifdef NO_WATCHDOG
+RUNSAFELY := $(RUNSAFELY) -nw
+endif
+
 RUNSAFELY := $(RUNSAFELY) $(RUNTIMELIMIT) $(EXIT_OK)
 RUNSAFELYLOCAL := $(RUNSAFELYLOCAL) $(RUNTIMELIMIT) $(EXIT_OK)
 endif

Modified: test-suite/trunk/RunSafely.sh
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/RunSafely.sh?rev=151237&r1=151236&r2=151237&view=diff
==============================================================================
--- test-suite/trunk/RunSafely.sh (original)
+++ test-suite/trunk/RunSafely.sh Wed Feb 22 23:03:03 2012
@@ -10,7 +10,7 @@
 #           This script funnels stdout and stderr from the program into the
 #           fourth argument specified, and outputs a <outfile>.time file which
 #           contains a timing of the program and the program's exit code.
-#          
+#
 #           The <exitok> parameter specifies how the program's exit status
 #           is interpreted.  If the <exitok> parameter is non-zero, any
 #           non-zero exit status from the program is considered to indicate
@@ -22,10 +22,10 @@
 #           If optional parameters -r <remote host> -l <remote user> are
 #           specified, it execute the program remotely using rsh.
 #
-# Syntax: 
+# Syntax:
 #
 #   RunSafely.sh [-r <rhost>] [-l <ruser>] [-rc <client>] [-rp <port>]
-#                [-u <under>]
+#                [-u <under>] [-nw]
 #                <timeout> <exitok> <infile> <outfile> <program> <args...>
 #
 #   where:
@@ -34,6 +34,7 @@
 #     <client>  is the remote client used to execute the program
 #     <port>    is the port used by the remote client
 #     <under>   is a wrapper that the program is run under
+#     -nw       disables the watchdog timer (allowing hung processes)
 #     <timeout> is the maximum number of seconds to let the <program> run
 #     <exitok>  is 1 if the program must exit with 0 return code
 #     <infile>  is a file from which standard input is directed
@@ -58,6 +59,7 @@
 RPORT=
 RUN_UNDER=
 TIMEIT=time
+WATCHDOG="ON"
 if [ $1 = "-r" ]; then
   RHOST=$2
   shift 2
@@ -82,6 +84,11 @@
   TIMEIT=$2
   shift 2
 fi
+# Please, please remove this option once TimedExec.sh is replaced.
+if [ $1 = "-nw" ]; then
+  WATCHDOG=""
+  shift
+fi
 
 ULIMIT=$1
 EXITOK=$2
@@ -98,7 +105,7 @@
 
 ULIMITCMD=""
 case $SYSTEM in
-  CYGWIN*) 
+  CYGWIN*)
     ;;
   Darwin*)
     # Disable core file emission, the script doesn't find it anyway because it
@@ -124,7 +131,7 @@
 #
 # Run the command, timing its execution.
 # The standard output and standard error of $PROGRAM should go in $OUTFILE,
-# and the standard error of time should go in $OUTFILE.time. Note that the 
+# and the standard error of time should go in $OUTFILE.time. Note that the
 # return code of the program is appended to the $OUTFILE on an "Exit Val ="
 # line.
 #
@@ -134,7 +141,9 @@
 #
 PWD=`pwd`
 COMMAND="$RUN_UNDER $PROGRAM $*"
-COMMAND="${DIR}TimedExec.sh $ULIMIT $PWD $COMMAND"
+if [ -n "$WATCHDOG" ]; then
+  COMMAND="${DIR}TimedExec.sh $ULIMIT $PWD $COMMAND"
+fi
 COMMAND=$(echo "$COMMAND" | sed -e 's#"#\\"#g')
 
 if [ "x$RHOST" = x ] ; then





More information about the llvm-commits mailing list