Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use RTSStats instead. This will be removed in GHC 8.4.1 #146

Closed
RyanGlScott opened this issue May 30, 2017 · 1 comment
Closed

Use RTSStats instead. This will be removed in GHC 8.4.1 #146

RyanGlScott opened this issue May 30, 2017 · 1 comment

Comments

@RyanGlScott
Copy link
Member

Compiling criterion on GHC 8.2.1 warns of impending doom:

[ 1 of 13] Compiling Criterion.Types  ( Criterion/Types.hs, dist/build/Criterion/Types.o )
[ 2 of 13] Compiling Criterion.Monad.Internal ( Criterion/Monad/Internal.hs, dist/build/Criterion/Monad/Internal.o )
[ 3 of 13] Compiling Criterion.Measurement ( Criterion/Measurement.hs, dist/build/Criterion/Measurement.o )

Criterion/Measurement.hs:51:25: warning: [-Wdeprecations]
    In the use of type constructor or class ‘GCStats’
    (imported from GHC.Stats):
    Deprecated: "Use RTSStats instead.  This will be removed in GHC 8.4.1"
   |
51 | getGCStats :: IO (Maybe GCStats)
   |                         ^^^^^^^

Criterion/Measurement.hs:53:16: warning: [-Wdeprecations]
    In the use of ‘getGCStats’ (imported from GHC.Stats):
    Deprecated: "Use getRTSStats instead.  This will be removed in GHC 8.4.1"
   |
53 |   (Just `fmap` Stats.getGCStats) `Exc.catch` \(_::Exc.SomeException) ->
   |                ^^^^^^^^^^^^^^^^

Criterion/Measurement.hs:203:23: warning: [-Wdeprecations]
    In the use of type constructor or class ‘GCStats’
    (imported from GHC.Stats):
    Deprecated: "Use RTSStats instead.  This will be removed in GHC 8.4.1"
    |
203 | applyGCStats :: Maybe GCStats
    |                       ^^^^^^^

Criterion/Measurement.hs:205:23: warning: [-Wdeprecations]
    In the use of type constructor or class ‘GCStats’
    (imported from GHC.Stats):
    Deprecated: "Use RTSStats instead.  This will be removed in GHC 8.4.1"
    |
205 |              -> Maybe GCStats
    |                       ^^^^^^^

Criterion/Measurement.hs:211:35: warning: [-Wdeprecations]
    In the use of ‘bytesAllocated’ (imported from GHC.Stats):
    Deprecated: "Use RTSStats instead.  This will be removed in GHC 8.4.1"
    |
211 |     measAllocated          = diff bytesAllocated
    |                                   ^^^^^^^^^^^^^^

Criterion/Measurement.hs:212:35: warning: [-Wdeprecations]
    In the use of ‘numGcs’ (imported from GHC.Stats):
    Deprecated: "Use RTSStats instead.  This will be removed in GHC 8.4.1"
    |
212 |   , measNumGcs             = diff numGcs
    |                                   ^^^^^^

Criterion/Measurement.hs:213:35: warning: [-Wdeprecations]
    In the use of ‘bytesCopied’ (imported from GHC.Stats):
    Deprecated: "Use RTSStats instead.  This will be removed in GHC 8.4.1"
    |
213 |   , measBytesCopied        = diff bytesCopied
    |                                   ^^^^^^^^^^^

Criterion/Measurement.hs:214:35: warning: [-Wdeprecations]
    In the use of ‘mutatorWallSeconds’ (imported from GHC.Stats):
    Deprecated: "Use RTSStats instead.  This will be removed in GHC 8.4.1"
    |
214 |   , measMutatorWallSeconds = diff mutatorWallSeconds
    |                                   ^^^^^^^^^^^^^^^^^^

Criterion/Measurement.hs:215:35: warning: [-Wdeprecations]
    In the use of ‘mutatorCpuSeconds’ (imported from GHC.Stats):
    Deprecated: "Use RTSStats instead.  This will be removed in GHC 8.4.1"
    |
215 |   , measMutatorCpuSeconds  = diff mutatorCpuSeconds
    |                                   ^^^^^^^^^^^^^^^^^

Criterion/Measurement.hs:216:35: warning: [-Wdeprecations]
    In the use of ‘gcWallSeconds’ (imported from GHC.Stats):
    Deprecated: "Use RTSStats instead.  This will be removed in GHC 8.4.1"
    |
216 |   , measGcWallSeconds      = diff gcWallSeconds
    |                                   ^^^^^^^^^^^^^

Criterion/Measurement.hs:217:35: warning: [-Wdeprecations]
    In the use of ‘gcCpuSeconds’ (imported from GHC.Stats):
    Deprecated: "Use RTSStats instead.  This will be removed in GHC 8.4.1"
    |
217 |   , measGcCpuSeconds       = diff gcCpuSeconds
    |                                   ^^^^^^^^^^^^
[ 4 of 13] Compiling Criterion.Monad  ( Criterion/Monad.hs, dist/build/Criterion/Monad.o )
[ 5 of 13] Compiling Criterion.IO.Printf ( Criterion/IO/Printf.hs, dist/build/Criterion/IO/Printf.o )
[ 6 of 13] Compiling Criterion.Analysis ( Criterion/Analysis.hs, dist/build/Criterion/Analysis.o )
[ 7 of 13] Compiling Paths_criterion  ( dist/build/autogen/Paths_criterion.hs, dist/build/Paths_criterion.o )
[ 8 of 13] Compiling Criterion.Report ( Criterion/Report.hs, dist/build/Criterion/Report.o )
[ 9 of 13] Compiling Criterion.Main.Options ( Criterion/Main/Options.hs, dist/build/Criterion/Main/Options.o )
[10 of 13] Compiling Criterion.IO     ( Criterion/IO.hs, dist/build/Criterion/IO.o )
[11 of 13] Compiling Criterion.Internal ( Criterion/Internal.hs, dist/build/Criterion/Internal.o )
[12 of 13] Compiling Criterion.Main   ( Criterion/Main.hs, dist/build/Criterion/Main.o )
[13 of 13] Compiling Criterion        ( Criterion.hs, dist/build/Criterion.o )

We should find a way to migrate over to RTSStats on GHC 8.2.1 or later, as the warning suggests.

@RyanGlScott
Copy link
Member Author

One minor complication with this plan is that criterion directly exposes a function getGCStats :: IO GCStats, which is obviously not sustainable given GCStats' planned obsolescence. I believe we should deprecate our getGCStats as well in favor of something like getMeasured :: IO Measured, and make sure that Measured provides a backwards compatible view into RTS stats.

RyanGlScott added a commit that referenced this issue Jun 23, 2017
* Fix #146 by introducing GCStatistics

* Delete unused fields
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant