X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2FStats.c;h=8366bf47b225fbce94bcdeca088fd96a2c5f9c62;hb=32b0d9760133a6b97f1cd6ff81ed9d241072e997;hp=159a909fcec23a26f57079d817142adfb9c973c2;hpb=1fb38442d3a55ac92795aa6c5ed4df82011df724;p=ghc-hetmet.git diff --git a/rts/Stats.c b/rts/Stats.c index 159a909..8366bf4 100644 --- a/rts/Stats.c +++ b/rts/Stats.c @@ -547,6 +547,18 @@ stat_exit(int alloc) gc_elapsed += GC_coll_elapsed[i]; } + init_cpu = end_init_cpu - start_init_cpu; + init_elapsed = end_init_elapsed - start_init_elapsed; + + exit_cpu = end_exit_cpu - start_exit_cpu; + exit_elapsed = end_exit_elapsed - start_exit_elapsed; + + mut_elapsed = start_exit_elapsed - end_init_elapsed - gc_elapsed; + + mut_cpu = start_exit_cpu - end_init_cpu - gc_cpu + - 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*/); @@ -635,21 +647,9 @@ stat_exit(int alloc) } #endif - init_cpu = end_init_cpu - start_init_cpu; - init_elapsed = end_init_elapsed - start_init_elapsed; - - exit_cpu = end_exit_cpu - start_exit_cpu; - exit_elapsed = end_exit_elapsed - start_exit_elapsed; - statsPrintf(" INIT time %6.2fs (%6.2fs elapsed)\n", TICK_TO_DBL(init_cpu), TICK_TO_DBL(init_elapsed)); - mut_elapsed = start_exit_elapsed - end_init_elapsed - gc_elapsed; - - mut_cpu = start_exit_cpu - end_init_cpu - gc_cpu - - PROF_VAL(RP_tot_time + HC_tot_time); - if (mut_cpu < 0) { mut_cpu = 0; } - statsPrintf(" MUT time %6.2fs (%6.2fs elapsed)\n", TICK_TO_DBL(mut_cpu), TICK_TO_DBL(mut_elapsed)); statsPrintf(" GC time %6.2fs (%6.2fs elapsed)\n", @@ -753,12 +753,18 @@ stat_exit(int alloc) statsClose(); } - if (GC_coll_cpu) + if (GC_coll_cpu) { stgFree(GC_coll_cpu); - GC_coll_cpu = NULL; - if (GC_coll_elapsed) + GC_coll_cpu = NULL; + } + if (GC_coll_elapsed) { stgFree(GC_coll_elapsed); - GC_coll_elapsed = NULL; + GC_coll_elapsed = NULL; + } + if (GC_coll_max_pause) { + stgFree(GC_coll_max_pause); + GC_coll_max_pause = NULL; + } } /* ----------------------------------------------------------------------------- @@ -798,11 +804,20 @@ statDescribeGens(void) mut = 0; for (i = 0; i < n_capabilities; i++) { mut += countOccupied(capabilities[i].mut_lists[g]); + + // Add the pinned object block. + bd = capabilities[i].pinned_object_block; + if (bd != NULL) { + gen_live += bd->free - bd->start; + gen_blocks += bd->blocks; + } + + gen_live += gcThreadLiveWords(i,g); gen_live += gcThreadLiveWords(i,g); gen_blocks += gcThreadLiveBlocks(i,g); } - debugBelch("%5d %7d %9d", g, gen->max_blocks, mut); + debugBelch("%5d %7ld %9d", g, (lnat)gen->max_blocks, mut); gen_slop = gen_blocks * BLOCK_SIZE_W - gen_live;