Give full-precision time for BEGIN_SAMPLE/END_SAMPLE.
authorEdward Z. Yang <ezyang@cs.stanford.edu>
Tue, 24 Feb 2015 04:02:25 +0000 (20:02 -0800)
committerEdward Z. Yang <ezyang@cs.stanford.edu>
Mon, 2 Mar 2015 22:13:45 +0000 (14:13 -0800)
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

rts/ProfHeap.c

index 06b677c..8d3f408 100644 (file)
@@ -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);
     }