X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Frts%2FStats.c;h=4920b4b88f0cd50f430b475f945be6dbbd88c229;hb=5ef7bcaa0b87744d3fc6eb6a076db0b76a40a625;hp=5052e260e0dc292c09e57ec02c9877a5214f6a5f;hpb=7f906dc8d0aa5505fd35b1eda25feb12c6f42bf8;p=ghc-hetmet.git diff --git a/ghc/rts/Stats.c b/ghc/rts/Stats.c index 5052e26..4920b4b 100644 --- a/ghc/rts/Stats.c +++ b/ghc/rts/Stats.c @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------------- - * $Id: Stats.c,v 1.44 2002/02/06 01:21:40 sof Exp $ + * $Id: Stats.c,v 1.48 2004/08/13 13:10:45 simonmar Exp $ * * (c) The GHC Team, 1998-1999 * @@ -14,12 +14,12 @@ #include "Rts.h" #include "RtsFlags.h" #include "RtsUtils.h" -#include "StoragePriv.h" #include "MBlock.h" #include "Schedule.h" #include "Stats.h" #include "ParTicky.h" /* ToDo: move into Rts.h */ #include "Profiling.h" +#include "Storage.h" #ifdef HAVE_UNISTD_H #include @@ -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; @@ -749,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)), @@ -820,5 +821,5 @@ statDescribeGens(void) each compilation and expression evaluation. -------------------------------------------------------------------------- */ -extern HsInt getAllocations( void ) -{ return (HsInt)(total_allocated * sizeof(W_)); } +extern HsInt64 getAllocations( void ) +{ return (HsInt64)total_allocated * sizeof(W_); }