X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2FStats.c;h=c43806f3af2e23b339747f2c4720b29af0d6d8ca;hb=304e7fb703e7afddc1ef9be6aab6505e36b63b06;hp=9c17856970b124f5eeea8fa97e5187d37d216b97;hpb=3ebcd3deb769a03f4ded0fca2cf38201048c0214;p=ghc-hetmet.git diff --git a/rts/Stats.c b/rts/Stats.c index 9c17856..c43806f 100644 --- a/rts/Stats.c +++ b/rts/Stats.c @@ -712,7 +712,6 @@ stat_exit(int alloc) { nat g, s; - statsPrintf("recordMutableGen_sync: %"FMT_Word64"\n", recordMutableGen_sync.spin); 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++) { @@ -726,9 +725,29 @@ stat_exit(int alloc) } if (RtsFlags.GcFlags.giveStats == ONELINE_GC_STATS) { + char *fmt1, *fmt2; + if (RtsFlags.MiscFlags.machineReadable) { + fmt1 = " [(\"bytes allocated\", \"%llu\")\n"; + fmt2 = " ,(\"num_GCs\", \"%d\")\n" + " ,(\"average_bytes_used\", \"%ld\")\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" + " ]\n"; + } + else { + fmt1 = "<>\n", + statsPrintf(fmt1, GC_tot_alloc*(ullong)sizeof(W_)); + statsPrintf(fmt2, total_collections, ResidencySamples == 0 ? 0 : AvgResidency*sizeof(W_)/ResidencySamples,