1 /* -----------------------------------------------------------------------------
3 * (c) The GHC Team, 1998-2004
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"
28 #ifndef mingw32_HOST_OS
29 # ifdef HAVE_SYS_TIMES_H
30 # include <sys/times.h>
34 #ifdef HAVE_SYS_TIME_H
44 #if ! irix_HOST_OS && ! defined(mingw32_HOST_OS)
45 # if defined(HAVE_SYS_RESOURCE_H)
46 # include <sys/resource.h>
50 #ifdef HAVE_SYS_TIMEB_H
51 #include <sys/timeb.h>
62 #if defined(PAR) || !(!defined(HAVE_GETRUSAGE) || irix_HOST_OS || defined(mingw32_HOST_OS) || defined(cygwin32_HOST_OS))
63 #include <sys/resource.h>
67 #define BIG_STRING_LEN 512
69 /* We're not trying to be terribly accurate here, using the
70 * basic times() function to get a resolution of about 100ths of a
71 * second, depending on the OS. A long int will do fine for holding
74 #define TICK_TYPE long int
75 #define TICK_TO_DBL(t) ((double)(t) / TicksPerSecond)
77 static int TicksPerSecond = 0;
79 static TICK_TYPE ElapsedTimeStart = 0;
81 static TICK_TYPE InitUserTime = 0;
82 static TICK_TYPE InitElapsedTime = 0;
83 static TICK_TYPE InitElapsedStamp = 0;
85 static TICK_TYPE MutUserTime = 0;
86 static TICK_TYPE MutElapsedTime = 0;
87 static TICK_TYPE MutElapsedStamp = 0;
89 static TICK_TYPE ExitUserTime = 0;
90 static TICK_TYPE ExitElapsedTime = 0;
92 static ullong GC_tot_alloc = 0;
93 static ullong GC_tot_copied = 0;
94 static ullong GC_tot_scavd_copied = 0;
96 static TICK_TYPE GC_start_time = 0, GC_tot_time = 0; /* User GC Time */
97 static TICK_TYPE GCe_start_time = 0, GCe_tot_time = 0; /* Elapsed GC time */
100 static TICK_TYPE RP_start_time = 0, RP_tot_time = 0; /* retainer prof user time */
101 static TICK_TYPE RPe_start_time = 0, RPe_tot_time = 0; /* retainer prof elap time */
103 static TICK_TYPE HC_start_time, HC_tot_time = 0; // heap census prof user time
104 static TICK_TYPE HCe_start_time, HCe_tot_time = 0; // heap census prof elap time
108 #define PROF_VAL(x) (x)
110 #define PROF_VAL(x) 0
113 static lnat MaxResidency = 0; // in words; for stats only
114 static lnat AvgResidency = 0;
115 static lnat ResidencySamples = 0; // for stats only
117 static lnat GC_start_faults = 0, GC_end_faults = 0;
119 static TICK_TYPE *GC_coll_times;
121 static void getTimes( long *elapsed, long *user );
122 static nat pageFaults(void);
124 static void statsPrintf( char *s, ... )
125 GNUC3_ATTRIBUTE(format (printf, 1, 2));
127 static void statsFlush( void );
128 static void statsClose( void );
130 /* elapsedtime() -- The current elapsed time in seconds */
132 #if defined(mingw32_HOST_OS) || defined(cygwin32_HOST_OS)
133 #define HNS_PER_SEC 10000000LL /* FILETIMES are in units of 100ns */
134 /* Convert FILETIMEs into secs */
135 #define FT2longlong(ll,ft) \
136 (ll)=(ft).dwHighDateTime; \
138 (ll) |= (ft).dwLowDateTime; \
139 (ll) /= (unsigned long long) (HNS_PER_SEC / CLOCKS_PER_SEC)
142 #if defined(mingw32_HOST_OS) || defined(cygwin32_HOST_OS)
143 /* cygwin32 or mingw32 version */
145 getTimes( TICK_TYPE *elapsed, TICK_TYPE *user )
147 static int is_win9x = -1;
149 FILETIME creationTime, exitTime, userTime, kernelTime = {0,0};
150 long long int kT, uT;
153 /* figure out whether we're on a Win9x box or not. */
157 /* Need to init the size field first.*/
158 oi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
159 b = GetVersionEx(&oi);
161 is_win9x = ( (b && (oi.dwPlatformId & VER_PLATFORM_WIN32_WINDOWS)) ? 1 : 0);
165 /* On Win9x, just attribute all running time to the user. */
169 SystemTimeToFileTime(&st,&userTime);
171 /* ToDo: pin down elapsed times to just the OS thread(s) that
172 are evaluating/managing Haskell code.
174 if (!GetProcessTimes (GetCurrentProcess(), &creationTime,
175 &exitTime, &kernelTime, &userTime)) {
176 /* Probably on a Win95 box..*/
183 FT2longlong(kT,kernelTime);
184 FT2longlong(uT,userTime);
189 /* Adjust for the fact that we're using system time & not
190 process time on Win9x. */
191 *user -= ElapsedTimeStart;
192 *elapsed -= ElapsedTimeStart;
199 getTimes( TICK_TYPE *user, TICK_TYPE *elapsed )
203 /* We will #ifdef around the fprintf for machines
204 we *know* are unsupported. (WDP 94/05)
206 debugBelch("NOTE: `getTimes' does nothing!\n");
209 #else /* not stumped */
211 clock_t r = times(&t);
219 /* mut_user_time_during_GC() and mut_user_time()
221 * The former function can be used to get the current mutator time
222 * *during* a GC, i.e. between stat_startGC and stat_endGC. This is
223 * used in the heap profiler for accurately time stamping the heap
226 * ATTENTION: mut_user_time_during_GC() relies on GC_start_time being
227 * defined in stat_startGC() - to minimise system calls,
228 * GC_start_time is, however, only defined when really needed (check
229 * stat_startGC() for details)
232 mut_user_time_during_GC( void )
234 return TICK_TO_DBL(GC_start_time - GC_tot_time - PROF_VAL(RP_tot_time + HC_tot_time));
238 mut_user_time( void )
240 TICK_TYPE user, elapsed;
241 getTimes(&user, &elapsed);
242 return TICK_TO_DBL(user - GC_tot_time - PROF_VAL(RP_tot_time + HC_tot_time));
247 mut_user_time_during_RP() is similar to mut_user_time_during_GC();
248 it returns the MUT time during retainer profiling.
249 The same is for mut_user_time_during_HC();
252 mut_user_time_during_RP( void )
254 return TICK_TO_DBL(RP_start_time - GC_tot_time - RP_tot_time - HC_tot_time);
258 mut_user_time_during_heap_census( void )
260 return TICK_TO_DBL(HC_start_time - GC_tot_time - RP_tot_time - HC_tot_time);
262 #endif /* PROFILING */
267 /* ToDo (on NT): better, get this via the performance data
268 that's stored in the registry. */
269 # if !defined(HAVE_GETRUSAGE) || irix_HOST_OS || defined(mingw32_HOST_OS) || defined(cygwin32_HOST_OS)
274 getrusage(RUSAGE_SELF, &t);
284 if (RtsFlags.GcFlags.giveStats >= VERBOSE_GC_STATS) {
285 statsPrintf(" Alloc Collect Live GC GC TOT TOT Page Flts\n");
286 statsPrintf(" bytes bytes bytes user elap user elap\n");
289 (TICK_TYPE *)stgMallocBytes(
290 sizeof(TICK_TYPE)*RtsFlags.GcFlags.generations,
292 for (i = 0; i < RtsFlags.GcFlags.generations; i++) {
293 GC_coll_times[i] = 0;
297 /* -----------------------------------------------------------------------------
298 Initialisation time...
299 -------------------------------------------------------------------------- */
304 TICK_TYPE user, elapsed;
306 /* Determine TicksPerSecond ... */
307 #if defined(CLK_TCK) /* defined by POSIX */
308 TicksPerSecond = CLK_TCK;
310 #elif defined(HAVE_SYSCONF)
313 ticks = sysconf(_SC_CLK_TCK);
315 debugBelch("stat_init: bad call to 'sysconf'!\n");
316 stg_exit(EXIT_FAILURE);
318 TicksPerSecond = ticks;
320 /* no "sysconf" or CLK_TCK; had better guess */
324 #elif defined(CLOCKS_PER_SEC)
325 TicksPerSecond = CLOCKS_PER_SEC;
327 #else /* had better guess wildly */
328 /* We will #ifdef around the fprintf for machines
329 we *know* are unsupported. (WDP 94/05)
331 debugBelch("NOTE: Guessing `TicksPerSecond = 60'!\n");
335 getTimes( &user, &elapsed );
336 ElapsedTimeStart = elapsed;
342 TICK_TYPE user, elapsed;
343 getTimes( &user, &elapsed );
345 InitElapsedStamp = elapsed;
346 if (ElapsedTimeStart > elapsed) {
349 InitElapsedTime = elapsed - ElapsedTimeStart;
353 /* -----------------------------------------------------------------------------
354 stat_startExit and stat_endExit
356 These two measure the time taken in shutdownHaskell().
357 -------------------------------------------------------------------------- */
362 TICK_TYPE user, elapsed;
363 getTimes( &user, &elapsed );
365 MutElapsedStamp = elapsed;
366 MutElapsedTime = elapsed - GCe_tot_time -
367 PROF_VAL(RPe_tot_time + HCe_tot_time) - InitElapsedStamp;
368 if (MutElapsedTime < 0) { MutElapsedTime = 0; } /* sometimes -0.00 */
370 /* for threads, we don't know the mutator time yet, we have to inspect
371 * all the running threads to find out, and they haven't stopped
372 * yet. So we just timestamp MutUserTime at this point so we can
373 * calculate the EXIT time. The real MutUserTime is calculated
374 * in stat_exit below.
376 #if defined(RTS_SUPPORTS_THREADS)
379 MutUserTime = user - GC_tot_time - PROF_VAL(RP_tot_time + HC_tot_time) - InitUserTime;
380 if (MutUserTime < 0) { MutUserTime = 0; }
387 TICK_TYPE user, elapsed;
388 getTimes( &user, &elapsed );
390 #if defined(RTS_SUPPORTS_THREADS)
391 ExitUserTime = user - MutUserTime;
393 ExitUserTime = user - MutUserTime - GC_tot_time - PROF_VAL(RP_tot_time + HC_tot_time) - InitUserTime;
395 ExitElapsedTime = elapsed - MutElapsedStamp;
396 if (ExitUserTime < 0) {
399 if (ExitElapsedTime < 0) {
404 /* -----------------------------------------------------------------------------
405 Called at the beginning of each GC
406 -------------------------------------------------------------------------- */
408 static nat rub_bell = 0;
410 /* initialise global variables needed during GC
412 * * GC_start_time is read in mut_user_time_during_GC(), which in turn is
413 * needed if either PROFILING or DEBUGing is enabled
418 nat bell = RtsFlags.GcFlags.ringBell;
419 TICK_TYPE user, elapsed;
431 #if defined(PROFILING) || defined(DEBUG)
432 getTimes( &user, &elapsed );
433 GC_start_time = user; /* needed in mut_user_time_during_GC() */
436 if (RtsFlags.GcFlags.giveStats != NO_GC_STATS) {
437 #if !defined(PROFILING) && !defined(DEBUG)
438 getTimes( &user, &elapsed );
439 GC_start_time = user;
441 GCe_start_time = elapsed;
442 if (RtsFlags.GcFlags.giveStats) {
443 GC_start_faults = pageFaults();
448 /* -----------------------------------------------------------------------------
449 Called at the end of each GC
450 -------------------------------------------------------------------------- */
453 stat_endGC(lnat alloc, lnat collect, lnat live, lnat copied, 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(RTS_SUPPORTS_THREADS)
494 TaskInfo *task_info = taskOfId(osThreadId());
496 if (task_info != NULL) {
497 task_info->gc_time += gc_time;
498 task_info->gc_etime += gc_etime;
503 if (gen == RtsFlags.GcFlags.generations-1) { /* major GC? */
504 if (live > MaxResidency) {
508 AvgResidency += live;
513 debugBelch("\b\b\b \b\b\b");
518 /* -----------------------------------------------------------------------------
519 Called at the beginning of each Retainer Profiliing
520 -------------------------------------------------------------------------- */
525 TICK_TYPE user, elapsed;
526 getTimes( &user, &elapsed );
528 RP_start_time = user;
529 RPe_start_time = elapsed;
531 #endif /* PROFILING */
533 /* -----------------------------------------------------------------------------
534 Called at the end of each Retainer Profiliing
535 -------------------------------------------------------------------------- */
540 nat retainerGeneration,
541 #ifdef DEBUG_RETAINER
545 double averageNumVisit)
547 TICK_TYPE user, elapsed;
548 getTimes( &user, &elapsed );
550 RP_tot_time += user - RP_start_time;
551 RPe_tot_time += elapsed - RPe_start_time;
553 fprintf(prof_file, "Retainer Profiling: %d, at %f seconds\n",
554 retainerGeneration, mut_user_time_during_RP());
555 #ifdef DEBUG_RETAINER
556 fprintf(prof_file, "\tMax C stack size = %u\n", maxCStackSize);
557 fprintf(prof_file, "\tMax auxiliary stack size = %u\n", maxStackSize);
559 fprintf(prof_file, "\tAverage number of visits per object = %f\n", averageNumVisit);
561 #endif /* PROFILING */
563 /* -----------------------------------------------------------------------------
564 Called at the beginning of each heap census
565 -------------------------------------------------------------------------- */
568 stat_startHeapCensus(void)
570 TICK_TYPE user, elapsed;
571 getTimes( &user, &elapsed );
573 HC_start_time = user;
574 HCe_start_time = elapsed;
576 #endif /* PROFILING */
578 /* -----------------------------------------------------------------------------
579 Called at the end of each heap census
580 -------------------------------------------------------------------------- */
583 stat_endHeapCensus(void)
585 TICK_TYPE user, elapsed;
586 getTimes( &user, &elapsed );
588 HC_tot_time += user - HC_start_time;
589 HCe_tot_time += elapsed - HCe_start_time;
591 #endif /* PROFILING */
593 /* -----------------------------------------------------------------------------
596 Called under SMP when a worker thread finishes. We drop the timing
597 stats for this thread into the taskTable struct for that thread.
598 -------------------------------------------------------------------------- */
601 stat_getTimes ( long *currentElapsedTime,
602 long *currentUserTime,
603 long *elapsedGCTime )
605 getTimes(currentUserTime, currentElapsedTime);
606 *elapsedGCTime = GCe_tot_time;
609 /* -----------------------------------------------------------------------------
610 Called at the end of execution
612 NOTE: number of allocations is not entirely accurate: it doesn't
613 take into account the few bytes at the end of the heap that
614 were left unused when the heap-check failed.
615 -------------------------------------------------------------------------- */
620 TICK_TYPE user, elapsed;
622 if (RtsFlags.GcFlags.giveStats != NO_GC_STATS) {
624 char temp[BIG_STRING_LEN];
627 nat g, total_collections = 0;
629 getTimes( &user, &elapsed );
630 etime = elapsed - ElapsedTimeStart;
632 GC_tot_alloc += alloc;
634 /* Count total garbage collections */
635 for (g = 0; g < RtsFlags.GcFlags.generations; g++)
636 total_collections += generations[g].collections;
638 /* For SMP, we have to get the user time from each thread
639 * and try to work out the total time.
641 #if defined(RTS_SUPPORTS_THREADS)
645 for (i = 0; i < taskCount; i++) {
646 MutUserTime += taskTable[i].mut_time;
649 time = MutUserTime + GC_tot_time + InitUserTime + ExitUserTime;
650 if (MutUserTime < 0) { MutUserTime = 0; }
655 /* avoid divide by zero if time is measured as 0.00 seconds -- SDM */
656 if (time == 0.0) time = 1;
657 if (etime == 0.0) etime = 1;
659 if (RtsFlags.GcFlags.giveStats >= VERBOSE_GC_STATS) {
660 statsPrintf("%9ld %9.9s %9.9s", (lnat)alloc*sizeof(W_), "", "");
661 statsPrintf(" %5.2f %5.2f\n\n", 0.0, 0.0);
664 if (RtsFlags.GcFlags.giveStats >= SUMMARY_GC_STATS) {
665 ullong_format_string(GC_tot_alloc*sizeof(W_),
666 temp, rtsTrue/*commas*/);
667 statsPrintf("%11s bytes allocated in the heap\n", temp);
669 ullong_format_string(GC_tot_copied*sizeof(W_),
670 temp, rtsTrue/*commas*/);
671 statsPrintf("%11s bytes copied during GC (scavenged)\n", temp);
673 ullong_format_string(GC_tot_scavd_copied*sizeof(W_),
674 temp, rtsTrue/*commas*/);
675 statsPrintf("%11s bytes copied during GC (not scavenged)\n", temp);
677 if ( ResidencySamples > 0 ) {
678 ullong_format_string(MaxResidency*sizeof(W_),
679 temp, rtsTrue/*commas*/);
680 statsPrintf("%11s bytes maximum residency (%ld sample(s))\n",
681 temp, ResidencySamples);
685 /* Print garbage collections in each gen */
686 for (g = 0; g < RtsFlags.GcFlags.generations; g++) {
687 statsPrintf("%11d collections in generation %d (%6.2fs)\n",
688 generations[g].collections, g,
689 TICK_TO_DBL(GC_coll_times[g]));
692 statsPrintf("\n%11ld Mb total memory in use\n\n",
693 mblocks_allocated * MBLOCK_SIZE / (1024 * 1024));
695 #if defined(RTS_SUPPORTS_THREADS)
698 for (i = 0; i < taskCount; i++) {
699 statsPrintf(" Task %2d %-8s : MUT time: %6.2fs (%6.2fs elapsed)\n"
700 " GC time: %6.2fs (%6.2fs elapsed)\n\n",
702 taskTable[i].is_worker ? "(worker)" : "(bound)",
703 TICK_TO_DBL(taskTable[i].mut_time),
704 TICK_TO_DBL(taskTable[i].mut_etime),
705 TICK_TO_DBL(taskTable[i].gc_time),
706 TICK_TO_DBL(taskTable[i].gc_etime));
711 statsPrintf(" INIT time %6.2fs (%6.2fs elapsed)\n",
712 TICK_TO_DBL(InitUserTime), TICK_TO_DBL(InitElapsedTime));
713 statsPrintf(" MUT time %6.2fs (%6.2fs elapsed)\n",
714 TICK_TO_DBL(MutUserTime), TICK_TO_DBL(MutElapsedTime));
715 statsPrintf(" GC time %6.2fs (%6.2fs elapsed)\n",
716 TICK_TO_DBL(GC_tot_time), TICK_TO_DBL(GCe_tot_time));
718 statsPrintf(" RP time %6.2fs (%6.2fs elapsed)\n",
719 TICK_TO_DBL(RP_tot_time), TICK_TO_DBL(RPe_tot_time));
720 statsPrintf(" PROF time %6.2fs (%6.2fs elapsed)\n",
721 TICK_TO_DBL(HC_tot_time), TICK_TO_DBL(HCe_tot_time));
723 statsPrintf(" EXIT time %6.2fs (%6.2fs elapsed)\n",
724 TICK_TO_DBL(ExitUserTime), TICK_TO_DBL(ExitElapsedTime));
725 statsPrintf(" Total time %6.2fs (%6.2fs elapsed)\n\n",
726 TICK_TO_DBL(time), TICK_TO_DBL(etime));
727 statsPrintf(" %%GC time %5.1f%% (%.1f%% elapsed)\n\n",
728 TICK_TO_DBL(GC_tot_time)*100/TICK_TO_DBL(time),
729 TICK_TO_DBL(GCe_tot_time)*100/TICK_TO_DBL(etime));
731 if (time - GC_tot_time - PROF_VAL(RP_tot_time + HC_tot_time) == 0)
732 ullong_format_string(0, temp, rtsTrue/*commas*/);
734 ullong_format_string(
735 (ullong)((GC_tot_alloc*sizeof(W_))/
736 TICK_TO_DBL(time - GC_tot_time -
737 PROF_VAL(RP_tot_time + HC_tot_time))),
738 temp, rtsTrue/*commas*/);
740 statsPrintf(" Alloc rate %s bytes per MUT second\n\n", temp);
742 statsPrintf(" Productivity %5.1f%% of total user, %.1f%% of total elapsed\n\n",
743 TICK_TO_DBL(time - GC_tot_time -
744 PROF_VAL(RP_tot_time + HC_tot_time) - InitUserTime) * 100
746 TICK_TO_DBL(time - GC_tot_time -
747 PROF_VAL(RP_tot_time + HC_tot_time) - InitUserTime) * 100
748 / TICK_TO_DBL(etime));
751 if (RtsFlags.GcFlags.giveStats == ONELINE_GC_STATS) {
752 /* print the long long separately to avoid bugginess on mingwin (2001-07-02, mingw-0.5) */
753 statsPrintf("<<ghc: %llu bytes, ", GC_tot_alloc*(ullong)sizeof(W_));
754 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",
756 ResidencySamples == 0 ? 0 :
757 AvgResidency*sizeof(W_)/ResidencySamples,
758 MaxResidency*sizeof(W_),
760 (unsigned long)(mblocks_allocated * MBLOCK_SIZE / (1024L * 1024L)),
761 TICK_TO_DBL(InitUserTime), TICK_TO_DBL(InitElapsedTime),
762 TICK_TO_DBL(MutUserTime), TICK_TO_DBL(MutElapsedTime),
763 TICK_TO_DBL(GC_tot_time), TICK_TO_DBL(GCe_tot_time));
771 /* -----------------------------------------------------------------------------
774 Produce some detailed info on the state of the generational GC.
775 -------------------------------------------------------------------------- */
778 statDescribeGens(void)
780 nat g, s, mut, lge, live;
784 debugBelch(" Gen Steps Max Mutable Step Blocks Live Large\n Blocks Closures Closures Objects\n");
787 for (g = 0; g < RtsFlags.GcFlags.generations; g++) {
788 for (bd = generations[g].mut_list; bd != NULL; bd = bd->link) {
789 mut += bd->free - bd->start;
792 debugBelch("%8d %8d %8d %9d", g, generations[g].n_steps,
793 generations[g].max_blocks, mut);
795 for (s = 0; s < generations[g].n_steps; s++) {
796 step = &generations[g].steps[s];
797 for (bd = step->large_objects, lge = 0; bd; bd = bd->link)
801 for (; bd; bd = bd->link) {
802 live += (bd->free - bd->start) * sizeof(W_);
805 debugBelch("%46s","");
807 debugBelch("%6d %8d %8d %8d\n", s, step->n_blocks,
815 /* -----------------------------------------------------------------------------
816 Stats available via a programmatic interface, so eg. GHCi can time
817 each compilation and expression evaluation.
818 -------------------------------------------------------------------------- */
820 extern HsInt64 getAllocations( void )
821 { return (HsInt64)total_allocated * sizeof(W_); }
823 /* -----------------------------------------------------------------------------
824 Dumping stuff in the stats file, or via the debug message interface
825 -------------------------------------------------------------------------- */
828 statsPrintf( char *s, ... )
830 FILE *sf = RtsFlags.GcFlags.statsFile;
845 FILE *sf = RtsFlags.GcFlags.statsFile;
854 FILE *sf = RtsFlags.GcFlags.statsFile;