summaryrefslogtreecommitdiff
path: root/rts/Stats.c
diff options
context:
space:
mode:
authorDavid M Peixotto <dmp@rice.edu>2011-05-10 12:40:23 -0500
committerDavid M Peixotto <dmp@rice.edu>2011-05-10 12:40:23 -0500
commit8ae1fd33175b70e46c233d22195e7fc8e16997bf (patch)
tree00e98f5d9537095f39f75cc9fcf494137ab07ed7 /rts/Stats.c
parent2d5205118357cac8a2dd43b33bcd93a3c00f5558 (diff)
downloadhaskell-8ae1fd33175b70e46c233d22195e7fc8e16997bf.tar.gz
Fix bug in one-line stats printing
The code that prints the "one-line" stats (i.e. the RTS -t flag) was incorreclty printing zeros for some time values. These time values were computed inside a conditional that was only true when printing detailed stats (i.e. the RTS -s or -S flags). This commit simply moves the computation out of the conditional so they are available for the one-line stats output.
Diffstat (limited to 'rts/Stats.c')
-rw-r--r--rts/Stats.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/rts/Stats.c b/rts/Stats.c
index fa38472129..3036ed7265 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",