/* -----------------------------------------------------------------------------
- * $Id: Stats.c,v 1.43 2002/02/04 20:12:08 sof Exp $
+ * $Id: Stats.c,v 1.46 2002/08/19 16:02:26 simonmar Exp $
*
* (c) The GHC Team, 1998-1999
*
#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;
}
#endif
-#if defined(RTS_SUPPORTS_THREADS)
+#if defined(SMP)
long int stat_getElapsedTime ()
{
getTimes();
fprintf(sf, "<<ghc: %llu bytes, ", GC_tot_alloc*sizeof(W_));
fprintf(sf, "%d GCs, %ld/%ld avg/max bytes residency (%ld samples), %luM in use, %.2f INIT (%.2f elapsed), %.2f MUT (%.2f elapsed), %.2f GC (%.2f elapsed) :ghc>>\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)),