diff options
author | Edward Z. Yang <ezyang@cs.stanford.edu> | 2015-02-23 20:02:25 -0800 |
---|---|---|
committer | Edward Z. Yang <ezyang@cs.stanford.edu> | 2015-03-02 14:13:45 -0800 |
commit | 1da3bbd2bd82ea11f8a1d760385df84708bbea63 (patch) | |
tree | 4acc95459af3a2d02ab39000cc9f2635b16a7c35 /rts/ProfHeap.c | |
parent | 5bdfb9beb28206a014d817ddf15f1c6c36d79a69 (diff) | |
download | haskell-1da3bbd2bd82ea11f8a1d760385df84708bbea63.tar.gz |
Give full-precision time for BEGIN_SAMPLE/END_SAMPLE.
Summary: Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Test Plan: validate
Reviewers: simonmar, austin
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D679
Diffstat (limited to 'rts/ProfHeap.c')
-rw-r--r-- | rts/ProfHeap.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/rts/ProfHeap.c b/rts/ProfHeap.c index 06b677c428..8d3f408c3a 100644 --- a/rts/ProfHeap.c +++ b/rts/ProfHeap.c @@ -356,11 +356,9 @@ void endProfiling( void ) static void printSample(rtsBool beginSample, StgDouble sampleValue) { - StgDouble fractionalPart, integralPart; - fractionalPart = modf(sampleValue, &integralPart); - fprintf(hp_file, "%s %" FMT_Word64 ".%02" FMT_Word64 "\n", + fprintf(hp_file, "%s %f\n", (beginSample ? "BEGIN_SAMPLE" : "END_SAMPLE"), - (StgWord64)integralPart, (StgWord64)(fractionalPart * 100)); + sampleValue); if (!beginSample) { fflush(hp_file); } |