remove empty dir
[ghc-hetmet.git] / glafp-utils / runstdtest / runstdtest.prl
index 26ba0cb..1b1af9f 100644 (file)
@@ -54,6 +54,13 @@ if ( $ENV{'TMPDIR'} ) { # where to make tmp file names
     $TmpPrefix ="$DEFAULT_TMPDIR";
     $ENV{'TMPDIR'} = "$DEFAULT_TMPDIR"; # set the env var as well
 }
+# If this is Cygwin, ignore eol and CR characters.
+# Perhaps required for MSYS too, although the cygpath
+# bit is hopefully unnecessary.
+if ( `uname | grep CYGWIN` ) {
+    $CONTEXT_DIFF=$CONTEXT_DIFF . " --strip-trailing-cr" ;
+    $TmpPrefix = `cygpath -m $TmpPrefix | tr -d \\\\n`;
+}
 $ScriptFile = "$TmpPrefix/run_me$$";
 $DefaultStdoutFile = "$TmpPrefix/no_stdout$$"; # can't use /dev/null (e.g. Alphas)
 $DefaultStderrFile = "$TmpPrefix/no_stderr$$";
@@ -186,7 +193,7 @@ if ($PostScript ne '') {
 # OK, so we're gonna do the normal thing...
 
 if ($Cachegrind eq 'yes') {
-  $CachegrindPrefix = "cachegrind --logfile-fd=99 99>$CachegrindStats";
+  $CachegrindPrefix = "valgrind --tool=cachegrind --log-fd=9 9>$CachegrindStats";
 } else {
   $CachegrindPrefix = '';
 }
@@ -305,7 +312,7 @@ exit 0;
 sub grab_arg_arg {
     local($option, $rest_of_arg) = @_;
     
-    if ($rest_of_arg) {
+    if ($rest_of_arg ne "") {
        return($rest_of_arg);
     } elsif ($#ARGV >= 0) {
        local($temp) = $ARGV[0]; shift(@ARGV); 
@@ -351,6 +358,7 @@ sub process_stats_file {
        local($tot_live)    = 0; # for calculating residency stuff
        local($tot_samples) = 0;
 
+       $GCWork = 0;
        while (<STATS>) {
            if (! /Gen:\s+0/ && /^\s*\d+\s+\d+\s+(\d+)\s+\d+\.\d+/ ) {
                $max_live = $1 if $max_live < $1;
@@ -359,7 +367,7 @@ sub process_stats_file {
            }
 
            $BytesAlloc = $1 if /^\s*([0-9,]+) bytes allocated in the heap/;
-           $GCWork = $1     if /^\s*([0-9,]+) bytes copied during GC/;
+           $GCWork += $1    if /^\s*([0-9,]+) bytes copied during GC/;
 
 #          if ( /^\s*([0-9,]+) bytes maximum residency .* (\d+) sample/ ) {
 #              $MaxResidency = $1; $ResidencySamples = $2;