[commit: ghc] ghc-8.2: GHC.Stats cleanup (9670679)

git at git.haskell.org git at git.haskell.org
Fri Jun 16 22:41:15 UTC 2017


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

On branch  : ghc-8.2
Link       : http://ghc.haskell.org/trac/ghc/changeset/96706799d6cd3c077f31c93e468d6864c358dc09/ghc

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

commit 96706799d6cd3c077f31c93e468d6864c358dc09
Author: Ryan Scott <ryan.gl.scott at gmail.com>
Date:   Fri Jun 2 11:52:41 2017 -0400

    GHC.Stats cleanup
    
    This does two things:
    
    * The `RtsTime` type wasn't exported, but it is used as the type of
      several record fields. Let's export it and give it some documentation.
    * Neither `RTSStats` nor `GCDetails` have `Read` or `Show` instances,
      but `GCStats` does! Let's fix this discrepancy.
    
    Reviewers: austin, hvr, bgamari
    
    Reviewed By: bgamari
    
    Subscribers: goldfire, rwbarton, thomie
    
    Differential Revision: https://phabricator.haskell.org/D3625
    
    (cherry picked from commit 811a2986475d88f73bb22b4600970039e1b582d6)


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

96706799d6cd3c077f31c93e468d6864c358dc09
 libraries/base/GHC/Stats.hsc | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libraries/base/GHC/Stats.hsc b/libraries/base/GHC/Stats.hsc
index d5d48f5..c4e2e80 100644
--- a/libraries/base/GHC/Stats.hsc
+++ b/libraries/base/GHC/Stats.hsc
@@ -15,7 +15,7 @@
 module GHC.Stats
     (
     -- * Runtime statistics
-      RTSStats(..), GCDetails(..)
+      RTSStats(..), GCDetails(..), RtsTime
     , getRTSStats
     , getRTSStatsEnabled
 
@@ -104,7 +104,7 @@ data RTSStats = RTSStats {
 
     -- | Details about the most recent GC
   , gc :: GCDetails
-  }
+  } deriving (Read, Show)
 
 --
 -- | Statistics about a single GC.  This is a mirror of the C @struct
@@ -138,9 +138,9 @@ data GCDetails = GCDetails {
   , gcdetails_cpu_ns :: RtsTime
     -- | The time elapsed during GC itself
   , gcdetails_elapsed_ns :: RtsTime
-  }
-
+  } deriving (Read, Show)
 
+-- | Time values from the RTS, using a fixed resolution of nanoseconds.
 type RtsTime = Int64
 
 -- @since 4.9.0.0



More information about the ghc-commits mailing list