1 /* -----------------------------------------------------------------------------
3 * (c) The GHC Team, 1998-2005
5 * Statistics and timing-related functions.
7 * ---------------------------------------------------------------------------*/
9 /* Alas, no. This source is non-posix.
10 #include "PosixSource.h"
19 #include "ParTicky.h" /* ToDo: move into Rts.h */
20 #include "Profiling.h"
27 #ifndef mingw32_HOST_OS
28 # ifdef HAVE_SYS_TIMES_H
29 # include <sys/times.h>
33 #ifdef HAVE_SYS_TIME_H
43 #if ! irix_HOST_OS && ! defined(mingw32_HOST_OS)
44 # if defined(HAVE_SYS_RESOURCE_H)
45 # include <sys/resource.h>
49 #ifdef HAVE_SYS_TIMEB_H
50 #include <sys/timeb.h>
61 #if defined(PAR) || !(!defined(HAVE_GETRUSAGE) || irix_HOST_OS || defined(mingw32_HOST_OS) || defined(cygwin32_HOST_OS))
62 #include <sys/resource.h>
66 #define BIG_STRING_LEN 512
68 /* We're not trying to be terribly accurate here, using the
69 * basic times() function to get a resolution of about 100ths of a
70 * second, depending on the OS. A long int will do fine for holding
73 #define TICK_TYPE long int
74 #define TICK_TO_DBL(t) ((double)(t) / TicksPerSecond)
76 static int TicksPerSecond = 0;
78 static TICK_TYPE ElapsedTimeStart = 0;
80 static TICK_TYPE InitUserTime = 0;
81 static TICK_TYPE InitElapsedTime = 0;
82 static TICK_TYPE InitElapsedStamp = 0;
84 static TICK_TYPE MutUserTime = 0;
85 static TICK_TYPE MutElapsedTime = 0;
86 static TICK_TYPE MutElapsedStamp = 0;
88 static TICK_TYPE ExitUserTime = 0;
89 static TICK_TYPE ExitElapsedTime = 0;
91 static ullong GC_tot_alloc = 0;
92 static ullong GC_tot_copied = 0;
93 static ullong GC_tot_scavd_copied = 0;
95 static TICK_TYPE GC_start_time = 0, GC_tot_time = 0; /* User GC Time */
96 static TICK_TYPE GCe_start_time = 0, GCe_tot_time = 0; /* Elapsed GC time */
99 static TICK_TYPE RP_start_time = 0, RP_tot_time = 0; /* retainer prof user time */
100 static TICK_TYPE RPe_start_time = 0, RPe_tot_time = 0; /* retainer prof elap time */
102 static TICK_TYPE HC_start_time, HC_tot_time = 0; // heap census prof user time
103 static TICK_TYPE HCe_start_time, HCe_tot_time = 0; // heap census prof elap time
107 #define PROF_VAL(x) (x)
109 #define PROF_VAL(x) 0
112 static lnat MaxResidency = 0; // in words; for stats only
113 static lnat AvgResidency = 0;
114 static lnat ResidencySamples = 0; // for stats only
116 static lnat GC_start_faults = 0, GC_end_faults = 0;
118 static TICK_TYPE *GC_coll_times;
120 static void getTimes( long *elapsed, long *user );
121 static nat pageFaults(void);
123 static void statsPrintf( char *s, ... )
124 GNUC3_ATTRIBUTE(format (printf, 1, 2));
126 static void statsFlush( void );
127 static void statsClose( void );
129 /* elapsedtime() -- The current elapsed time in seconds */
131 #if defined(mingw32_HOST_OS) || defined(cygwin32_HOST_OS)
132 #define HNS_PER_SEC 10000000LL /* FILETIMES are in units of 100ns */
133 /* Convert FILETIMEs into secs */
134 #define FT2longlong(ll,ft) \
135 (ll)=(ft).dwHighDateTime; \
137 (ll) |= (ft).dwLowDateTime; \
138 (ll) /= (unsigned long long) (HNS_PER_SEC / CLOCKS_PER_SEC)
141 #if defined(mingw32_HOST_OS) || defined(cygwin32_HOST_OS)
142 /* cygwin32 or mingw32 version */
144 getTimes( TICK_TYPE *elapsed, TICK_TYPE *user )
146 static int is_win9x = -1;
148 FILETIME creationTime, exitTime, userTime, kernelTime = {0,0};
149 long long int kT, uT;
152 /* figure out whether we're on a Win9x box or not. */
156 /* Need to init the size field first.*/
157 oi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
158 b = GetVersionEx(&oi);
160 is_win9x = ( (b && (oi.dwPlatformId & VER_PLATFORM_WIN32_WINDOWS)) ? 1 : 0);
164 /* On Win9x, just attribute all running time to the user. */
168 SystemTimeToFileTime(&st,&userTime);
170 /* ToDo: pin down elapsed times to just the OS thread(s) that
171 are evaluating/managing Haskell code.
173 if (!GetProcessTimes (GetCurrentProcess(), &creationTime,
174 &exitTime, &kernelTime, &userTime)) {
175 /* Probably on a Win95 box..*/
182 FT2longlong(kT,kernelTime);
183 FT2longlong(uT,userTime);
188 /* Adjust for the fact that we're using system time & not
189 process time on Win9x. */
190 *user -= ElapsedTimeStart;
191 *elapsed -= ElapsedTimeStart;
198 getTimes( TICK_TYPE *user, TICK_TYPE *elapsed )
202 /* We will #ifdef around the fprintf for machines
203 we *know* are unsupported. (WDP 94/05)
205 debugBelch("NOTE: `getTimes' does nothing!\n");
208 #else /* not stumped */
210 clock_t r = times(&t);
218 /* mut_user_time_during_GC() and mut_user_time()
220 * The former function can be used to get the current mutator time
221 * *during* a GC, i.e. between stat_startGC and stat_endGC. This is
222 * used in the heap profiler for accurately time stamping the heap
225 * ATTENTION: mut_user_time_during_GC() relies on GC_start_time being
226 * defined in stat_startGC() - to minimise system calls,
227 * GC_start_time is, however, only defined when really needed (check
228 * stat_startGC() for details)
231 mut_user_time_during_GC( void )
233 return TICK_TO_DBL(GC_start_time - GC_tot_time - PROF_VAL(RP_tot_time + HC_tot_time));
237 mut_user_time( void )
239 TICK_TYPE user, elapsed;
240 getTimes(&user, &elapsed);
241 return TICK_TO_DBL(user - GC_tot_time - PROF_VAL(RP_tot_time + HC_tot_time));
246 mut_user_time_during_RP() is similar to mut_user_time_during_GC();
247 it returns the MUT time during retainer profiling.
248 The same is for mut_user_time_during_HC();
251 mut_user_time_during_RP( void )
253 return TICK_TO_DBL(RP_start_time - GC_tot_time - RP_tot_time - HC_tot_time);
257 mut_user_time_during_heap_census( void )
259 return TICK_TO_DBL(HC_start_time - GC_tot_time - RP_tot_time - HC_tot_time);
261 #endif /* PROFILING */
266 /* ToDo (on NT): better, get this via the performance data
267 that's stored in the registry. */
268 # if !defined(HAVE_GETRUSAGE) || irix_HOST_OS || defined(mingw32_HOST_OS) || defined(cygwin32_HOST_OS)
273 getrusage(RUSAGE_SELF, &t);
283 if (RtsFlags.GcFlags.giveStats >= VERBOSE_GC_STATS) {
284 statsPrintf(" Alloc Collect Live GC GC TOT TOT Page Flts\n");
285 statsPrintf(" bytes bytes bytes user elap user elap\n");
288 (TICK_TYPE *)stgMallocBytes(
289 sizeof(TICK_TYPE)*RtsFlags.GcFlags.generations,
291 for (i = 0; i < RtsFlags.GcFlags.generations; i++) {
292 GC_coll_times[i] = 0;
296 /* -----------------------------------------------------------------------------
297 Initialisation time...
298 -------------------------------------------------------------------------- */
303 TICK_TYPE user, elapsed;
305 /* Determine TicksPerSecond ... */
306 #if defined(CLK_TCK) /* defined by POSIX */
307 TicksPerSecond = CLK_TCK;
309 #elif defined(HAVE_SYSCONF)
312 ticks = sysconf(_SC_CLK_TCK);
314 debugBelch("stat_init: bad call to 'sysconf'!\n");
315 stg_exit(EXIT_FAILURE);
317 TicksPerSecond = ticks;
319 /* no "sysconf" or CLK_TCK; had better guess */
323 #elif defined(CLOCKS_PER_SEC)
324 TicksPerSecond = CLOCKS_PER_SEC;
326 #else /* had better guess wildly */
327 /* We will #ifdef around the fprintf for machines
328 we *know* are unsupported. (WDP 94/05)
330 debugBelch("NOTE: Guessing `TicksPerSecond = 60'!\n");
334 getTimes( &user, &elapsed );
335 ElapsedTimeStart = elapsed;
341 TICK_TYPE user, elapsed;
342 getTimes( &user, &elapsed );
344 InitElapsedStamp = elapsed;
345 if (ElapsedTimeStart > elapsed) {
348 InitElapsedTime = elapsed - ElapsedTimeStart;
352 /* -----------------------------------------------------------------------------
353 stat_startExit and stat_endExit
355 These two measure the time taken in shutdownHaskell().
356 -------------------------------------------------------------------------- */
361 TICK_TYPE user, elapsed;
362 getTimes( &user, &elapsed );
364 MutElapsedStamp = elapsed;
365 MutElapsedTime = elapsed - GCe_tot_time -
366 PROF_VAL(RPe_tot_time + HCe_tot_time) - InitElapsedStamp;
367 if (MutElapsedTime < 0) { MutElapsedTime = 0; } /* sometimes -0.00 */
369 /* for threads, we don't know the mutator time yet, we have to inspect
370 * all the running threads to find out, and they haven't stopped
371 * yet. So we just timestamp MutUserTime at this point so we can
372 * calculate the EXIT time. The real MutUserTime is calculated
373 * in stat_exit below.
375 #if defined(THREADED_RTS)
378 MutUserTime = user - GC_tot_time - PROF_VAL(RP_tot_time + HC_tot_time) - InitUserTime;
379 if (MutUserTime < 0) { MutUserTime = 0; }
386 TICK_TYPE user, elapsed;
387 getTimes( &user, &elapsed );
389 #if defined(THREADED_RTS)
390 ExitUserTime = user - MutUserTime;
392 ExitUserTime = user - MutUserTime - GC_tot_time - PROF_VAL(RP_tot_time + HC_tot_time) - InitUserTime;
394 ExitElapsedTime = elapsed - MutElapsedStamp;
395 if (ExitUserTime < 0) {
398 if (ExitElapsedTime < 0) {
403 /* -----------------------------------------------------------------------------
404 Called at the beginning of each GC
405 -------------------------------------------------------------------------- */
407 static nat rub_bell = 0;
409 /* initialise global variables needed during GC
411 * * GC_start_time is read in mut_user_time_during_GC(), which in turn is
412 * needed if either PROFILING or DEBUGing is enabled
417 nat bell = RtsFlags.GcFlags.ringBell;
418 TICK_TYPE user, elapsed;
430 #if defined(PROFILING) || defined(DEBUG)
431 getTimes( &user, &elapsed );
432 GC_start_time = user; /* needed in mut_user_time_during_GC() */
435 if (RtsFlags.GcFlags.giveStats != NO_GC_STATS) {
436 #if !defined(PROFILING) && !defined(DEBUG)
437 getTimes( &user, &elapsed );
438 GC_start_time = user;
440 GCe_start_time = elapsed;
441 if (RtsFlags.GcFlags.giveStats) {
442 GC_start_faults = pageFaults();
447 /* -----------------------------------------------------------------------------
448 Called at the end of each GC
449 -------------------------------------------------------------------------- */
452 stat_endGC (lnat alloc, lnat collect, lnat live, lnat copied,
453 lnat scavd_copied, lnat gen)
455 TICK_TYPE user, elapsed;
457 if (RtsFlags.GcFlags.giveStats != NO_GC_STATS) {
458 TICK_TYPE time, etime, gc_time, gc_etime;
460 getTimes( &user, &elapsed );
463 gc_time = time - GC_start_time;
464 gc_etime = etime - GCe_start_time;
466 if (RtsFlags.GcFlags.giveStats == VERBOSE_GC_STATS) {
467 nat faults = pageFaults();
469 statsPrintf("%9ld %9ld %9ld",
470 alloc*sizeof(W_), collect*sizeof(W_), live*sizeof(W_));
471 statsPrintf(" %5.2f %5.2f %7.2f %7.2f %4ld %4ld (Gen: %2ld)\n",
472 TICK_TO_DBL(gc_time),
473 TICK_TO_DBL(gc_etime),
475 TICK_TO_DBL(etime - ElapsedTimeStart),
476 faults - GC_start_faults,
477 GC_start_faults - GC_end_faults,
480 GC_end_faults = faults;
484 GC_coll_times[gen] += gc_time;
486 GC_tot_copied += (ullong) copied;
487 GC_tot_scavd_copied += (ullong) scavd_copied;
488 GC_tot_alloc += (ullong) alloc;
489 GC_tot_time += gc_time;
490 GCe_tot_time += gc_etime;
492 #if defined(THREADED_RTS)
495 if ((task = myTask()) != NULL) {
496 task->gc_time += gc_time;
497 task->gc_etime += gc_etime;
502 if (gen == RtsFlags.GcFlags.generations-1) { /* major GC? */
503 if (live > MaxResidency) {
507 AvgResidency += live;
512 debugBelch("\b\b\b \b\b\b");
517 /* -----------------------------------------------------------------------------
518 Called at the beginning of each Retainer Profiliing
519 -------------------------------------------------------------------------- */
524 TICK_TYPE user, elapsed;
525 getTimes( &user, &elapsed );
527 RP_start_time = user;
528 RPe_start_time = elapsed;
530 #endif /* PROFILING */
532 /* -----------------------------------------------------------------------------
533 Called at the end of each Retainer Profiliing
534 -------------------------------------------------------------------------- */
539 nat retainerGeneration,
540 #ifdef DEBUG_RETAINER
544 double averageNumVisit)
546 TICK_TYPE user, elapsed;
547 getTimes( &user, &elapsed );
549 RP_tot_time += user - RP_start_time;
550 RPe_tot_time += elapsed - RPe_start_time;
552 fprintf(prof_file, "Retainer Profiling: %d, at %f seconds\n",
553 retainerGeneration, mut_user_time_during_RP());
554 #ifdef DEBUG_RETAINER
555 fprintf(prof_file, "\tMax C stack size = %u\n", maxCStackSize);
556 fprintf(prof_file, "\tMax auxiliary stack size = %u\n", maxStackSize);
558 fprintf(prof_file, "\tAverage number of visits per object = %f\n", averageNumVisit);
560 #endif /* PROFILING */
562 /* -----------------------------------------------------------------------------
563 Called at the beginning of each heap census
564 -------------------------------------------------------------------------- */
567 stat_startHeapCensus(void)
569 TICK_TYPE user, elapsed;
570 getTimes( &user, &elapsed );
572 HC_start_time = user;
573 HCe_start_time = elapsed;
575 #endif /* PROFILING */
577 /* -----------------------------------------------------------------------------
578 Called at the end of each heap census
579 -------------------------------------------------------------------------- */
582 stat_endHeapCensus(void)
584 TICK_TYPE user, elapsed;
585 getTimes( &user, &elapsed );
587 HC_tot_time += user - HC_start_time;
588 HCe_tot_time += elapsed - HCe_start_time;
590 #endif /* PROFILING */
592 /* -----------------------------------------------------------------------------
595 Called under SMP when a worker thread finishes. We drop the timing
596 stats for this thread into the taskTable struct for that thread.
597 -------------------------------------------------------------------------- */
600 stat_getTimes ( long *currentElapsedTime,
601 long *currentUserTime,
602 long *elapsedGCTime )
604 getTimes(currentUserTime, currentElapsedTime);
605 *elapsedGCTime = GCe_tot_time;
608 /* -----------------------------------------------------------------------------
609 Called at the end of execution
611 NOTE: number of allocations is not entirely accurate: it doesn't
612 take into account the few bytes at the end of the heap that
613 were left unused when the heap-check failed.
614 -------------------------------------------------------------------------- */
619 TICK_TYPE user, elapsed;
621 if (RtsFlags.GcFlags.giveStats != NO_GC_STATS) {
623 char temp[BIG_STRING_LEN];
626 nat g, total_collections = 0;
628 getTimes( &user, &elapsed );
629 etime = elapsed - ElapsedTimeStart;
631 GC_tot_alloc += alloc;
633 /* Count total garbage collections */
634 for (g = 0; g < RtsFlags.GcFlags.generations; g++)
635 total_collections += generations[g].collections;
637 /* For THREADED_RTS, we have to get the user time from each Task
638 * and try to work out the total time.
640 #if defined(THREADED_RTS)
644 for (task = all_tasks; task != NULL; task = task->all_link) {
645 MutUserTime += task->mut_time;
648 time = MutUserTime + GC_tot_time + InitUserTime + ExitUserTime;
649 if (MutUserTime < 0) { MutUserTime = 0; }
654 /* avoid divide by zero if time is measured as 0.00 seconds -- SDM */
655 if (time == 0.0) time = 1;
656 if (etime == 0.0) etime = 1;
658 if (RtsFlags.GcFlags.giveStats >= VERBOSE_GC_STATS) {
659 statsPrintf("%9ld %9.9s %9.9s", (lnat)alloc*sizeof(W_), "", "");
660 statsPrintf(" %5.2f %5.2f\n\n", 0.0, 0.0);
663 if (RtsFlags.GcFlags.giveStats >= SUMMARY_GC_STATS) {
664 ullong_format_string(GC_tot_alloc*sizeof(W_),
665 temp, rtsTrue/*commas*/);
666 statsPrintf("%11s bytes allocated in the heap\n", temp);
668 ullong_format_string(GC_tot_copied*sizeof(W_),
669 temp, rtsTrue/*commas*/);
670 statsPrintf("%11s bytes copied during GC (scavenged)\n", temp);
672 ullong_format_string(GC_tot_scavd_copied*sizeof(W_),
673 temp, rtsTrue/*commas*/);
674 statsPrintf("%11s bytes copied during GC (not scavenged)\n", temp);
676 if ( ResidencySamples > 0 ) {
677 ullong_format_string(MaxResidency*sizeof(W_),
678 temp, rtsTrue/*commas*/);
679 statsPrintf("%11s bytes maximum residency (%ld sample(s))\n",
680 temp, ResidencySamples);
684 /* Print garbage collections in each gen */
685 for (g = 0; g < RtsFlags.GcFlags.generations; g++) {
686 statsPrintf("%11d collections in generation %d (%6.2fs)\n",
687 generations[g].collections, g,
688 TICK_TO_DBL(GC_coll_times[g]));
691 statsPrintf("\n%11ld Mb total memory in use\n\n",
692 mblocks_allocated * MBLOCK_SIZE / (1024 * 1024));
694 #if defined(THREADED_RTS)
698 for (i = 0, task = all_tasks;
700 i++, task = task->all_link) {
701 statsPrintf(" Task %2d %-8s : MUT time: %6.2fs (%6.2fs elapsed)\n"
702 " GC time: %6.2fs (%6.2fs elapsed)\n\n",
704 (task->tso == NULL) ? "(worker)" : "(bound)",
705 TICK_TO_DBL(task->mut_time),
706 TICK_TO_DBL(task->mut_etime),
707 TICK_TO_DBL(task->gc_time),
708 TICK_TO_DBL(task->gc_etime));
713 statsPrintf(" INIT time %6.2fs (%6.2fs elapsed)\n",
714 TICK_TO_DBL(InitUserTime), TICK_TO_DBL(InitElapsedTime));
715 statsPrintf(" MUT time %6.2fs (%6.2fs elapsed)\n",
716 TICK_TO_DBL(MutUserTime), TICK_TO_DBL(MutElapsedTime));
717 statsPrintf(" GC time %6.2fs (%6.2fs elapsed)\n",
718 TICK_TO_DBL(GC_tot_time), TICK_TO_DBL(GCe_tot_time));
720 statsPrintf(" RP time %6.2fs (%6.2fs elapsed)\n",
721 TICK_TO_DBL(RP_tot_time), TICK_TO_DBL(RPe_tot_time));
722 statsPrintf(" PROF time %6.2fs (%6.2fs elapsed)\n",
723 TICK_TO_DBL(HC_tot_time), TICK_TO_DBL(HCe_tot_time));
725 statsPrintf(" EXIT time %6.2fs (%6.2fs elapsed)\n",
726 TICK_TO_DBL(ExitUserTime), TICK_TO_DBL(ExitElapsedTime));
727 statsPrintf(" Total time %6.2fs (%6.2fs elapsed)\n\n",
728 TICK_TO_DBL(time), TICK_TO_DBL(etime));
729 statsPrintf(" %%GC time %5.1f%% (%.1f%% elapsed)\n\n",
730 TICK_TO_DBL(GC_tot_time)*100/TICK_TO_DBL(time),
731 TICK_TO_DBL(GCe_tot_time)*100/TICK_TO_DBL(etime));
733 if (time - GC_tot_time - PROF_VAL(RP_tot_time + HC_tot_time) == 0)
734 ullong_format_string(0, temp, rtsTrue/*commas*/);
736 ullong_format_string(
737 (ullong)((GC_tot_alloc*sizeof(W_))/
738 TICK_TO_DBL(time - GC_tot_time -
739 PROF_VAL(RP_tot_time + HC_tot_time))),
740 temp, rtsTrue/*commas*/);
742 statsPrintf(" Alloc rate %s bytes per MUT second\n\n", temp);
744 statsPrintf(" Productivity %5.1f%% of total user, %.1f%% of total elapsed\n\n",
745 TICK_TO_DBL(time - GC_tot_time -
746 PROF_VAL(RP_tot_time + HC_tot_time) - InitUserTime) * 100
748 TICK_TO_DBL(time - GC_tot_time -
749 PROF_VAL(RP_tot_time + HC_tot_time) - InitUserTime) * 100
750 / TICK_TO_DBL(etime));
753 if (RtsFlags.GcFlags.giveStats == ONELINE_GC_STATS) {
754 /* print the long long separately to avoid bugginess on mingwin (2001-07-02, mingw-0.5) */
755 statsPrintf("<<ghc: %llu bytes, ", GC_tot_alloc*(ullong)sizeof(W_));
756 statsPrintf("%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",
758 ResidencySamples == 0 ? 0 :
759 AvgResidency*sizeof(W_)/ResidencySamples,
760 MaxResidency*sizeof(W_),
762 (unsigned long)(mblocks_allocated * MBLOCK_SIZE / (1024L * 1024L)),
763 TICK_TO_DBL(InitUserTime), TICK_TO_DBL(InitElapsedTime),
764 TICK_TO_DBL(MutUserTime), TICK_TO_DBL(MutElapsedTime),
765 TICK_TO_DBL(GC_tot_time), TICK_TO_DBL(GCe_tot_time));
773 /* -----------------------------------------------------------------------------
776 Produce some detailed info on the state of the generational GC.
777 -------------------------------------------------------------------------- */
780 statDescribeGens(void)
782 nat g, s, mut, lge, live;
787 " Gen Steps Max Mutable Step Blocks Live Large\n"
788 " Blocks Closures Objects\n");
791 for (g = 0; g < RtsFlags.GcFlags.generations; g++) {
792 for (bd = generations[g].mut_list; bd != NULL; bd = bd->link) {
793 mut += bd->free - bd->start;
796 debugBelch("%8d %8d %8d %9d", g, generations[g].n_steps,
797 generations[g].max_blocks, mut);
799 for (s = 0; s < generations[g].n_steps; s++) {
800 step = &generations[g].steps[s];
801 for (bd = step->large_objects, lge = 0; bd; bd = bd->link)
805 for (; bd; bd = bd->link) {
806 live += (bd->free - bd->start) * sizeof(W_);
809 debugBelch("%36s","");
811 debugBelch("%6d %8d %8d %8d\n", s, step->n_blocks,
819 /* -----------------------------------------------------------------------------
820 Stats available via a programmatic interface, so eg. GHCi can time
821 each compilation and expression evaluation.
822 -------------------------------------------------------------------------- */
824 extern HsInt64 getAllocations( void )
825 { return (HsInt64)total_allocated * sizeof(W_); }
827 /* -----------------------------------------------------------------------------
828 Dumping stuff in the stats file, or via the debug message interface
829 -------------------------------------------------------------------------- */
832 statsPrintf( char *s, ... )
834 FILE *sf = RtsFlags.GcFlags.statsFile;
849 FILE *sf = RtsFlags.GcFlags.statsFile;
858 FILE *sf = RtsFlags.GcFlags.statsFile;