[commit: ghc] ghc-july: Give full-precision time for BEGIN_SAMPLE/END_SAMPLE. (807cb0c)

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


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

On branch  : ghc-july
Link       : http://ghc.haskell.org/trac/ghc/changeset/807cb0c4437d3e78cb29c4ba820aa74a7bc7c9c9/ghc

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

commit 807cb0c4437d3e78cb29c4ba820aa74a7bc7c9c9
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


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

807cb0c4437d3e78cb29c4ba820aa74a7bc7c9c9
 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