[Git][ghc/ghc][master] base: Reflect new era profiling RTS flags in GHC.RTS.Flags

Marge Bot (@marge-bot) gitlab at gitlab.haskell.org
Wed Mar 6 02:44:57 UTC 2024



Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
4074a3f2 by Matthew Pickering at 2024-03-05T21:44:35-05:00
base: Reflect new era profiling RTS flags in GHC.RTS.Flags

* -he profiling mode
* -he profiling selector
* --automatic-era-increment

CLC proposal #254 - https://github.com/haskell/core-libraries-committee/issues/254

- - - - -


6 changed files:

- libraries/base/changelog.md
- libraries/ghc-internal/src/GHC/Internal/RTS/Flags.hsc
- testsuite/tests/interface-stability/base-exports.stdout
- testsuite/tests/interface-stability/base-exports.stdout-javascript-unknown-ghcjs
- testsuite/tests/interface-stability/base-exports.stdout-mingw32
- testsuite/tests/interface-stability/base-exports.stdout-ws-32


Changes:

=====================================
libraries/base/changelog.md
=====================================
@@ -50,6 +50,10 @@
 
   * Treat all FDs as "nonblocking" on wasm32 ([CLC proposal #234](https://github.com/haskell/core-libraries-committee/issues/234))
 
+  * Add `HeapByEra`, `eraSelector` and `automaticEraIncrement` to `GHC.RTS.Flags` to
+    reflect the new RTS flags: `-he` profiling mode, `-he` selector and `--automatic-era-increment`.
+    ([CLC proposal #254](https://github.com/haskell/core-libraries-committee/issues/254))
+
 ## 4.19.0.0 *October 2023*
   * Add `{-# WARNING in "x-partial" #-}` to `Data.List.{head,tail}`.
     Use `{-# OPTIONS_GHC -Wno-x-partial #-}` to disable it.


=====================================
libraries/ghc-internal/src/GHC/Internal/RTS/Flags.hsc
=====================================
@@ -274,6 +274,7 @@ data DoHeapProfile
     | HeapByLDV
     | HeapByClosureType
     | HeapByInfoTable
+    | HeapByEra -- ^ @since base-4.20.0.0
     deriving ( Show -- ^ @since base-4.8.0.0
              , Generic -- ^ @since base-4.15.0.0
              )
@@ -289,6 +290,7 @@ instance Enum DoHeapProfile where
     fromEnum HeapByLDV         = #{const HEAP_BY_LDV}
     fromEnum HeapByClosureType = #{const HEAP_BY_CLOSURE_TYPE}
     fromEnum HeapByInfoTable   = #{const HEAP_BY_INFO_TABLE}
+    fromEnum HeapByEra         = #{const HEAP_BY_ERA}
 
     toEnum #{const NO_HEAP_PROFILING}    = NoHeapProfiling
     toEnum #{const HEAP_BY_CCS}          = HeapByCCS
@@ -299,6 +301,7 @@ instance Enum DoHeapProfile where
     toEnum #{const HEAP_BY_LDV}          = HeapByLDV
     toEnum #{const HEAP_BY_CLOSURE_TYPE} = HeapByClosureType
     toEnum #{const HEAP_BY_INFO_TABLE}   = HeapByInfoTable
+    toEnum #{const HEAP_BY_ERA}          = HeapByEra
     toEnum e = errorWithoutStackTrace ("invalid enum for DoHeapProfile: " ++ show e)
 
 -- | Parameters of the cost-center profiler
@@ -311,6 +314,7 @@ data ProfFlags = ProfFlags
     , startHeapProfileAtStartup :: Bool
     , startTimeProfileAtStartup :: Bool   -- ^ @since base-4.20.0.0
     , showCCSOnException       :: Bool
+    , automaticEraIncrement    :: Bool   -- ^ @since 4.20.0.0
     , maxRetainerSetSize       :: Word
     , ccsLength                :: Word
     , modSelector              :: Maybe String
@@ -320,6 +324,7 @@ data ProfFlags = ProfFlags
     , ccsSelector              :: Maybe String
     , retainerSelector         :: Maybe String
     , bioSelector              :: Maybe String
+    , eraSelector              :: Word -- ^ @since base-4.20.0.0
     } deriving ( Show -- ^ @since base-4.8.0.0
                , Generic -- ^ @since base-4.15.0.0
                )
@@ -633,6 +638,8 @@ getProfFlags = do
                   (#{peek PROFILING_FLAGS, startTimeProfileAtStartup} ptr :: IO CBool))
             <*> (toBool <$>
                   (#{peek PROFILING_FLAGS, showCCSOnException} ptr :: IO CBool))
+            <*> (toBool <$>
+                  (#{peek PROFILING_FLAGS, incrementUserEra} ptr :: IO CBool))
             <*> #{peek PROFILING_FLAGS, maxRetainerSetSize} ptr
             <*> #{peek PROFILING_FLAGS, ccsLength} ptr
             <*> (peekCStringOpt =<< #{peek PROFILING_FLAGS, modSelector} ptr)
@@ -642,6 +649,7 @@ getProfFlags = do
             <*> (peekCStringOpt =<< #{peek PROFILING_FLAGS, ccsSelector} ptr)
             <*> (peekCStringOpt =<< #{peek PROFILING_FLAGS, retainerSelector} ptr)
             <*> (peekCStringOpt =<< #{peek PROFILING_FLAGS, bioSelector} ptr)
+            <*> #{peek PROFILING_FLAGS, eraSelector} ptr
 
 getTraceFlags :: IO TraceFlags
 getTraceFlags = do


=====================================
testsuite/tests/interface-stability/base-exports.stdout
=====================================
@@ -9029,7 +9029,7 @@ module GHC.RTS.Flags where
   type DoCostCentres :: *
   data DoCostCentres = CostCentresNone | CostCentresSummary | CostCentresVerbose | CostCentresAll | CostCentresJSON
   type DoHeapProfile :: *
-  data DoHeapProfile = NoHeapProfiling | HeapByCCS | HeapByMod | HeapByDescr | HeapByType | HeapByRetainer | HeapByLDV | HeapByClosureType | HeapByInfoTable
+  data DoHeapProfile = NoHeapProfiling | HeapByCCS | HeapByMod | HeapByDescr | HeapByType | HeapByRetainer | HeapByLDV | HeapByClosureType | HeapByInfoTable | HeapByEra
   type DoTrace :: *
   data DoTrace = TraceNone | TraceEventLog | TraceStderr
   type GCFlags :: *
@@ -9080,6 +9080,7 @@ module GHC.RTS.Flags where
                  startHeapProfileAtStartup :: GHC.Types.Bool,
                  startTimeProfileAtStartup :: GHC.Types.Bool,
                  showCCSOnException :: GHC.Types.Bool,
+                 automaticEraIncrement :: GHC.Types.Bool,
                  maxRetainerSetSize :: GHC.Types.Word,
                  ccsLength :: GHC.Types.Word,
                  modSelector :: GHC.Internal.Maybe.Maybe GHC.Internal.Base.String,
@@ -9088,7 +9089,8 @@ module GHC.RTS.Flags where
                  ccSelector :: GHC.Internal.Maybe.Maybe GHC.Internal.Base.String,
                  ccsSelector :: GHC.Internal.Maybe.Maybe GHC.Internal.Base.String,
                  retainerSelector :: GHC.Internal.Maybe.Maybe GHC.Internal.Base.String,
-                 bioSelector :: GHC.Internal.Maybe.Maybe GHC.Internal.Base.String}
+                 bioSelector :: GHC.Internal.Maybe.Maybe GHC.Internal.Base.String,
+                 eraSelector :: GHC.Types.Word}
   type RTSFlags :: *
   data RTSFlags = RTSFlags {gcFlags :: GCFlags, concurrentFlags :: ConcFlags, miscFlags :: MiscFlags, debugFlags :: DebugFlags, costCentreFlags :: CCFlags, profilingFlags :: ProfFlags, traceFlags :: TraceFlags, tickyFlags :: TickyFlags, parFlags :: ParFlags, hpcFlags :: HpcFlags}
   type RtsTime :: *


=====================================
testsuite/tests/interface-stability/base-exports.stdout-javascript-unknown-ghcjs
=====================================
@@ -12071,7 +12071,7 @@ module GHC.RTS.Flags where
   type DoCostCentres :: *
   data DoCostCentres = CostCentresNone | CostCentresSummary | CostCentresVerbose | CostCentresAll | CostCentresJSON
   type DoHeapProfile :: *
-  data DoHeapProfile = NoHeapProfiling | HeapByCCS | HeapByMod | HeapByDescr | HeapByType | HeapByRetainer | HeapByLDV | HeapByClosureType | HeapByInfoTable
+  data DoHeapProfile = NoHeapProfiling | HeapByCCS | HeapByMod | HeapByDescr | HeapByType | HeapByRetainer | HeapByLDV | HeapByClosureType | HeapByInfoTable | HeapByEra
   type DoTrace :: *
   data DoTrace = TraceNone | TraceEventLog | TraceStderr
   type GCFlags :: *
@@ -12122,6 +12122,7 @@ module GHC.RTS.Flags where
                  startHeapProfileAtStartup :: GHC.Types.Bool,
                  startTimeProfileAtStartup :: GHC.Types.Bool,
                  showCCSOnException :: GHC.Types.Bool,
+                 automaticEraIncrement :: GHC.Types.Bool,
                  maxRetainerSetSize :: GHC.Types.Word,
                  ccsLength :: GHC.Types.Word,
                  modSelector :: GHC.Internal.Maybe.Maybe GHC.Internal.Base.String,
@@ -12130,7 +12131,8 @@ module GHC.RTS.Flags where
                  ccSelector :: GHC.Internal.Maybe.Maybe GHC.Internal.Base.String,
                  ccsSelector :: GHC.Internal.Maybe.Maybe GHC.Internal.Base.String,
                  retainerSelector :: GHC.Internal.Maybe.Maybe GHC.Internal.Base.String,
-                 bioSelector :: GHC.Internal.Maybe.Maybe GHC.Internal.Base.String}
+                 bioSelector :: GHC.Internal.Maybe.Maybe GHC.Internal.Base.String,
+                 eraSelector :: GHC.Types.Word}
   type RTSFlags :: *
   data RTSFlags = RTSFlags {gcFlags :: GCFlags, concurrentFlags :: ConcFlags, miscFlags :: MiscFlags, debugFlags :: DebugFlags, costCentreFlags :: CCFlags, profilingFlags :: ProfFlags, traceFlags :: TraceFlags, tickyFlags :: TickyFlags, parFlags :: ParFlags, hpcFlags :: HpcFlags}
   type RtsTime :: *


=====================================
testsuite/tests/interface-stability/base-exports.stdout-mingw32
=====================================
@@ -9253,7 +9253,7 @@ module GHC.RTS.Flags where
   type DoCostCentres :: *
   data DoCostCentres = CostCentresNone | CostCentresSummary | CostCentresVerbose | CostCentresAll | CostCentresJSON
   type DoHeapProfile :: *
-  data DoHeapProfile = NoHeapProfiling | HeapByCCS | HeapByMod | HeapByDescr | HeapByType | HeapByRetainer | HeapByLDV | HeapByClosureType | HeapByInfoTable
+  data DoHeapProfile = NoHeapProfiling | HeapByCCS | HeapByMod | HeapByDescr | HeapByType | HeapByRetainer | HeapByLDV | HeapByClosureType | HeapByInfoTable | HeapByEra
   type DoTrace :: *
   data DoTrace = TraceNone | TraceEventLog | TraceStderr
   type GCFlags :: *
@@ -9304,6 +9304,7 @@ module GHC.RTS.Flags where
                  startHeapProfileAtStartup :: GHC.Types.Bool,
                  startTimeProfileAtStartup :: GHC.Types.Bool,
                  showCCSOnException :: GHC.Types.Bool,
+                 automaticEraIncrement :: GHC.Types.Bool,
                  maxRetainerSetSize :: GHC.Types.Word,
                  ccsLength :: GHC.Types.Word,
                  modSelector :: GHC.Internal.Maybe.Maybe GHC.Internal.Base.String,
@@ -9312,7 +9313,8 @@ module GHC.RTS.Flags where
                  ccSelector :: GHC.Internal.Maybe.Maybe GHC.Internal.Base.String,
                  ccsSelector :: GHC.Internal.Maybe.Maybe GHC.Internal.Base.String,
                  retainerSelector :: GHC.Internal.Maybe.Maybe GHC.Internal.Base.String,
-                 bioSelector :: GHC.Internal.Maybe.Maybe GHC.Internal.Base.String}
+                 bioSelector :: GHC.Internal.Maybe.Maybe GHC.Internal.Base.String,
+                 eraSelector :: GHC.Types.Word}
   type RTSFlags :: *
   data RTSFlags = RTSFlags {gcFlags :: GCFlags, concurrentFlags :: ConcFlags, miscFlags :: MiscFlags, debugFlags :: DebugFlags, costCentreFlags :: CCFlags, profilingFlags :: ProfFlags, traceFlags :: TraceFlags, tickyFlags :: TickyFlags, parFlags :: ParFlags, hpcFlags :: HpcFlags}
   type RtsTime :: *


=====================================
testsuite/tests/interface-stability/base-exports.stdout-ws-32
=====================================
@@ -9029,7 +9029,7 @@ module GHC.RTS.Flags where
   type DoCostCentres :: *
   data DoCostCentres = CostCentresNone | CostCentresSummary | CostCentresVerbose | CostCentresAll | CostCentresJSON
   type DoHeapProfile :: *
-  data DoHeapProfile = NoHeapProfiling | HeapByCCS | HeapByMod | HeapByDescr | HeapByType | HeapByRetainer | HeapByLDV | HeapByClosureType | HeapByInfoTable
+  data DoHeapProfile = NoHeapProfiling | HeapByCCS | HeapByMod | HeapByDescr | HeapByType | HeapByRetainer | HeapByLDV | HeapByClosureType | HeapByInfoTable | HeapByEra
   type DoTrace :: *
   data DoTrace = TraceNone | TraceEventLog | TraceStderr
   type GCFlags :: *
@@ -9080,6 +9080,7 @@ module GHC.RTS.Flags where
                  startHeapProfileAtStartup :: GHC.Types.Bool,
                  startTimeProfileAtStartup :: GHC.Types.Bool,
                  showCCSOnException :: GHC.Types.Bool,
+                 automaticEraIncrement :: GHC.Types.Bool,
                  maxRetainerSetSize :: GHC.Types.Word,
                  ccsLength :: GHC.Types.Word,
                  modSelector :: GHC.Internal.Maybe.Maybe GHC.Internal.Base.String,
@@ -9088,7 +9089,8 @@ module GHC.RTS.Flags where
                  ccSelector :: GHC.Internal.Maybe.Maybe GHC.Internal.Base.String,
                  ccsSelector :: GHC.Internal.Maybe.Maybe GHC.Internal.Base.String,
                  retainerSelector :: GHC.Internal.Maybe.Maybe GHC.Internal.Base.String,
-                 bioSelector :: GHC.Internal.Maybe.Maybe GHC.Internal.Base.String}
+                 bioSelector :: GHC.Internal.Maybe.Maybe GHC.Internal.Base.String,
+                 eraSelector :: GHC.Types.Word}
   type RTSFlags :: *
   data RTSFlags = RTSFlags {gcFlags :: GCFlags, concurrentFlags :: ConcFlags, miscFlags :: MiscFlags, debugFlags :: DebugFlags, costCentreFlags :: CCFlags, profilingFlags :: ProfFlags, traceFlags :: TraceFlags, tickyFlags :: TickyFlags, parFlags :: ParFlags, hpcFlags :: HpcFlags}
   type RtsTime :: *



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/4074a3f2007a118f7ee0c953559c4ba7bc61d6dd

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/4074a3f2007a118f7ee0c953559c4ba7bc61d6dd
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20240305/f9942c15/attachment-0001.html>


More information about the ghc-commits mailing list