max_slop = 0;
GC_end_faults = 0;
-}
+}
/* ---------------------------------------------------------------------------
initStats1() can be called after setupRtsFlags()
initStats1 (void)
{
nat i;
-
+
if (RtsFlags.GcFlags.giveStats >= VERBOSE_GC_STATS) {
- statsPrintf(" Alloc Copied Live GC GC TOT TOT Page Flts\n");
- statsPrintf(" bytes bytes bytes user elap user elap\n");
+ statsPrintf(" Alloc Copied Live GC GC TOT TOT Page Flts\n");
+ statsPrintf(" bytes bytes bytes user elap user elap\n");
}
- GC_coll_cpu =
- (Time *)stgMallocBytes(
+ GC_coll_cpu =
+ (Time *)stgMallocBytes(
sizeof(Time)*RtsFlags.GcFlags.generations,
- "initStats");
- GC_coll_elapsed =
- (Time *)stgMallocBytes(
- sizeof(Time)*RtsFlags.GcFlags.generations,
- "initStats");
+ "initStats");
+ GC_coll_elapsed =
+ (Time *)stgMallocBytes(
+ sizeof(Time)*RtsFlags.GcFlags.generations,
+ "initStats");
GC_coll_max_pause =
- (Time *)stgMallocBytes(
- sizeof(Time)*RtsFlags.GcFlags.generations,
- "initStats");
+ (Time *)stgMallocBytes(
+ sizeof(Time)*RtsFlags.GcFlags.generations,
+ "initStats");
for (i = 0; i < RtsFlags.GcFlags.generations; i++) {
- GC_coll_cpu[i] = 0;
+ GC_coll_cpu[i] = 0;
GC_coll_elapsed[i] = 0;
GC_coll_max_pause[i] = 0;
}
getProcessTimes(&start_init_cpu, &start_init_elapsed);
}
-void
+void
stat_endInit(void)
{
getProcessTimes(&end_init_cpu, &end_init_elapsed);
/* -----------------------------------------------------------------------------
stat_startExit and stat_endExit
-
+
These two measure the time taken in shutdownHaskell().
-------------------------------------------------------------------------- */
nat bell = RtsFlags.GcFlags.ringBell;
if (bell) {
- if (bell > 1) {
- debugBelch(" GC ");
- rub_bell = 1;
- } else {
- debugBelch("\007");
- }
+ if (bell > 1) {
+ debugBelch(" GC ");
+ rub_bell = 1;
+ } else {
+ debugBelch("\007");
+ }
}
#if USE_PAPI
traceEventGcStartAtT(cap,
TimeToNS(gct->gc_start_elapsed - start_init_elapsed));
- gct->gc_start_thread_cpu = getThreadCPUTime();
-
if (RtsFlags.GcFlags.giveStats != NO_GC_STATS)
{
gct->gc_start_faults = getPageFaults();
}
-}
-void
-stat_gcWorkerThreadStart (gc_thread *gct STG_UNUSED)
-{
-#if 0
- /*
- * We dont' collect per-thread GC stats any more, but this code
- * could be used to do that if we want to in the future:
- */
- if (RtsFlags.GcFlags.giveStats != NO_GC_STATS)
- {
- getProcessTimes(&gct->gc_start_cpu, &gct->gc_start_elapsed);
- gct->gc_start_thread_cpu = getThreadCPUTime();
- }
-#endif
-}
-
-void
-stat_gcWorkerThreadDone (gc_thread *gct STG_UNUSED)
-{
-#if 0
- /*
- * We dont' collect per-thread GC stats any more, but this code
- * could be used to do that if we want to in the future:
- */
- Time thread_cpu, elapsed, gc_cpu, gc_elapsed;
-
- if (RtsFlags.GcFlags.giveStats != NO_GC_STATS)
- {
- elapsed = getProcessElapsedTime();
- thread_cpu = getThreadCPUTime();
-
- gc_cpu = thread_cpu - gct->gc_start_thread_cpu;
- gc_elapsed = elapsed - gct->gc_start_elapsed;
-
- taskDoneGC(gct->cap->running_task, gc_cpu, gc_elapsed);
- }
-#endif
-}
-
-/* -----------------------------------------------------------------------------
- * Calculate the total allocated memory since the start of the
- * program. Also emits events reporting the per-cap allocation
- * totals.
- * -------------------------------------------------------------------------- */
-
-static StgWord
-calcTotalAllocated(void)
-{
- W_ tot_alloc = 0;
- W_ n;
- for (n = 0; n < n_capabilities; n++) {
- tot_alloc += capabilities[n].total_allocated;
- traceEventHeapAllocated(&capabilities[n],
- CAPSET_HEAP_DEFAULT,
- capabilities[n].total_allocated * sizeof(W_));
- }
-
- return tot_alloc;
+ updateNurseriesStats();
}
/* -----------------------------------------------------------------------------
// for a detailed design rationale of the current setup
// of GC eventlog events.
traceEventGcGlobalSync(cap);
-
+
// Emitted before GC_END on all caps, which simplifies tools code.
traceEventGcStats(cap,
CAPSET_HEAP_DEFAULT,
gc_cpu = cpu - gct->gc_start_cpu;
/* For the moment we calculate both per-HEC and total allocation.
- * There is thus redundancy here, but for the moment we will calculate
- * it both the old and new way and assert they're the same.
- * When we're sure it's working OK then we can simplify things.
+ * There is thus redundancy here, but for the moment we will calculate
+ * it both the old and new way and assert they're the same.
+ * When we're sure it's working OK then we can simplify things.
*/
tot_alloc = calcTotalAllocated();
GC_tot_alloc = tot_alloc;
if (RtsFlags.GcFlags.giveStats == VERBOSE_GC_STATS) {
- W_ faults = getPageFaults();
-
- statsPrintf("%9" FMT_SizeT " %9" FMT_SizeT " %9" FMT_SizeT,
- alloc*sizeof(W_), copied*sizeof(W_),
- live*sizeof(W_));
- statsPrintf(" %5.2f %5.2f %7.2f %7.2f %4" FMT_Word " %4" FMT_Word " (Gen: %2d)\n",
+ W_ faults = getPageFaults();
+
+ statsPrintf("%9" FMT_SizeT " %9" FMT_SizeT " %9" FMT_SizeT,
+ alloc*sizeof(W_), copied*sizeof(W_),
+ live*sizeof(W_));
+ statsPrintf(" %6.3f %6.3f %8.3f %8.3f %4" FMT_Word " %4" FMT_Word " (Gen: %2d)\n",
TimeToSecondsDbl(gc_cpu),
- TimeToSecondsDbl(gc_elapsed),
- TimeToSecondsDbl(cpu),
- TimeToSecondsDbl(elapsed - start_init_elapsed),
- faults - gct->gc_start_faults,
+ TimeToSecondsDbl(gc_elapsed),
+ TimeToSecondsDbl(cpu),
+ TimeToSecondsDbl(elapsed - start_init_elapsed),
+ faults - gct->gc_start_faults,
gct->gc_start_faults - GC_end_faults,
gen);
GC_end_faults = faults;
- statsFlush();
- }
+ statsFlush();
+ }
GC_coll_cpu[gen] += gc_cpu;
GC_coll_elapsed[gen] += gc_elapsed;
GC_coll_max_pause[gen] = gc_elapsed;
}
- GC_tot_copied += (StgWord64) copied;
+ GC_tot_copied += (StgWord64) copied;
GC_par_max_copied += (StgWord64) par_max_copied;
GC_par_tot_copied += (StgWord64) par_tot_copied;
- GC_tot_cpu += gc_cpu;
-
+ GC_tot_cpu += gc_cpu;
+
traceEventHeapSize(cap,
- CAPSET_HEAP_DEFAULT,
- mblocks_allocated * MBLOCK_SIZE_W * sizeof(W_));
+ CAPSET_HEAP_DEFAULT,
+ mblocks_allocated * MBLOCK_SIZE_W * sizeof(W_));
- if (gen == RtsFlags.GcFlags.generations-1) { /* major GC? */
- if (live > max_residency) {
- max_residency = live;
- }
+ if (gen == RtsFlags.GcFlags.generations-1) { /* major GC? */
+ if (live > max_residency) {
+ max_residency = live;
+ }
current_residency = live;
- residency_samples++;
- cumulative_residency += live;
- traceEventHeapLive(cap,
- CAPSET_HEAP_DEFAULT,
- live * sizeof(W_));
- }
+ residency_samples++;
+ cumulative_residency += live;
+ traceEventHeapLive(cap,
+ CAPSET_HEAP_DEFAULT,
+ live * sizeof(W_));
+ }
if (slop > max_slop) max_slop = slop;
}
if (rub_bell) {
- debugBelch("\b\b\b \b\b\b");
- rub_bell = 0;
+ debugBelch("\b\b\b \b\b\b");
+ rub_bell = 0;
}
#if USE_PAPI
RP_tot_time += user - RP_start_time;
RPe_tot_time += elapsed - RPe_start_time;
- fprintf(prof_file, "Retainer Profiling: %d, at %f seconds\n",
+ fprintf(prof_file, "Retainer Profiling: %d, at %f seconds\n",
retainerGeneration, mut_user_time_during_RP());
#ifdef DEBUG_RETAINER
fprintf(prof_file, "\tMax C stack size = %u\n", maxCStackSize);
-------------------------------------------------------------------------- */
#ifdef PROFILING
void
-stat_endHeapCensus(void)
+stat_endHeapCensus(void)
{
Time user, elapsed;
getProcessTimes( &user, &elapsed );
#define REPORT(counter) \
{ \
showStgWord64(counter,temp,rtsTrue/*commas*/); \
- statsPrintf(" (" #counter ") : %s\n",temp); \
+ statsPrintf(" (" #counter ") : %s\n",temp); \
}
/* Report the value of a counter as a percentage of another counter */
#define REPORT_PCT(counter,countertot) \
statsPrintf(" (" #counter ") %% of (" #countertot ") : %.1f%%\n", \
- counter*100.0/countertot)
+ counter*100.0/countertot)
#define TICK_PRINT(arity) \
REPORT(SLOW_CALLS_##arity); \
#define TICK_PRINT_TOT(arity) \
statsPrintf(" (SLOW_CALLS_" #arity ") %% of (TOTAL_CALLS) : %.1f%%\n", \
- SLOW_CALLS_##arity * 100.0/TOTAL_CALLS)
+ SLOW_CALLS_##arity * 100.0/TOTAL_CALLS)
static inline Time get_init_cpu(void) { return end_init_cpu - start_init_cpu; }
static inline Time get_init_elapsed(void) { return end_init_elapsed - start_init_elapsed; }
if (RtsFlags.GcFlags.giveStats != NO_GC_STATS) {
- char temp[BIG_STRING_LEN];
- Time tot_cpu;
- Time tot_elapsed;
- nat i, g, total_collections = 0;
+ char temp[BIG_STRING_LEN];
+ Time tot_cpu;
+ Time tot_elapsed;
+ nat i, g, total_collections = 0;
- getProcessTimes( &tot_cpu, &tot_elapsed );
- tot_elapsed -= start_init_elapsed;
+ getProcessTimes( &tot_cpu, &tot_elapsed );
+ tot_elapsed -= start_init_elapsed;
tot_alloc = calcTotalAllocated();
alloc = tot_alloc - GC_tot_alloc;
GC_tot_alloc = tot_alloc;
- /* Count total garbage collections */
- for (g = 0; g < RtsFlags.GcFlags.generations; g++)
- total_collections += generations[g].collections;
+ /* Count total garbage collections */
+ for (g = 0; g < RtsFlags.GcFlags.generations; g++)
+ total_collections += generations[g].collections;
- /* avoid divide by zero if tot_cpu is measured as 0.00 seconds -- SDM */
- if (tot_cpu == 0.0) tot_cpu = 1;
- if (tot_elapsed == 0.0) tot_elapsed = 1;
-
- if (RtsFlags.GcFlags.giveStats >= VERBOSE_GC_STATS) {
- statsPrintf("%9" FMT_SizeT " %9.9s %9.9s", (W_)alloc*sizeof(W_), "", "");
- statsPrintf(" %5.2f %5.2f\n\n", 0.0, 0.0);
- }
+ /* avoid divide by zero if tot_cpu is measured as 0.00 seconds -- SDM */
+ if (tot_cpu == 0.0) tot_cpu = 1;
+ if (tot_elapsed == 0.0) tot_elapsed = 1;
+
+ if (RtsFlags.GcFlags.giveStats >= VERBOSE_GC_STATS) {
+ statsPrintf("%9" FMT_SizeT " %9.9s %9.9s", (W_)alloc*sizeof(W_), "", "");
+ statsPrintf(" %6.3f %6.3f\n\n", 0.0, 0.0);
+ }
for (i = 0; i < RtsFlags.GcFlags.generations; i++) {
gc_cpu += GC_coll_cpu[i];
- PROF_VAL(RP_tot_time + HC_tot_time);
if (mut_cpu < 0) { mut_cpu = 0; }
- if (RtsFlags.GcFlags.giveStats >= SUMMARY_GC_STATS) {
- showStgWord64(GC_tot_alloc*sizeof(W_),
- temp, rtsTrue/*commas*/);
- statsPrintf("%16s bytes allocated in the heap\n", temp);
+ if (RtsFlags.GcFlags.giveStats >= SUMMARY_GC_STATS) {
+ showStgWord64(GC_tot_alloc*sizeof(W_),
+ temp, rtsTrue/*commas*/);
+ statsPrintf("%16s bytes allocated in the heap\n", temp);
- showStgWord64(GC_tot_copied*sizeof(W_),
- temp, rtsTrue/*commas*/);
- statsPrintf("%16s bytes copied during GC\n", temp);
+ showStgWord64(GC_tot_copied*sizeof(W_),
+ temp, rtsTrue/*commas*/);
+ statsPrintf("%16s bytes copied during GC\n", temp);
if ( residency_samples > 0 ) {
- showStgWord64(max_residency*sizeof(W_),
- temp, rtsTrue/*commas*/);
- statsPrintf("%16s bytes maximum residency (%" FMT_Word " sample(s))\n",
- temp, residency_samples);
- }
+ showStgWord64(max_residency*sizeof(W_),
+ temp, rtsTrue/*commas*/);
+ statsPrintf("%16s bytes maximum residency (%" FMT_Word " sample(s))\n",
+ temp, residency_samples);
+ }
- showStgWord64(max_slop*sizeof(W_), temp, rtsTrue/*commas*/);
- statsPrintf("%16s bytes maximum slop\n", temp);
+ showStgWord64(max_slop*sizeof(W_), temp, rtsTrue/*commas*/);
+ statsPrintf("%16s bytes maximum slop\n", temp);
- statsPrintf("%16" FMT_SizeT " MB total memory in use (%" FMT_SizeT " MB lost due to fragmentation)\n\n",
- peak_mblocks_allocated * MBLOCK_SIZE_W / (1024 * 1024 / sizeof(W_)),
- (W_)(peak_mblocks_allocated * BLOCKS_PER_MBLOCK * BLOCK_SIZE_W - hw_alloc_blocks * BLOCK_SIZE_W) / (1024 * 1024 / sizeof(W_)));
+ statsPrintf("%16" FMT_SizeT " MB total memory in use (%" FMT_SizeT " MB lost due to fragmentation)\n\n",
+ (size_t)(peak_mblocks_allocated * MBLOCK_SIZE_W) / (1024 * 1024 / sizeof(W_)),
+ (size_t)(peak_mblocks_allocated * BLOCKS_PER_MBLOCK * BLOCK_SIZE_W - hw_alloc_blocks * BLOCK_SIZE_W) / (1024 * 1024 / sizeof(W_)));
- /* Print garbage collections in each gen */
- statsPrintf(" Tot time (elapsed) Avg pause Max pause\n");
+ /* Print garbage collections in each gen */
+ statsPrintf(" Tot time (elapsed) Avg pause Max pause\n");
for (g = 0; g < RtsFlags.GcFlags.generations; g++) {
gen = &generations[g];
- statsPrintf(" Gen %2d %5d colls, %5d par %5.2fs %5.2fs %3.4fs %3.4fs\n",
+ statsPrintf(" Gen %2d %5d colls, %5d par %6.3fs %6.3fs %3.4fs %3.4fs\n",
gen->no,
gen->collections,
gen->par_collections,
#if defined(THREADED_RTS)
if (RtsFlags.ParFlags.parGcEnabled && n_capabilities > 1) {
- statsPrintf("\n Parallel GC work balance: %.2f%% (serial 0%%, perfect 100%%)\n",
+ statsPrintf("\n Parallel GC work balance: %.2f%% (serial 0%%, perfect 100%%)\n",
100 * (((double)GC_par_tot_copied / (double)GC_par_max_copied) - 1)
/ (n_capabilities - 1)
);
peakWorkerCount, workerCount,
n_capabilities);
- statsPrintf("\n");
+ statsPrintf("\n");
{
nat i;
SparkCounters sparks = { 0, 0, 0, 0, 0, 0};
for (i = 0; i < n_capabilities; i++) {
- sparks.created += capabilities[i].spark_stats.created;
- sparks.dud += capabilities[i].spark_stats.dud;
- sparks.overflowed+= capabilities[i].spark_stats.overflowed;
- sparks.converted += capabilities[i].spark_stats.converted;
- sparks.gcd += capabilities[i].spark_stats.gcd;
- sparks.fizzled += capabilities[i].spark_stats.fizzled;
+ sparks.created += capabilities[i]->spark_stats.created;
+ sparks.dud += capabilities[i]->spark_stats.dud;
+ sparks.overflowed+= capabilities[i]->spark_stats.overflowed;
+ sparks.converted += capabilities[i]->spark_stats.converted;
+ sparks.gcd += capabilities[i]->spark_stats.gcd;
+ sparks.fizzled += capabilities[i]->spark_stats.fizzled;
}
statsPrintf(" SPARKS: %" FMT_Word " (%" FMT_Word " converted, %" FMT_Word " overflowed, %" FMT_Word " dud, %" FMT_Word " GC'd, %" FMT_Word " fizzled)\n\n",
}
#endif
- statsPrintf(" INIT time %6.2fs (%6.2fs elapsed)\n",
+ statsPrintf(" INIT time %7.3fs (%7.3fs elapsed)\n",
TimeToSecondsDbl(init_cpu), TimeToSecondsDbl(init_elapsed));
- statsPrintf(" MUT time %6.2fs (%6.2fs elapsed)\n",
+ statsPrintf(" MUT time %7.3fs (%7.3fs elapsed)\n",
TimeToSecondsDbl(mut_cpu), TimeToSecondsDbl(mut_elapsed));
- statsPrintf(" GC time %6.2fs (%6.2fs elapsed)\n",
+ statsPrintf(" GC time %7.3fs (%7.3fs elapsed)\n",
TimeToSecondsDbl(gc_cpu), TimeToSecondsDbl(gc_elapsed));
#ifdef PROFILING
- statsPrintf(" RP time %6.2fs (%6.2fs elapsed)\n",
- TimeToSecondsDbl(RP_tot_time), TimeToSecondsDbl(RPe_tot_time));
- statsPrintf(" PROF time %6.2fs (%6.2fs elapsed)\n",
- TimeToSecondsDbl(HC_tot_time), TimeToSecondsDbl(HCe_tot_time));
-#endif
- statsPrintf(" EXIT time %6.2fs (%6.2fs elapsed)\n",
- TimeToSecondsDbl(exit_cpu), TimeToSecondsDbl(exit_elapsed));
- statsPrintf(" Total time %6.2fs (%6.2fs elapsed)\n\n",
- TimeToSecondsDbl(tot_cpu), TimeToSecondsDbl(tot_elapsed));
+ statsPrintf(" RP time %7.3fs (%7.3fs elapsed)\n",
+ TimeToSecondsDbl(RP_tot_time), TimeToSecondsDbl(RPe_tot_time));
+ statsPrintf(" PROF time %7.3fs (%7.3fs elapsed)\n",
+ TimeToSecondsDbl(HC_tot_time), TimeToSecondsDbl(HCe_tot_time));
+#endif
+ statsPrintf(" EXIT time %7.3fs (%7.3fs elapsed)\n",
+ TimeToSecondsDbl(exit_cpu), TimeToSecondsDbl(exit_elapsed));
+ statsPrintf(" Total time %7.3fs (%7.3fs elapsed)\n\n",
+ TimeToSecondsDbl(tot_cpu), TimeToSecondsDbl(tot_elapsed));
#ifndef THREADED_RTS
- statsPrintf(" %%GC time %5.1f%% (%.1f%% elapsed)\n\n",
- TimeToSecondsDbl(gc_cpu)*100/TimeToSecondsDbl(tot_cpu),
- TimeToSecondsDbl(gc_elapsed)*100/TimeToSecondsDbl(tot_elapsed));
+ statsPrintf(" %%GC time %5.1f%% (%.1f%% elapsed)\n\n",
+ TimeToSecondsDbl(gc_cpu)*100/TimeToSecondsDbl(tot_cpu),
+ TimeToSecondsDbl(gc_elapsed)*100/TimeToSecondsDbl(tot_elapsed));
#endif
if (mut_cpu == 0) {
- showStgWord64(0, temp, rtsTrue/*commas*/);
+ showStgWord64(0, temp, rtsTrue/*commas*/);
} else {
- showStgWord64(
+ showStgWord64(
(StgWord64)((GC_tot_alloc*sizeof(W_)) / TimeToSecondsDbl(mut_cpu)),
temp, rtsTrue/*commas*/);
}
- statsPrintf(" Alloc rate %s bytes per MUT second\n\n", temp);
-
- statsPrintf(" Productivity %5.1f%% of total user, %.1f%% of total elapsed\n\n",
+ statsPrintf(" Alloc rate %s bytes per MUT second\n\n", temp);
+
+ statsPrintf(" Productivity %5.1f%% of total user, %.1f%% of total elapsed\n\n",
TimeToSecondsDbl(tot_cpu - gc_cpu -
- PROF_VAL(RP_tot_time + HC_tot_time) - init_cpu) * 100
- / TimeToSecondsDbl(tot_cpu),
+ PROF_VAL(RP_tot_time + HC_tot_time) - init_cpu) * 100
+ / TimeToSecondsDbl(tot_cpu),
TimeToSecondsDbl(tot_cpu - gc_cpu -
PROF_VAL(RP_tot_time + HC_tot_time) - init_cpu) * 100
/ TimeToSecondsDbl(tot_elapsed));
/*
TICK_PRINT(1);
TICK_PRINT(2);
- REPORT(TOTAL_CALLS);
+ REPORT(TOTAL_CALLS);
TICK_PRINT_TOT(1);
TICK_PRINT_TOT(2);
*/
#if defined(THREADED_RTS) && defined(PROF_SPIN)
{
nat g;
-
+
statsPrintf("gc_alloc_block_sync: %"FMT_Word64"\n", gc_alloc_block_sync.spin);
statsPrintf("whitehole_spin: %"FMT_Word64"\n", whitehole_spin);
for (g = 0; g < RtsFlags.GcFlags.generations; g++) {
}
}
#endif
- }
+ }
- if (RtsFlags.GcFlags.giveStats == ONELINE_GC_STATS) {
+ if (RtsFlags.GcFlags.giveStats == ONELINE_GC_STATS) {
char *fmt1, *fmt2;
if (RtsFlags.MiscFlags.machineReadable) {
fmt1 = " [(\"bytes allocated\", \"%llu\")\n";
" ,(\"max_bytes_used\", \"%ld\")\n"
" ,(\"num_byte_usage_samples\", \"%ld\")\n"
" ,(\"peak_megabytes_allocated\", \"%lu\")\n"
- " ,(\"init_cpu_seconds\", \"%.2f\")\n"
- " ,(\"init_wall_seconds\", \"%.2f\")\n"
- " ,(\"mutator_cpu_seconds\", \"%.2f\")\n"
- " ,(\"mutator_wall_seconds\", \"%.2f\")\n"
- " ,(\"GC_cpu_seconds\", \"%.2f\")\n"
- " ,(\"GC_wall_seconds\", \"%.2f\")\n"
+ " ,(\"init_cpu_seconds\", \"%.3f\")\n"
+ " ,(\"init_wall_seconds\", \"%.3f\")\n"
+ " ,(\"mutator_cpu_seconds\", \"%.3f\")\n"
+ " ,(\"mutator_wall_seconds\", \"%.3f\")\n"
+ " ,(\"GC_cpu_seconds\", \"%.3f\")\n"
+ " ,(\"GC_wall_seconds\", \"%.3f\")\n"
" ]\n";
}
else {
fmt1 = "<<ghc: %llu bytes, ";
- fmt2 = "%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";
+ fmt2 = "%d GCs, %ld/%ld avg/max bytes residency (%ld samples), %luM in use, %.3f INIT (%.3f elapsed), %.3f MUT (%.3f elapsed), %.3f GC (%.3f elapsed) :ghc>>\n";
}
- /* print the long long separately to avoid bugginess on mingwin (2001-07-02, mingw-0.5) */
- statsPrintf(fmt1, GC_tot_alloc*(StgWord64)sizeof(W_));
- statsPrintf(fmt2,
- total_collections,
- residency_samples == 0 ? 0 :
- cumulative_residency*sizeof(W_)/residency_samples,
- max_residency*sizeof(W_),
- residency_samples,
- (unsigned long)(peak_mblocks_allocated * MBLOCK_SIZE / (1024L * 1024L)),
- TimeToSecondsDbl(init_cpu), TimeToSecondsDbl(init_elapsed),
- TimeToSecondsDbl(mut_cpu), TimeToSecondsDbl(mut_elapsed),
- TimeToSecondsDbl(gc_cpu), TimeToSecondsDbl(gc_elapsed));
- }
-
- statsFlush();
- statsClose();
+ /* print the long long separately to avoid bugginess on mingwin (2001-07-02, mingw-0.5) */
+ statsPrintf(fmt1, GC_tot_alloc*(StgWord64)sizeof(W_));
+ statsPrintf(fmt2,
+ total_collections,
+ residency_samples == 0 ? 0 :
+ cumulative_residency*sizeof(W_)/residency_samples,
+ max_residency*sizeof(W_),
+ residency_samples,
+ (unsigned long)(peak_mblocks_allocated * MBLOCK_SIZE / (1024L * 1024L)),
+ TimeToSecondsDbl(init_cpu), TimeToSecondsDbl(init_elapsed),
+ TimeToSecondsDbl(mut_cpu), TimeToSecondsDbl(mut_elapsed),
+ TimeToSecondsDbl(gc_cpu), TimeToSecondsDbl(gc_elapsed));
+ }
+
+ statsFlush();
+ statsClose();
}
if (GC_coll_cpu) {
W_ gen_live, gen_blocks;
bdescr *bd;
generation *gen;
-
+
debugBelch(
"----------------------------------------------------------\n"
" Gen Max Mut-list Blocks Large Live Slop\n"
mut = 0;
for (i = 0; i < n_capabilities; i++) {
- mut += countOccupied(capabilities[i].mut_lists[g]);
+ mut += countOccupied(capabilities[i]->mut_lists[g]);
// Add the pinned object block.
- bd = capabilities[i].pinned_object_block;
+ bd = capabilities[i]->pinned_object_block;
if (bd != NULL) {
gen_live += bd->free - bd->start;
gen_blocks += bd->blocks;
each compilation and expression evaluation.
-------------------------------------------------------------------------- */
-extern HsInt64 getAllocations( void )
+extern HsInt64 getAllocations( void )
{ return (HsInt64)GC_tot_alloc * sizeof(W_); }
/* EZY: I'm not convinced I got all the casting right. */
s->gcd = 0;
s->fizzled = 0;
for (i = 0; i < n_capabilities; i++) {
- s->created += capabilities[i].spark_stats.created;
- s->dud += capabilities[i].spark_stats.dud;
- s->overflowed+= capabilities[i].spark_stats.overflowed;
- s->converted += capabilities[i].spark_stats.converted;
- s->gcd += capabilities[i].spark_stats.gcd;
- s->fizzled += capabilities[i].spark_stats.fizzled;
+ s->created += capabilities[i]->spark_stats.created;
+ s->dud += capabilities[i]->spark_stats.dud;
+ s->overflowed+= capabilities[i]->spark_stats.overflowed;
+ s->converted += capabilities[i]->spark_stats.converted;
+ s->gcd += capabilities[i]->spark_stats.gcd;
+ s->fizzled += capabilities[i]->spark_stats.fizzled;
}
}
#endif
{
FILE *sf = RtsFlags.GcFlags.statsFile;
va_list ap;
-
+
va_start(ap,s);
if (sf == NULL) {
- vdebugBelch(s,ap);
+ vdebugBelch(s,ap);
} else {
- vfprintf(sf, s, ap);
+ vfprintf(sf, s, ap);
}
va_end(ap);
}
{
FILE *sf = RtsFlags.GcFlags.statsFile;
if (sf != NULL) {
- fflush(sf);
+ fflush(sf);
}
}
{
FILE *sf = RtsFlags.GcFlags.statsFile;
if (sf != NULL) {
- fclose(sf);
+ fclose(sf);
}
}