3 # Subroutines which derive information from
4 # ghc garbage collection stats -- %gcstat
9 local($i, $max) = (-1, 0);
11 if ($gcstats{"collector"} eq "APPEL") {
12 die "APPEL stats: average residency not possible\n" ;
15 while(++$i < $gcstats{"gc_no"}) {
16 $max = $gcstats{"live_$i"} > $max ?
17 $gcstats{"live_$i"} : $max;
24 local($i, $j, $total);
26 if ($gcstats{"collector"} eq "APPEL") {
27 die "APPEL stats: average residency not possible\n" ;
30 if ($gcstats{"gc_no"} == 0) { return(0); };
33 $total = $gcstats{"live_$i"} * $gcstats{"mut_user_$i"} / 2;
35 while(++$i < $gcstats{"gc_no"}) {
36 $total += ($gcstats{"live_$i"} + $gcstats{"live_$j"})
37 * $gcstats{"mut_user_$i"} / 2;
41 $total += $gcstats{"live_$j"} * $gcstats{"mut_user_$i"} / 2;
43 int($total / $gcstats{"mut_user_total"});