X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=utils%2Frunstdtest%2Frunstdtest.prl;h=039c2534e464d1f91c17df623b33da9e3a55fe06;hp=7d58d93168e3a7dd5951c66047b27dcdb8ef98ed;hb=176fa33f17dd78355cc572e006d2ab26898e2c69;hpb=ec3dc438e066b935018eb156fa83d193a83ceac4 diff --git a/utils/runstdtest/runstdtest.prl b/utils/runstdtest/runstdtest.prl index 7d58d93..039c253 100644 --- a/utils/runstdtest/runstdtest.prl +++ b/utils/runstdtest/runstdtest.prl @@ -96,7 +96,7 @@ arg: while ($_ = $ARGV[0]) { /^-accept-output$/ && do { $SaveStdout = 1; $SaveStderr = 1; next arg; }; /^-stdout-binary/ && do { $StdoutBinary=1; next arg; }; - /^-stdout-binary/ && do { $StderrBinary=1; next arg; }; + /^-stderr-binary/ && do { $StderrBinary=1; next arg; }; /^-O(.*)/ && do { push(@PgmArgs, &grab_arg_arg('-O',$1)); next arg; }; /^-i(.*)/ && do { $PgmStdinFile = &grab_arg_arg('-i',$1); @@ -198,9 +198,10 @@ if ($PostScript ne '') { local($to_do); $PostScriptLines = `cat $PostScript`; $PostScriptLines =~ s/\r//g; - $* = 1; - $PostScriptLines =~ s#\$o1#$TmpPrefix/runtest$$.1#g; - $PostScriptLines =~ s#\$o2#$TmpPrefix/runtest$$.2#g; + $PostScriptLines =~ s#\$o1#$TmpPrefix/runtest$$.1#gm; + $PostScriptLines =~ s#\$o2#$TmpPrefix/runtest$$.2#gm; +# The postfix 'm' deals with recent versions of +# Perl that removed the $* feature } else { $PostScriptLines = ''; } @@ -223,6 +224,7 @@ cat /dev/null > $DefaultStderrFile $PreScriptLines $SpixifyLine1 $TimeCmd /bin/sh -c \'$CachegrindPrefix $ToRun $TimingMagic @PgmArgs < $PgmStdinFile 1> $TmpPrefix/runtest$$.1.raw 2> $TmpPrefix/runtest$$.2.raw 3> $TmpPrefix/runtest$$.3.raw\' +progexit=\$? if [ "$StdoutBinary" = "0" ]; then dos2unix < $TmpPrefix/runtest$$.1.raw > $TmpPrefix/runtest$$.1 else @@ -234,7 +236,6 @@ else cp $TmpPrefix/runtest$$.2.raw $TmpPrefix/runtest$$.2 fi dos2unix < $TmpPrefix/runtest$$.3.raw > $TmpPrefix/runtest$$.3 -progexit=\$? if [ \$progexit -eq 0 ] && [ $PgmFail -ne 0 ]; then echo $ToRun @PgmArgs \\< $PgmStdinFile echo "****" expected a failure, but was successful @@ -248,7 +249,7 @@ else $PostScriptLines hit='NO' for out_file in @PgmStdoutFile ; do - if sed "s/\\r\$//" $TmpPrefix/runtest$$.1 | cmp -s \$out_file - ; then + if sed "s/ \$//" $TmpPrefix/runtest$$.1 | cmp -s \$out_file - ; then hit='YES' fi done @@ -274,7 +275,7 @@ fi hit='NO' for out_file in @PgmStderrFile ; do - if sed "s/\\r\$//" $TmpPrefix/runtest$$.2 | cmp -s \$out_file - ; then + if sed "s/ \$//" $TmpPrefix/runtest$$.2 | cmp -s \$out_file - ; then hit='YES' fi done @@ -323,9 +324,9 @@ if ( $SysSpecificTiming eq '' ) { # print out what we found print STDERR "<<$SysSpecificTiming: "; if ( $Cachegrind ne 'yes') { - print STDERR "$BytesAlloc bytes, $GCs GCs, $AvgResidency/$MaxResidency avg/max bytes residency ($ResidencySamples samples), $GCWork bytes GC work, ${TotMem}M in use, $InitTime INIT ($InitElapsed elapsed), $MutTime MUT ($MutElapsed elapsed), $GcTime GC ($GcElapsed elapsed)$Counters"; + print STDERR "$BytesAlloc bytes, $GCs GCs, $AvgResidency/$MaxResidency avg/max bytes residency ($ResidencySamples samples), $GCWork bytes GC work, ${TotMem}M in use, $InitTime INIT ($InitElapsed elapsed), $MutTime MUT ($MutElapsed elapsed), $GcTime GC ($GcElapsed elapsed), $Gc0Time GC(0) ($Gc0Elapsed elapsed), $Gc1Time GC(1) ($Gc1Elapsed elapsed), $Balance balance$Counters"; } else { - print STDERR "$BytesAlloc bytes, $GCs GCs, $AvgResidency/$MaxResidency avg/max bytes residency ($ResidencySamples samples), $GCWork bytes GC work, ${TotMem}M in use, $InitTime INIT ($InitElapsed elapsed), $MutTime MUT ($MutElapsed elapsed), $GcTime GC ($GcElapsed elapsed), $TotInstrs instructions, $TotReads memory reads, $TotWrites memory writes, $TotMisses L2 cache misses"; + print STDERR "$BytesAlloc bytes, $GCs GCs, $AvgResidency/$MaxResidency avg/max bytes residency ($ResidencySamples samples), $GCWork bytes GC work, ${TotMem}M in use, $InitTime INIT ($InitElapsed elapsed), $MutTime MUT ($MutElapsed elapsed), $GcTime GC ($GcElapsed elapsed), $Gc0Time GC(0) ($Gc0Elapsed elapsed), $Gc1Time GC(1) ($Gc1Elapsed elapsed), $Balance balance, $TotInstrs instructions, $TotReads memory reads, $TotWrites memory writes, $TotMisses L2 cache misses"; }; print STDERR " :$SysSpecificTiming>>\n"; @@ -388,6 +389,8 @@ sub process_stats_file { local($count) = 0; $GCWork = 0; + $GCs = 0; + $Balance = 1; while () { if (! /Gen:\s+0/ && /^\s*\d+\s+\d+\s+(\d+)\s+\d+\.\d+/ ) { $max_live = $1 if $max_live < $1; @@ -407,9 +410,9 @@ sub process_stats_file { # $MaxResidency = $1; $ResidencySamples = $2; # } - $GCs = $1 if /^\s*([0-9,]+) collections? in generation 0/; + $GCs += $1 if /^\s*Generation\s*\d+:\s*([0-9,]+) collections/; - if ( /^\s+([0-9]+)\s+Mb total memory/ ) { + if ( /^\s+([0-9]+)\s+M[Bb] total memory/ ) { $TotMem = $1; } @@ -421,6 +424,19 @@ sub process_stats_file { $GcTime = $1; $GcElapsed = $2; } + if (/Generation (\d+):\s*\d+ collections,\s*\d+ parallel,\s*(-*\d+\.\d\d)s\s*,\s*(-*\d+\.\d\d)s elapsed/) { + if ($1 == 0) { + $Gc0Time = $2; $Gc0Elapsed = $3; + } elsif ($1 == 1) { + $Gc1Time = $2; $Gc1Elapsed = $3; + } + } + + if (/work balance: ([0-9.]+)/) { + $Balance = $1; + } + + if ( /CPU GC counters/ ) { # Counters that follow correspond to GC $into_gc_counters = 1; @@ -501,11 +517,20 @@ sub process_stats_file { print STDERR "Warning: GcElapsed not found in stats file\n" unless defined($GcElapsed); print STDERR "Warning: total memory not found in stats file\n" unless defined($TotMem); print STDERR "Warning: GC work not found in stats file\n" unless defined($GCWork); + print STDERR "Warning: Gc0Time not found in stats file\n" unless defined($Gc0Time); + print STDERR "Warning: Gc0Elapsed not found in stats file\n" unless defined($Gc0Elapsed); + print STDERR "Warning: Gc1Time not found in stats file\n" unless defined($Gc1Time); + print STDERR "Warning: Gc1Elapsed not found in stats file\n" unless defined($Gc1Elapsed); + print STDERR "Warning: Balance not found in stats file\n" unless defined($Gc1Elapsed); # things we didn't necessarily expect to find $MaxResidency = 0 unless defined($MaxResidency); $AvgResidency = 0 unless defined($AvgResidency); $ResidencySamples = 0 unless defined($ResidencySamples); + $Gc0Time = 0.0 unless defined($Gc0Time); + $Gc0Elapsed = 0.0 unless defined($Gc0Elapsed); + $Gc1Time = 0.0 unless defined($Gc1Time); + $Gc1Elapsed = 0.0 unless defined($Gc1Elapsed); # a bit of tidying $BytesAlloc =~ s/,//g;