#if MIN_VERSION_base(4,8,0)
#endif
module Text.Show.Text.GHC.RTS.Flags (
#if !(MIN_VERSION_base(4,8,0))
) where
#else
showbRTSFlagsPrec
, showbGCFlagsPrec
, showbConcFlagsPrec
, showbMiscFlagsPrec
, showbDebugFlagsPrec
, showbCCFlagsPrec
, showbProfFlagsPrec
, showbTraceFlagsPrec
, showbTickyFlagsPrec
) where
import Data.Monoid.Compat ((<>))
import Data.Text.Lazy.Builder (Builder)
import GHC.RTS.Flags
import Prelude hiding (Show)
import Text.Show.Text.Classes (Show(showb, showbPrec), FromStringShow(..))
import Text.Show.Text.Data.Bool (showbBool)
import Text.Show.Text.Data.Char ()
import Text.Show.Text.Data.Floating (showbDoublePrec)
import Text.Show.Text.Data.Integral (showbIntPrec, showbWord, showbWord64)
import Text.Show.Text.Data.List ()
import Text.Show.Text.Data.Maybe (showbMaybePrec)
import Text.Show.Text.Utils (s)
import Text.Show.Text.TH.Internal (deriveShow)
# if __GLASGOW_HASKELL__ < 711
import GHC.Show (appPrec)
import Text.Show.Text.Classes (showbParen)
# endif
showbRTSFlagsPrec :: Int -> RTSFlags -> Builder
showbRTSFlagsPrec = showbPrec
showbGCFlagsPrec :: Int -> GCFlags -> Builder
# if __GLASGOW_HASKELL__ >= 711
showbGCFlagsPrec _ gcfs =
# else
showbGCFlagsPrec p gcfs = showbParen (p > appPrec) $
# endif
"GCFlags {statsFile = "
<> showbMaybePrec 0 (statsFile gcfs)
<> ", giveStats = "
<> showb (FromStringShow $ giveStats gcfs)
<> ", maxStkSize = "
<> showb (maxStkSize gcfs)
<> ", initialStkSize = "
<> showb (initialStkSize gcfs)
<> ", stkChunkSize = "
<> showb (stkChunkSize gcfs)
<> ", stkChunkBufferSize = "
<> showb (stkChunkBufferSize gcfs)
<> ", maxHeapSize = "
<> showb (maxHeapSize gcfs)
<> ", minAllocAreaSize = "
<> showb (minAllocAreaSize gcfs)
<> ", minOldGenSize = "
<> showb (minOldGenSize gcfs)
<> ", heapSizeSuggestion = "
<> showb (heapSizeSuggestion gcfs)
<> ", heapSizeSuggestionAuto = "
<> showbBool (heapSizeSuggestionAuto gcfs)
<> ", oldGenFactor = "
<> showbDoublePrec 0 (oldGenFactor gcfs)
<> ", pcFreeHeap = "
<> showbDoublePrec 0 (pcFreeHeap gcfs)
<> ", generations = "
<> showb (generations gcfs)
<> ", steps = "
<> showb (steps gcfs)
<> ", squeezeUpdFrames = "
<> showbBool (squeezeUpdFrames gcfs)
<> ", compact = "
<> showbBool (compact gcfs)
<> ", compactThreshold = "
<> showbDoublePrec 0 (compactThreshold gcfs)
<> ", sweep = "
<> showbBool (sweep gcfs)
<> ", ringBell = "
<> showbBool (ringBell gcfs)
<> ", frontpanel = "
<> showbBool (frontpanel gcfs)
<> ", idleGCDelayTime = "
<> showbWord64 (idleGCDelayTime gcfs)
<> ", doIdleGC = "
<> showbBool (doIdleGC gcfs)
<> ", heapBase = "
<> showbWord (heapBase gcfs)
<> ", allocLimitGrace = "
<> showbWord (allocLimitGrace gcfs)
<> s '}'
showbConcFlagsPrec :: Int -> ConcFlags -> Builder
showbConcFlagsPrec = showbPrec
showbMiscFlagsPrec :: Int -> MiscFlags -> Builder
showbMiscFlagsPrec = showbPrec
showbDebugFlagsPrec :: Int -> DebugFlags -> Builder
showbDebugFlagsPrec = showbPrec
showbCCFlagsPrec :: Int -> CCFlags -> Builder
# if __GLASGOW_HASKELL__ >= 711
showbCCFlagsPrec _ ccfs =
# else
showbCCFlagsPrec p ccfs = showbParen (p > appPrec) $
# endif
"CCFlags {doCostCentres = "
<> showb (FromStringShow $ doCostCentres ccfs)
<> ", profilerTicks = "
<> showbIntPrec 0 (profilerTicks ccfs)
<> ", msecsPerTick = "
<> showbIntPrec 0 (msecsPerTick ccfs)
<> s '}'
showbProfFlagsPrec :: Int -> ProfFlags -> Builder
# if __GLASGOW_HASKELL__ >= 711
showbProfFlagsPrec _ pfs =
# else
showbProfFlagsPrec p pfs = showbParen (p > appPrec) $
# endif
"ProfFlags {doHeapProfile = "
<> showb (FromStringShow $ doHeapProfile pfs)
<> ", heapProfileInterval = "
<> showbWord64 (heapProfileInterval pfs)
<> ", heapProfileIntervalTicks = "
<> showbWord (heapProfileIntervalTicks pfs)
<> ", includeTSOs = "
<> showbBool (includeTSOs pfs)
<> ", showCCSOnException = "
<> showbBool (showCCSOnException pfs)
<> ", maxRetainerSetSize = "
<> showbWord (maxRetainerSetSize pfs)
<> ", ccsLength = "
<> showbWord (ccsLength pfs)
<> ", modSelector = "
<> showbMaybePrec 0 (modSelector pfs)
<> ", descrSelector = "
<> showbMaybePrec 0 (descrSelector pfs)
<> ", typeSelector = "
<> showbMaybePrec 0 (typeSelector pfs)
<> ", ccSelector = "
<> showbMaybePrec 0 (ccSelector pfs)
<> ", ccsSelector = "
<> showbMaybePrec 0 (ccsSelector pfs)
<> ", retainerSelector = "
<> showbMaybePrec 0 (retainerSelector pfs)
<> ", bioSelector = "
<> showbMaybePrec 0 (bioSelector pfs)
<> s '}'
showbTraceFlagsPrec :: Int -> TraceFlags -> Builder
# if __GLASGOW_HASKELL__ >= 711
showbTraceFlagsPrec _ tfs =
# else
showbTraceFlagsPrec p tfs = showbParen (p > appPrec) $
# endif
"TraceFlags {tracing = "
<> showb (FromStringShow $ tracing tfs)
<> ", timestamp = "
<> showbBool (timestamp tfs)
<> ", traceScheduler = "
<> showbBool (traceScheduler tfs)
<> ", traceGc = "
<> showbBool (traceGc tfs)
<> ", sparksSampled = "
<> showbBool (sparksSampled tfs)
<> ", sparksFull = "
<> showbBool (sparksFull tfs)
<> ", user = "
<> showbBool (user tfs)
<> s '}'
showbTickyFlagsPrec :: Int -> TickyFlags -> Builder
showbTickyFlagsPrec = showbPrec
$(deriveShow ''RTSFlags)
instance Show GCFlags where
showbPrec = showbGCFlagsPrec
$(deriveShow ''ConcFlags)
$(deriveShow ''MiscFlags)
$(deriveShow ''DebugFlags)
instance Show CCFlags where
showbPrec = showbCCFlagsPrec
instance Show ProfFlags where
showbPrec = showbProfFlagsPrec
instance Show TraceFlags where
showbPrec = showbTraceFlagsPrec
$(deriveShow ''TickyFlags)
#endif