X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Frts%2FStats.c;h=5d4f772396c4fad5720e640b678621d4b0caf4eb;hb=7d71bf0b4e294a7cb62037aedd087519ead9ade8;hp=fab773c45f837df60fc7ce02ad8a1aa6cd823f68;hpb=373fabef9643b4e1d0284fe10d5a3c3308fd4acb;p=ghc-hetmet.git diff --git a/ghc/rts/Stats.c b/ghc/rts/Stats.c index fab773c..5d4f772 100644 --- a/ghc/rts/Stats.c +++ b/ghc/rts/Stats.c @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------------- - * $Id: Stats.c,v 1.42 2002/01/24 07:50:01 sof Exp $ + * $Id: Stats.c,v 1.46 2002/08/19 16:02:26 simonmar Exp $ * * (c) The GHC Team, 1998-1999 * @@ -111,9 +111,9 @@ static TICK_TYPE HCe_start_time, HCe_tot_time = 0; // heap census prof elap ti #define PROF_VAL(x) 0 #endif -lnat MaxResidency = 0; /* in words; for stats only */ -lnat AvgResidency = 0; -lnat ResidencySamples = 0; /* for stats only */ +static lnat MaxResidency = 0; // in words; for stats only +static lnat AvgResidency = 0; +static lnat ResidencySamples = 0; // for stats only static lnat GC_start_faults = 0, GC_end_faults = 0; @@ -579,7 +579,7 @@ stat_endHeapCensus(void) stats for this thread into the task_ids struct for that thread. -------------------------------------------------------------------------- */ -#ifdef SMP +#if defined(SMP) void stat_workerStop(void) { @@ -599,7 +599,9 @@ stat_workerStop(void) } } } +#endif +#if defined(SMP) long int stat_getElapsedTime () { getTimes(); @@ -747,7 +749,8 @@ stat_exit(int alloc) fprintf(sf, "<>\n", total_collections, - AvgResidency*sizeof(W_)/ResidencySamples, + ResidencySamples == 0 ? 0 : + AvgResidency*sizeof(W_)/ResidencySamples, MaxResidency*sizeof(W_), ResidencySamples, (unsigned long)(mblocks_allocated * MBLOCK_SIZE / (1024L * 1024L)),