summaryrefslogtreecommitdiff
path: root/rts/ProfHeap.c
diff options
context:
space:
mode:
authorTakano Akio <aljee@hyper.cx>2013-02-15 20:06:38 +0900
committerEdward Z. Yang <ezyang@mit.edu>2013-03-25 00:27:31 -0700
commitb9d537317cb774abf832758e2be9c08db70b6d2c (patch)
treecdc4fa5afcff50da3ce7b9e4442bff3a62b357e5 /rts/ProfHeap.c
parent98267a869ff04ec9c69d48773a15664946b0ef42 (diff)
downloadhaskell-b9d537317cb774abf832758e2be9c08db70b6d2c.tar.gz
Heap profiling: flush .hp file at the end of each frame
Diffstat (limited to 'rts/ProfHeap.c')
-rw-r--r--rts/ProfHeap.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/rts/ProfHeap.c b/rts/ProfHeap.c
index f570a54c25..f094038235 100644
--- a/rts/ProfHeap.c
+++ b/rts/ProfHeap.c
@@ -364,6 +364,9 @@ printSample(rtsBool beginSample, StgDouble sampleValue)
fprintf(hp_file, "%s %" FMT_Word64 ".%02" FMT_Word64 "\n",
(beginSample ? "BEGIN_SAMPLE" : "END_SAMPLE"),
(StgWord64)integralPart, (StgWord64)(fractionalPart * 100));
+ if (!beginSample) {
+ fflush(hp_file);
+ }
}
/* --------------------------------------------------------------------------