-#!/local/sun4/bin/perl
#
# Subroutines to parses a ghc Garbage Collection stats file
#
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 = <STATS>;
do {$line = shift(@stats);} until ($line !~ /^$/);
chop($line);
$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; };
print STDERR "Unmatched line: $_";
}
- close($statsfile);
+ close(STATS);
%the_stats;
}