[commit: nofib] master: Fix parsing of maximum residency in runstdtest (f352131)

git at git.haskell.org git at git.haskell.org
Fri Dec 21 13:24:28 UTC 2018


Repository : ssh://git@git.haskell.org/nofib

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/f3521319e2c5390e8076fd379ddeeea9d3e7ce12/nofib

>---------------------------------------------------------------

commit f3521319e2c5390e8076fd379ddeeea9d3e7ce12
Author: Sebastian Graf <sebastian.graf at kit.edu>
Date:   Fri Dec 21 14:24:11 2018 +0100

    Fix parsing of maximum residency in runstdtest
    
    Summary:
    `runstdtest` switched from `-S` to `-s` output a while ago.
    That broke parsing of maximum and average residency numbers.
    
    This commit makes sure that at least maximum residency is parsed
    correctly from `-s` output, while leaving the logic for `-S` output.
    
    Reviewers: simonmar, bgamari, simonpj, osa1, AndreasK, O26 nofib
    
    Reviewed By: bgamari
    
    GHC Trac Issues: #16003
    
    Differential Revision: https://phabricator.haskell.org/D5418


>---------------------------------------------------------------

f3521319e2c5390e8076fd379ddeeea9d3e7ce12
 runstdtest/runstdtest.prl | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/runstdtest/runstdtest.prl b/runstdtest/runstdtest.prl
index 648f381..78da420 100644
--- a/runstdtest/runstdtest.prl
+++ b/runstdtest/runstdtest.prl
@@ -401,6 +401,10 @@ sub process_stats_file {
         $Balance = 1;
 	while (<STATS>) {
 	    if (! /Gen:\s+0/ && /^\s*\d+\s+\d+\s+(\d+)\s+\d+\.\d+/ ) {
+		# This is only hit for -S and will override the residency
+		# numbers from -s if found.
+		# -S is needed for average residency numbers, which is 0
+		# otherwise.
 		$max_live = $1 if $max_live < $1;
 		$tot_live += $1;
 		$tot_samples += 1;
@@ -414,9 +418,10 @@ sub process_stats_file {
 	       $GCWork += $tmp;
             }
 
-#           if ( /^\s*([0-9,]+) bytes maximum residency .* (\d+) sample/ ) {
-#		$MaxResidency = $1; $ResidencySamples = $2;
-#	    }
+            if ( /^\s*([0-9,]+) bytes maximum residency.*(\d+) sample/ ) {
+                $MaxResidency = $1;
+                $ResidencySamples = $2;
+            }
 
             if ( /^\s+([0-9]+)\s+M[Bb] total memory/ ) {
 		$TotMem = $1;
@@ -501,6 +506,7 @@ sub process_stats_file {
 	}
 	close(STATS) || die "Failed when closing $StatsFile\n";
 	if ( $tot_samples > 0 ) {
+	    # This is only hit for -S
 	    $ResidencySamples = $tot_samples;
 	    $MaxResidency = $max_live;
 	    $AvgResidency = int ($tot_live / $tot_samples) ;



More information about the ghc-commits mailing list