2 # Subroutines which derive information from
3 # ghc garbage collection stats -- %gcstat
8 local($i, $max) = (-1, 0);
10 if ($gcstats{"collector"} eq "APPEL") {
11 die "APPEL stats: average residency not possible\n" ;
14 while(++$i < $gcstats{"gc_no"}) {
15 $max = $gcstats{"live_$i"} > $max ?
16 $gcstats{"live_$i"} : $max;
23 local($i, $j, $total);
25 if ($gcstats{"collector"} eq "APPEL") {
26 die "APPEL stats: average residency not possible\n" ;
29 if ($gcstats{"gc_no"} == 0) { return(0); };
32 $total = $gcstats{"live_$i"} * $gcstats{"mut_user_$i"} / 2;
34 while(++$i < $gcstats{"gc_no"}) {
35 $total += ($gcstats{"live_$i"} + $gcstats{"live_$j"})
36 * $gcstats{"mut_user_$i"} / 2;
40 $total += $gcstats{"live_$j"} * $gcstats{"mut_user_$i"} / 2;
42 int($total / $gcstats{"mut_user_total"});