summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasper Van der Jeugt <m@jaspervdj.be>2019-05-22 11:49:15 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-05-27 10:06:32 -0400
commit95b791732c6c7a5becc01b70e9496266cec5444e (patch)
treed9056be71f3d2222aaab31de3e9dc6858258922e
parent6d188dd526334ddbb5fb683eef7aa0be6c35a3a0 (diff)
downloadhaskell-95b791732c6c7a5becc01b70e9496266cec5444e.tar.gz
Fix padding of entries in .prof files
When the number of entries of a cost centre reaches 11 digits, it takes up the whole space reserved for it and the prof file ends up looking like: ... no. entries %time %alloc %time %alloc ... ... 120918 978250 0.0 0.0 0.0 0.0 ... 118891 0 0.0 0.0 73.3 80.8 ... 11890229702412351 8.9 13.5 73.3 80.8 ... 118903 153799689 0.0 0.1 0.0 0.1 ... This results in tooling not being able to parse the .prof file. I realise we have the JSON output as well now, but still it'd be good to fix this little weirdness. Original bug report and full prof file can be seen here: <https://github.com/jaspervdj/profiteur/issues/28>.
-rw-r--r--rts/ProfilerReport.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/rts/ProfilerReport.c b/rts/ProfilerReport.c
index 4142c00032..60c90a72da 100644
--- a/rts/ProfilerReport.c
+++ b/rts/ProfilerReport.c
@@ -233,7 +233,7 @@ logCCS(FILE *prof_file, CostCentreStack const *ccs, ProfilerTotals totals,
max_src_len - strlen_utf8(cc->srcloc), "");
fprintf(prof_file,
- " %*" FMT_Int "%11" FMT_Word64 " %5.1f %5.1f %5.1f %5.1f",
+ " %*" FMT_Int " %11" FMT_Word64 " %5.1f %5.1f %5.1f %5.1f",
max_id_len, ccs->ccsID, ccs->scc_count,
totals.total_prof_ticks == 0 ? 0.0 : ((double)ccs->time_ticks / (double)totals.total_prof_ticks * 100.0),
totals.total_alloc == 0 ? 0.0 : ((double)ccs->mem_alloc / (double)totals.total_alloc * 100.0),