X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Futils%2Fstat2resid%2Fparse-gcstats.prl;h=d882ee634892fa77735fdcb15872ada6fef2669e;hb=96009cf59680c1ad486ced4ca01d12b519bb4d11;hp=b6e80fd9e60e5505a6f164b12685bca119f5f80d;hpb=e7d21ee4f8ac907665a7e170c71d59e13a01da09;p=ghc-hetmet.git diff --git a/ghc/utils/stat2resid/parse-gcstats.prl b/ghc/utils/stat2resid/parse-gcstats.prl index b6e80fd..d882ee6 100644 --- a/ghc/utils/stat2resid/parse-gcstats.prl +++ b/ghc/utils/stat2resid/parse-gcstats.prl @@ -1,4 +1,3 @@ -#!/local/sun4/bin/perl # # Subroutines to parses a ghc Garbage Collection stats file # @@ -36,9 +35,10 @@ sub parse_stats { local($statsfile, $line, $row, $col, $val); local(@stats, @hdr1, @hdr2, @line_vals); local(%the_stats); + local(*STATS); - open($statsfile, $filename) || die "Cant open $filename \n"; - @stats = <$statsfile>; + open(STATS, $filename) || die "Cant open $filename \n"; + @stats = ; do {$line = shift(@stats);} until ($line !~ /^$/); chop($line); @@ -161,14 +161,16 @@ arg: while($_ = $stats[0]) { $the_stats{"mut_elap_$row"} = $2 - $tot_gc_elap - $tot_mut_elap; next arg; }; - /GC time\s+([\d\.]+)s\s+\(\s*([\d.]+)s elapsed\)/ && do { + /GC\s+time\s+([\d\.]+)s\s+\(\s*([\d.]+)s elapsed\)/ && do { # $1 == $tot_gc_user || die "GCuser $1 != $tot_gc_user \n"; # $2 == $tot_gc_elap || die "GCelap $2 != $tot_gc_elap \n"; $the_stats{"gc_user_total"} = $tot_gc_user; $the_stats{"gc_elap_total"} = $tot_gc_elap; next arg; }; - /MUT time/ && do { next arg; }; + /MUT\s+time/ && do { next arg; }; + /INIT\s+time/ && do { next arg; }; + /^\s*([\d,]+) bytes maximum residency/ && do { next arg; }; /\%GC time/ && do { next arg; }; /Alloc rate/ && do { next arg; }; @@ -179,7 +181,7 @@ arg: while($_ = $stats[0]) { print STDERR "Unmatched line: $_"; } - close($statsfile); + close(STATS); %the_stats; }