[commit: ghc] master: Give full-precision time for BEGIN_SAMPLE/END_SAMPLE. (1da3bbd)

git at git.haskell.org git at git.haskell.org
Mon Mar 2 22:11:36 UTC 2015


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/1da3bbd2bd82ea11f8a1d760385df84708bbea63/ghc

>---------------------------------------------------------------

commit 1da3bbd2bd82ea11f8a1d760385df84708bbea63
Author: Edward Z. Yang <ezyang at cs.stanford.edu>
Date:   Mon Feb 23 20:02:25 2015 -0800

    Give full-precision time for BEGIN_SAMPLE/END_SAMPLE.
    
    Summary: Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu>
    
    Test Plan: validate
    
    Reviewers: simonmar, austin
    
    Subscribers: thomie
    
    Differential Revision: https://phabricator.haskell.org/D679


>---------------------------------------------------------------

1da3bbd2bd82ea11f8a1d760385df84708bbea63
 rts/ProfHeap.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/rts/ProfHeap.c b/rts/ProfHeap.c
index 06b677c..8d3f408 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);
     }



More information about the ghc-commits mailing list