summaryrefslogtreecommitdiff
path: root/rts/Stats.c
diff options
context:
space:
mode:
authorTeo Camarasu <teofilcamarasu@gmail.com>2021-10-02 19:01:16 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-10-08 18:09:56 -0400
commit374a718e75ac5172674c1a789e1de5bbbddc9711 (patch)
tree9915a749626ba2c845187c76a4035c2ad1b41799 /rts/Stats.c
parent75aea7323602df9cb0db71e73e69ac14e07d4c6f (diff)
downloadhaskell-374a718e75ac5172674c1a789e1de5bbbddc9711.tar.gz
Fix nonmoving gen label in gc stats report
The current code assumes the non-moving generation is always generation 1, but this isn't the case if the amount of generations is greater than 2 Fixes #20461
Diffstat (limited to 'rts/Stats.c')
-rw-r--r--rts/Stats.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/rts/Stats.c b/rts/Stats.c
index 9aa3f9566f..90e3e7b396 100644
--- a/rts/Stats.c
+++ b/rts/Stats.c
@@ -859,15 +859,18 @@ static void report_summary(const RTSSummaryStats* sum)
TimeToSecondsDbl(gen_stats->max_pause_ns));
}
if (RtsFlags.GcFlags.useNonmoving) {
- const int n_major_colls = sum->gc_summary_stats[RtsFlags.GcFlags.generations-1].collections;
- statsPrintf(" Gen 1 %5d syncs"
+ const uint32_t nonmoving_gen = RtsFlags.GcFlags.generations-1;
+ const int n_major_colls = sum->gc_summary_stats[nonmoving_gen].collections;
+ statsPrintf(" Gen %2d %5d syncs"
", %6.3fs %3.4fs %3.4fs\n",
+ nonmoving_gen,
n_major_colls,
TimeToSecondsDbl(stats.nonmoving_gc_sync_elapsed_ns),
TimeToSecondsDbl(stats.nonmoving_gc_sync_elapsed_ns) / n_major_colls,
TimeToSecondsDbl(stats.nonmoving_gc_sync_max_elapsed_ns));
- statsPrintf(" Gen 1 concurrent"
+ statsPrintf(" Gen %2d concurrent"
", %6.3fs %6.3fs %3.4fs %3.4fs\n",
+ nonmoving_gen,
TimeToSecondsDbl(stats.nonmoving_gc_cpu_ns),
TimeToSecondsDbl(stats.nonmoving_gc_elapsed_ns),
TimeToSecondsDbl(stats.nonmoving_gc_elapsed_ns) / n_major_colls,