{-# LINE 1 "libraries/ghc-internal/src/GHC/Internal/RTS/Flags/Test.hsc" #-}
{-# LANGUAGE NoImplicitPrelude #-}

-- | Module with fewer dependencies than GHC.Internal.RTS.Flags
-- that allows to quickly test if some flag is set.
module GHC.Internal.RTS.Flags.Test
  ( getUserEventTracingEnabled
  )
where

import GHC.Internal.Base


{-# LINE 13 "libraries/ghc-internal/src/GHC/Internal/RTS/Flags/Test.hsc" #-}

import GHC.Internal.Ptr
import GHC.Internal.Foreign.C.Types
import GHC.Internal.Foreign.Marshal.Utils
import GHC.Internal.Foreign.Storable
import GHC.Internal.Data.Functor ((<$>))




foreign import ccall "&RtsFlags" rtsFlagsPtr :: Ptr ()

{-# LINE 25 "libraries/ghc-internal/src/GHC/Internal/RTS/Flags/Test.hsc" #-}

-- | Specialized version of 'getTraceFlags' for just checking if user
-- event tracing is enabled.
getUserEventTracingEnabled :: IO Bool
getUserEventTracingEnabled :: IO Bool
getUserEventTracingEnabled = do

{-# LINE 34 "libraries/ghc-internal/src/GHC/Internal/RTS/Flags/Test.hsc" #-}
  let ptr :: Ptr b
ptr = ((\Ptr ()
hsc_ptr -> Ptr ()
hsc_ptr Ptr () -> Int -> Ptr b
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
392)) Ptr ()
rtsFlagsPtr
{-# LINE 35 "libraries/ghc-internal/src/GHC/Internal/RTS/Flags/Test.hsc" #-}
  toBool <$> ((\hsc_ptr -> peekByteOff hsc_ptr 11) ptr :: IO CBool)
{-# LINE 36 "libraries/ghc-internal/src/GHC/Internal/RTS/Flags/Test.hsc" #-}

{-# LINE 37 "libraries/ghc-internal/src/GHC/Internal/RTS/Flags/Test.hsc" #-}