-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Library and tool for parsing .eventlog files from GHC
--   
--   Parses .eventlog files emitted by GHC 6.12.1 and later. Includes the
--   ghc-events tool permitting, in particular, to dump an event log file
--   as text.
@package ghc-events
@version 0.17.0.3

module GHC.RTS.Events.Incremental

-- | The unfolding of the decoding process.
data Decoder a

-- | The decoder has consumed all the available input and needs more to
--   continue.
Consume :: (ByteString -> Decoder a) -> Decoder a

-- | The decoder has returned a decoded value and the next decoder state to
--   continue.
Produce :: !a -> Decoder a -> Decoder a

-- | The decoder has ended with leftover input.
Done :: ByteString -> Decoder a

-- | The decoder has encountered an error with leftover input and an error
--   message.
Error :: ByteString -> String -> Decoder a

-- | Decode a header
decodeHeader :: Decoder Header

-- | Decode events
decodeEvents :: Header -> Decoder Event

-- | Decode a header and events
decodeEventLog :: Decoder Event

-- | Read a header from a lazy bytestring and return the header and the
--   leftover input for subsequent decoding.
--   
--   Note that the input must contain a whole header in one go. If
--   incremental parsing of a header is necessary, use <a>decodeHeader</a>
--   instead.
readHeader :: ByteString -> Either String (Header, ByteString)

-- | Read events from a lazy bytestring. It returns an error message if it
--   encounters an error while decoding.
--   
--   Note that it doesn't fail if it consumes all input in the middle of
--   decoding of an event.
readEvents :: Header -> ByteString -> ([Event], Maybe String)

-- | Read an entire event log from a lazy bytestring. It returns an error
--   message if it encounters an error while decoding.
--   
--   Note that it doesn't fail if it consumes all input in the middle of
--   decoding of an event.
readEventLog :: ByteString -> Either String (EventLog, Maybe String)

module GHC.RTS.Events
data EventLog
EventLog :: Header -> Data -> EventLog
[header] :: EventLog -> Header
[dat] :: EventLog -> Data
newtype Header
Header :: [EventType] -> Header
[eventTypes] :: Header -> [EventType]
data Data
Data :: [Event] -> Data
[events] :: Data -> [Event]
data EventType
EventType :: EventTypeNum -> EventTypeDesc -> Maybe EventTypeSize -> EventType
[num] :: EventType -> EventTypeNum
[desc] :: EventType -> EventTypeDesc

-- | <a>Nothing</a> indicates variable size
[size] :: EventType -> Maybe EventTypeSize
data Event
Event :: {-# UNPACK #-} !Timestamp -> EventInfo -> Maybe Int -> Event
[evTime] :: Event -> {-# UNPACK #-} !Timestamp
[evSpec] :: Event -> EventInfo
[evCap] :: Event -> Maybe Int
data EventInfo
EventBlock :: Timestamp -> Int -> BlockSize -> EventInfo
[end_time] :: EventInfo -> Timestamp
[cap] :: EventInfo -> Int
[block_size] :: EventInfo -> BlockSize
UnknownEvent :: {-# UNPACK #-} !EventTypeNum -> EventInfo
[ref] :: EventInfo -> {-# UNPACK #-} !EventTypeNum
Startup :: Int -> EventInfo
[n_caps] :: EventInfo -> Int
Shutdown :: EventInfo
CreateThread :: {-# UNPACK #-} !ThreadId -> EventInfo
[thread] :: EventInfo -> {-# UNPACK #-} !ThreadId
RunThread :: {-# UNPACK #-} !ThreadId -> EventInfo
[thread] :: EventInfo -> {-# UNPACK #-} !ThreadId
StopThread :: {-# UNPACK #-} !ThreadId -> !ThreadStopStatus -> EventInfo
[thread] :: EventInfo -> {-# UNPACK #-} !ThreadId
[status] :: EventInfo -> !ThreadStopStatus
ThreadRunnable :: {-# UNPACK #-} !ThreadId -> EventInfo
[thread] :: EventInfo -> {-# UNPACK #-} !ThreadId
MigrateThread :: {-# UNPACK #-} !ThreadId -> {-# UNPACK #-} !Int -> EventInfo
[thread] :: EventInfo -> {-# UNPACK #-} !ThreadId
[newCap] :: EventInfo -> {-# UNPACK #-} !Int
WakeupThread :: {-# UNPACK #-} !ThreadId -> {-# UNPACK #-} !Int -> EventInfo
[thread] :: EventInfo -> {-# UNPACK #-} !ThreadId
[otherCap] :: EventInfo -> {-# UNPACK #-} !Int
ThreadLabel :: {-# UNPACK #-} !ThreadId -> !Text -> EventInfo
[thread] :: EventInfo -> {-# UNPACK #-} !ThreadId
[threadlabel] :: EventInfo -> !Text
CreateSparkThread :: {-# UNPACK #-} !ThreadId -> EventInfo
[sparkThread] :: EventInfo -> {-# UNPACK #-} !ThreadId
SparkCounters :: {-# UNPACK #-} !Word64 -> EventInfo
[sparksCreated, sparksDud, sparksOverflowed, sparksConverted, sparksFizzled, sparksGCd, sparksRemaining] :: EventInfo -> {-# UNPACK #-} !Word64
SparkCreate :: EventInfo
SparkDud :: EventInfo
SparkOverflow :: EventInfo
SparkRun :: EventInfo
SparkSteal :: {-# UNPACK #-} !Int -> EventInfo
[victimCap] :: EventInfo -> {-# UNPACK #-} !Int
SparkFizzle :: EventInfo
SparkGC :: EventInfo
TaskCreate :: TaskId -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !KernelThreadId -> EventInfo
[taskId] :: EventInfo -> TaskId
[cap] :: EventInfo -> {-# UNPACK #-} !Int
[tid] :: EventInfo -> {-# UNPACK #-} !KernelThreadId
TaskMigrate :: TaskId -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> EventInfo
[taskId] :: EventInfo -> TaskId
[cap] :: EventInfo -> {-# UNPACK #-} !Int
[new_cap] :: EventInfo -> {-# UNPACK #-} !Int
TaskDelete :: TaskId -> EventInfo
[taskId] :: EventInfo -> TaskId
RequestSeqGC :: EventInfo
RequestParGC :: EventInfo
StartGC :: EventInfo
GCWork :: EventInfo
GCIdle :: EventInfo
GCDone :: EventInfo
EndGC :: EventInfo
GlobalSyncGC :: EventInfo
GCStatsGHC :: {-# UNPACK #-} !Capset -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Word64 -> {-# UNPACK #-} !Word64 -> {-# UNPACK #-} !Word64 -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Word64 -> {-# UNPACK #-} !Word64 -> !Maybe Word64 -> EventInfo
[heapCapset] :: EventInfo -> {-# UNPACK #-} !Capset
[gen] :: EventInfo -> {-# UNPACK #-} !Int
[copied] :: EventInfo -> {-# UNPACK #-} !Word64
[slop] :: EventInfo -> {-# UNPACK #-} !Word64
[frag] :: EventInfo -> {-# UNPACK #-} !Word64
[parNThreads] :: EventInfo -> {-# UNPACK #-} !Int
[parMaxCopied] :: EventInfo -> {-# UNPACK #-} !Word64
[parTotCopied] :: EventInfo -> {-# UNPACK #-} !Word64
[parBalancedCopied] :: EventInfo -> !Maybe Word64
MemReturn :: !Capset -> !Word32 -> !Word32 -> !Word32 -> EventInfo
[heapCapset] :: EventInfo -> !Capset
[current] :: EventInfo -> !Word32
[needed] :: EventInfo -> !Word32
[returned] :: EventInfo -> !Word32
HeapAllocated :: {-# UNPACK #-} !Capset -> {-# UNPACK #-} !Word64 -> EventInfo
[heapCapset] :: EventInfo -> {-# UNPACK #-} !Capset
[allocBytes] :: EventInfo -> {-# UNPACK #-} !Word64
HeapSize :: {-# UNPACK #-} !Capset -> {-# UNPACK #-} !Word64 -> EventInfo
[heapCapset] :: EventInfo -> {-# UNPACK #-} !Capset
[sizeBytes] :: EventInfo -> {-# UNPACK #-} !Word64
BlocksSize :: {-# UNPACK #-} !Capset -> {-# UNPACK #-} !Word64 -> EventInfo
[heapCapset] :: EventInfo -> {-# UNPACK #-} !Capset
[blocksSize] :: EventInfo -> {-# UNPACK #-} !Word64
HeapLive :: {-# UNPACK #-} !Capset -> {-# UNPACK #-} !Word64 -> EventInfo
[heapCapset] :: EventInfo -> {-# UNPACK #-} !Capset
[liveBytes] :: EventInfo -> {-# UNPACK #-} !Word64
HeapInfoGHC :: {-# UNPACK #-} !Capset -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Word64 -> {-# UNPACK #-} !Word64 -> {-# UNPACK #-} !Word64 -> {-# UNPACK #-} !Word64 -> EventInfo
[heapCapset] :: EventInfo -> {-# UNPACK #-} !Capset
[gens] :: EventInfo -> {-# UNPACK #-} !Int
[maxHeapSize] :: EventInfo -> {-# UNPACK #-} !Word64
[allocAreaSize] :: EventInfo -> {-# UNPACK #-} !Word64
[mblockSize] :: EventInfo -> {-# UNPACK #-} !Word64
[blockSize] :: EventInfo -> {-# UNPACK #-} !Word64
CapCreate :: {-# UNPACK #-} !Int -> EventInfo
[cap] :: EventInfo -> {-# UNPACK #-} !Int
CapDelete :: {-# UNPACK #-} !Int -> EventInfo
[cap] :: EventInfo -> {-# UNPACK #-} !Int
CapDisable :: {-# UNPACK #-} !Int -> EventInfo
[cap] :: EventInfo -> {-# UNPACK #-} !Int
CapEnable :: {-# UNPACK #-} !Int -> EventInfo
[cap] :: EventInfo -> {-# UNPACK #-} !Int
CapsetCreate :: {-# UNPACK #-} !Capset -> CapsetType -> EventInfo
[capset] :: EventInfo -> {-# UNPACK #-} !Capset
[capsetType] :: EventInfo -> CapsetType
CapsetDelete :: {-# UNPACK #-} !Capset -> EventInfo
[capset] :: EventInfo -> {-# UNPACK #-} !Capset
CapsetAssignCap :: {-# UNPACK #-} !Capset -> {-# UNPACK #-} !Int -> EventInfo
[capset] :: EventInfo -> {-# UNPACK #-} !Capset
[cap] :: EventInfo -> {-# UNPACK #-} !Int
CapsetRemoveCap :: {-# UNPACK #-} !Capset -> {-# UNPACK #-} !Int -> EventInfo
[capset] :: EventInfo -> {-# UNPACK #-} !Capset
[cap] :: EventInfo -> {-# UNPACK #-} !Int
RtsIdentifier :: {-# UNPACK #-} !Capset -> !Text -> EventInfo
[capset] :: EventInfo -> {-# UNPACK #-} !Capset
[rtsident] :: EventInfo -> !Text
ProgramArgs :: {-# UNPACK #-} !Capset -> [Text] -> EventInfo
[capset] :: EventInfo -> {-# UNPACK #-} !Capset
[args] :: EventInfo -> [Text]
ProgramEnv :: {-# UNPACK #-} !Capset -> [Text] -> EventInfo
[capset] :: EventInfo -> {-# UNPACK #-} !Capset
[env] :: EventInfo -> [Text]
OsProcessPid :: {-# UNPACK #-} !Capset -> {-# UNPACK #-} !PID -> EventInfo
[capset] :: EventInfo -> {-# UNPACK #-} !Capset
[pid] :: EventInfo -> {-# UNPACK #-} !PID
OsProcessParentPid :: {-# UNPACK #-} !Capset -> {-# UNPACK #-} !PID -> EventInfo
[capset] :: EventInfo -> {-# UNPACK #-} !Capset
[ppid] :: EventInfo -> {-# UNPACK #-} !PID
WallClockTime :: {-# UNPACK #-} !Capset -> {-# UNPACK #-} !Word64 -> {-# UNPACK #-} !Word32 -> EventInfo
[capset] :: EventInfo -> {-# UNPACK #-} !Capset
[sec] :: EventInfo -> {-# UNPACK #-} !Word64
[nsec] :: EventInfo -> {-# UNPACK #-} !Word32
Message :: !Text -> EventInfo
[msg] :: EventInfo -> !Text
UserMessage :: !Text -> EventInfo
[msg] :: EventInfo -> !Text
UserMarker :: !Text -> EventInfo
[markername] :: EventInfo -> !Text
Version :: String -> EventInfo
[version] :: EventInfo -> String
ProgramInvocation :: String -> EventInfo
[commandline] :: EventInfo -> String
CreateMachine :: {-# UNPACK #-} !MachineId -> {-# UNPACK #-} !Timestamp -> EventInfo
[machine] :: EventInfo -> {-# UNPACK #-} !MachineId
[realtime] :: EventInfo -> {-# UNPACK #-} !Timestamp
KillMachine :: {-# UNPACK #-} !MachineId -> EventInfo
[machine] :: EventInfo -> {-# UNPACK #-} !MachineId
CreateProcess :: {-# UNPACK #-} !ProcessId -> EventInfo
[process] :: EventInfo -> {-# UNPACK #-} !ProcessId
KillProcess :: {-# UNPACK #-} !ProcessId -> EventInfo
[process] :: EventInfo -> {-# UNPACK #-} !ProcessId
AssignThreadToProcess :: {-# UNPACK #-} !ThreadId -> {-# UNPACK #-} !ProcessId -> EventInfo
[thread] :: EventInfo -> {-# UNPACK #-} !ThreadId
[process] :: EventInfo -> {-# UNPACK #-} !ProcessId
EdenStartReceive :: EventInfo
EdenEndReceive :: EventInfo
SendMessage :: !MessageTag -> {-# UNPACK #-} !ProcessId -> {-# UNPACK #-} !ThreadId -> {-# UNPACK #-} !MachineId -> {-# UNPACK #-} !ProcessId -> {-# UNPACK #-} !PortId -> EventInfo
[mesTag] :: EventInfo -> !MessageTag
[senderProcess] :: EventInfo -> {-# UNPACK #-} !ProcessId
[senderThread] :: EventInfo -> {-# UNPACK #-} !ThreadId
[receiverMachine] :: EventInfo -> {-# UNPACK #-} !MachineId
[receiverProcess] :: EventInfo -> {-# UNPACK #-} !ProcessId
[receiverInport] :: EventInfo -> {-# UNPACK #-} !PortId
ReceiveMessage :: !MessageTag -> {-# UNPACK #-} !ProcessId -> {-# UNPACK #-} !PortId -> {-# UNPACK #-} !MachineId -> {-# UNPACK #-} !ProcessId -> {-# UNPACK #-} !ThreadId -> {-# UNPACK #-} !MessageSize -> EventInfo
[mesTag] :: EventInfo -> !MessageTag
[receiverProcess] :: EventInfo -> {-# UNPACK #-} !ProcessId
[receiverInport] :: EventInfo -> {-# UNPACK #-} !PortId
[senderMachine] :: EventInfo -> {-# UNPACK #-} !MachineId
[senderProcess] :: EventInfo -> {-# UNPACK #-} !ProcessId
[senderThread] :: EventInfo -> {-# UNPACK #-} !ThreadId
[messageSize] :: EventInfo -> {-# UNPACK #-} !MessageSize
SendReceiveLocalMessage :: !MessageTag -> {-# UNPACK #-} !ProcessId -> {-# UNPACK #-} !ThreadId -> {-# UNPACK #-} !ProcessId -> {-# UNPACK #-} !PortId -> EventInfo
[mesTag] :: EventInfo -> !MessageTag
[senderProcess] :: EventInfo -> {-# UNPACK #-} !ProcessId
[senderThread] :: EventInfo -> {-# UNPACK #-} !ThreadId
[receiverProcess] :: EventInfo -> {-# UNPACK #-} !ProcessId
[receiverInport] :: EventInfo -> {-# UNPACK #-} !PortId
InternString :: String -> {-# UNPACK #-} !StringId -> EventInfo
[str] :: EventInfo -> String
[sId] :: EventInfo -> {-# UNPACK #-} !StringId
MerStartParConjunction :: {-# UNPACK #-} !ParConjDynId -> {-# UNPACK #-} !ParConjStaticId -> EventInfo
[dyn_id] :: EventInfo -> {-# UNPACK #-} !ParConjDynId
[static_id] :: EventInfo -> {-# UNPACK #-} !ParConjStaticId
MerEndParConjunction :: {-# UNPACK #-} !ParConjDynId -> EventInfo
[dyn_id] :: EventInfo -> {-# UNPACK #-} !ParConjDynId
MerEndParConjunct :: {-# UNPACK #-} !ParConjDynId -> EventInfo
[dyn_id] :: EventInfo -> {-# UNPACK #-} !ParConjDynId
MerCreateSpark :: {-# UNPACK #-} !ParConjDynId -> {-# UNPACK #-} !SparkId -> EventInfo
[dyn_id] :: EventInfo -> {-# UNPACK #-} !ParConjDynId
[spark_id] :: EventInfo -> {-# UNPACK #-} !SparkId
MerFutureCreate :: {-# UNPACK #-} !FutureId -> {-# UNPACK #-} !StringId -> EventInfo
[future_id] :: EventInfo -> {-# UNPACK #-} !FutureId
[name_id] :: EventInfo -> {-# UNPACK #-} !StringId
MerFutureWaitNosuspend :: {-# UNPACK #-} !FutureId -> EventInfo
[future_id] :: EventInfo -> {-# UNPACK #-} !FutureId
MerFutureWaitSuspended :: {-# UNPACK #-} !FutureId -> EventInfo
[future_id] :: EventInfo -> {-# UNPACK #-} !FutureId
MerFutureSignal :: {-# UNPACK #-} !FutureId -> EventInfo
[future_id] :: EventInfo -> {-# UNPACK #-} !FutureId
MerLookingForGlobalThread :: EventInfo
MerWorkStealing :: EventInfo
MerLookingForLocalSpark :: EventInfo
MerReleaseThread :: {-# UNPACK #-} !ThreadId -> EventInfo
[thread_id] :: EventInfo -> {-# UNPACK #-} !ThreadId
MerCapSleeping :: EventInfo
MerCallingMain :: EventInfo
PerfName :: {-# UNPACK #-} !PerfEventTypeNum -> !Text -> EventInfo
[perfNum] :: EventInfo -> {-# UNPACK #-} !PerfEventTypeNum
[name] :: EventInfo -> !Text
PerfCounter :: {-# UNPACK #-} !PerfEventTypeNum -> {-# UNPACK #-} !KernelThreadId -> {-# UNPACK #-} !Word64 -> EventInfo
[perfNum] :: EventInfo -> {-# UNPACK #-} !PerfEventTypeNum
[tid] :: EventInfo -> {-# UNPACK #-} !KernelThreadId
[period] :: EventInfo -> {-# UNPACK #-} !Word64
PerfTracepoint :: {-# UNPACK #-} !PerfEventTypeNum -> {-# UNPACK #-} !KernelThreadId -> EventInfo
[perfNum] :: EventInfo -> {-# UNPACK #-} !PerfEventTypeNum
[tid] :: EventInfo -> {-# UNPACK #-} !KernelThreadId
HeapProfBegin :: !Word8 -> !Word64 -> !HeapProfBreakdown -> !Text -> !Text -> !Text -> !Text -> !Text -> !Text -> !Text -> EventInfo
[heapProfId] :: EventInfo -> !Word8
[heapProfSamplingPeriod] :: EventInfo -> !Word64
[heapProfBreakdown] :: EventInfo -> !HeapProfBreakdown
[heapProfModuleFilter] :: EventInfo -> !Text
[heapProfClosureDescrFilter] :: EventInfo -> !Text
[heapProfTypeDescrFilter] :: EventInfo -> !Text
[heapProfCostCentreFilter] :: EventInfo -> !Text
[heapProfCostCentreStackFilter] :: EventInfo -> !Text
[heapProfRetainerFilter] :: EventInfo -> !Text
[heapProfBiographyFilter] :: EventInfo -> !Text
HeapProfCostCentre :: !Word32 -> !Text -> !Text -> !Text -> !HeapProfFlags -> EventInfo
[heapProfCostCentreId] :: EventInfo -> !Word32
[heapProfLabel] :: EventInfo -> !Text
[heapProfModule] :: EventInfo -> !Text
[heapProfSrcLoc] :: EventInfo -> !Text
[heapProfFlags] :: EventInfo -> !HeapProfFlags
InfoTableProv :: !Word64 -> !Text -> !Int -> !Text -> !Text -> !Text -> !Text -> EventInfo
[itInfo] :: EventInfo -> !Word64
[itTableName] :: EventInfo -> !Text
[itClosureDesc] :: EventInfo -> !Int
[itTyDesc] :: EventInfo -> !Text
[itLabel] :: EventInfo -> !Text
[itModule] :: EventInfo -> !Text
[itSrcLoc] :: EventInfo -> !Text
HeapProfSampleBegin :: !Word64 -> EventInfo
[heapProfSampleEra] :: EventInfo -> !Word64
HeapProfSampleEnd :: !Word64 -> EventInfo
[heapProfSampleEra] :: EventInfo -> !Word64
HeapBioProfSampleBegin :: !Word64 -> !Word64 -> EventInfo
[heapProfSampleEra] :: EventInfo -> !Word64
[heapProfSampleTime] :: EventInfo -> !Word64
HeapProfSampleCostCentre :: !Word8 -> !Word64 -> !Word8 -> !Vector Word32 -> EventInfo
[heapProfId] :: EventInfo -> !Word8
[heapProfResidency] :: EventInfo -> !Word64
[heapProfStackDepth] :: EventInfo -> !Word8
[heapProfStack] :: EventInfo -> !Vector Word32
HeapProfSampleString :: !Word8 -> !Word64 -> !Text -> EventInfo
[heapProfId] :: EventInfo -> !Word8
[heapProfResidency] :: EventInfo -> !Word64
[heapProfLabel] :: EventInfo -> !Text
ProfSampleCostCentre :: !Capset -> !Word64 -> !Word8 -> !Vector Word32 -> EventInfo
[profCapset] :: EventInfo -> !Capset
[profTicks] :: EventInfo -> !Word64
[profStackDepth] :: EventInfo -> !Word8
[profCcsStack] :: EventInfo -> !Vector Word32
ProfBegin :: !Word64 -> EventInfo
[profTickInterval] :: EventInfo -> !Word64
UserBinaryMessage :: !ByteString -> EventInfo
[payload] :: EventInfo -> !ByteString
ConcMarkBegin :: EventInfo
ConcMarkEnd :: !Word32 -> EventInfo
[concMarkedObjectCount] :: EventInfo -> !Word32
ConcSyncBegin :: EventInfo
ConcSyncEnd :: EventInfo
ConcSweepBegin :: EventInfo
ConcSweepEnd :: EventInfo
ConcUpdRemSetFlush :: {-# UNPACK #-} !Int -> EventInfo
[cap] :: EventInfo -> {-# UNPACK #-} !Int
NonmovingHeapCensus :: !Word8 -> !Word32 -> !Word32 -> !Word32 -> EventInfo
[nonmovingCensusBlkSize] :: EventInfo -> !Word8
[nonmovingCensusActiveSegs] :: EventInfo -> !Word32
[nonmovingCensusFilledSegs] :: EventInfo -> !Word32
[nonmovingCensusLiveBlocks] :: EventInfo -> !Word32
TickyCounterDef :: !Word64 -> !Word16 -> !Text -> !Text -> EventInfo
[tickyCtrDefId] :: EventInfo -> !Word64
[tickyCtrDefArity] :: EventInfo -> !Word16
[tickyCtrDefKinds] :: EventInfo -> !Text
[tickyCtrDefName] :: EventInfo -> !Text
TickyCounterSample :: !Word64 -> !Word64 -> !Word64 -> !Word64 -> EventInfo
[tickyCtrSampleId] :: EventInfo -> !Word64
[tickyCtrSampleEntryCount] :: EventInfo -> !Word64
[tickyCtrSampleAllocs] :: EventInfo -> !Word64
[tickyCtrSampleAllocd] :: EventInfo -> !Word64
TickyBeginSample :: EventInfo
data ThreadStopStatus
NoStatus :: ThreadStopStatus
HeapOverflow :: ThreadStopStatus
StackOverflow :: ThreadStopStatus
ThreadYielding :: ThreadStopStatus
ThreadBlocked :: ThreadStopStatus
ThreadFinished :: ThreadStopStatus
ForeignCall :: ThreadStopStatus
BlockedOnMVar :: ThreadStopStatus
BlockedOnMVarRead :: ThreadStopStatus
BlockedOnBlackHole :: ThreadStopStatus
BlockedOnRead :: ThreadStopStatus
BlockedOnWrite :: ThreadStopStatus
BlockedOnDelay :: ThreadStopStatus
BlockedOnSTM :: ThreadStopStatus
BlockedOnDoProc :: ThreadStopStatus
BlockedOnCCall :: ThreadStopStatus
BlockedOnCCall_NoUnblockExc :: ThreadStopStatus
BlockedOnMsgThrowTo :: ThreadStopStatus
ThreadMigrating :: ThreadStopStatus
BlockedOnMsgGlobalise :: ThreadStopStatus
BlockedOnBlackHoleOwnedBy :: {-# UNPACK #-} !ThreadId -> ThreadStopStatus
data CapsetType
CapsetCustom :: CapsetType
CapsetOsProcess :: CapsetType
CapsetClockDomain :: CapsetType
CapsetUnknown :: CapsetType

-- | Sample break-down types in heap profiling
data HeapProfBreakdown
HeapProfBreakdownCostCentre :: HeapProfBreakdown
HeapProfBreakdownModule :: HeapProfBreakdown
HeapProfBreakdownClosureDescr :: HeapProfBreakdown
HeapProfBreakdownTypeDescr :: HeapProfBreakdown
HeapProfBreakdownRetainer :: HeapProfBreakdown
HeapProfBreakdownBiography :: HeapProfBreakdown
HeapProfBreakdownClosureType :: HeapProfBreakdown
HeapProfBreakdownInfoTable :: HeapProfBreakdown
newtype HeapProfFlags
HeapProfFlags :: Word8 -> HeapProfFlags
type Timestamp = Word64
type ThreadId = Word32
type TaskId = Word64
newtype KernelThreadId
KernelThreadId :: Word64 -> KernelThreadId
[kernelThreadId] :: KernelThreadId -> Word64
type EventTypeNum = Word16
type EventTypeDesc = Text
type EventTypeSize = Word16
type BlockSize = Word32
type Capset = Word32
type PID = Word32
type StringId = Word32
type ProcessId = Word32
type MachineId = Word16
type PortId = ThreadId
type MessageSize = Word32
data MessageTag
Ready :: MessageTag
NewPE :: MessageTag
PETIDS :: MessageTag
Finish :: MessageTag
FailPE :: MessageTag
RFork :: MessageTag
Connect :: MessageTag
DataMes :: MessageTag
Head :: MessageTag
Constr :: MessageTag
Part :: MessageTag
Terminate :: MessageTag
Packet :: MessageTag
type ParConjDynId = Word64
type ParConjStaticId = StringId
type SparkId = Word32
type FutureId = Word64
type PerfEventTypeNum = Word32

-- | Read an entire event log file. It returns an error message if it
--   encounters an error while decoding.
--   
--   Note that it doesn't fail if it consumes all input in the middle of
--   decoding of an event.
readEventLogFromFile :: FilePath -> IO (Either String EventLog)

-- | Writes the <a>EventLog</a> to file. The log is expected to <b>NOT</b>
--   have <a>EventBlock</a> markers/events - the parsers no longer emit
--   them and they are handled behind the scenes.
writeEventLogToFile :: FilePath -> EventLog -> IO ()

-- | Serialises an <a>EventLog</a> back to a <tt>ByteString</tt>, usually
--   for writing it back to a file.
serialiseEventLog :: EventLog -> ByteString

-- | An event annotated with the Capability that generated it, if any

-- | <i>Deprecated: CapEvents will be removed soon, now Event has a field
--   evCap</i>
data CapEvent

-- | <i>Deprecated: CapEvents will be removed soon, now Event has a field
--   evCap</i>
CapEvent :: Maybe Int -> Event -> CapEvent
[ce_cap] :: CapEvent -> Maybe Int
[ce_event] :: CapEvent -> Event
sortEvents :: [Event] -> [Event]
buildEventTypeMap :: [EventType] -> IntMap EventType

-- | Read an event log file and pretty print it to stdout
printEventsIncremental :: Bool -> FilePath -> IO ()
showEventInfo :: EventInfo -> String
buildEventInfo :: EventInfo -> Builder
showThreadStopStatus :: ThreadStopStatus -> String
ppEventLog :: EventLog -> String
ppEventType :: EventType -> String

-- | Pretty prints an <a>Event</a>, with clean handling for
--   <a>UnknownEvent</a>
ppEvent :: IntMap EventType -> Event -> String
buildEvent :: IntMap EventType -> Event -> Builder
buildEvent' :: Event -> Builder
nEVENT_PERF_NAME :: EventTypeNum
nEVENT_PERF_COUNTER :: EventTypeNum
nEVENT_PERF_TRACEPOINT :: EventTypeNum
sz_perf_num :: EventTypeSize
sz_kernel_tid :: EventTypeSize

-- | <i>Deprecated: The field is now called evSpec</i>
spec :: Event -> EventInfo

-- | <i>Deprecated: The field is now called evTime</i>
time :: Event -> Timestamp

module GHC.RTS.Events.Analysis

-- | This is based on a simple finite state machine hence the names
--   <a>delta</a> for the state transition function. Since states might be
--   more than simple pattern matched constructors, we use `finals :: state
--   -&gt; Bool`, rather than `Set state`, to indicate that the machine is
--   in some final state. Similarly for <a>alpha</a>, which indicates the
--   alphabet of inputs to a machine. The function <a>delta</a> returns
--   <a>Maybe</a> values, where <a>Nothing</a> indicates that no valid
--   transition is possible: ie, there has been an error.
data Machine s i
Machine :: s -> (s -> Bool) -> (i -> Bool) -> (s -> i -> Maybe s) -> Machine s i

-- | Initial state
[initial] :: Machine s i -> s

-- | Valid final states
[final] :: Machine s i -> s -> Bool

-- | Valid input alphabet
[alpha] :: Machine s i -> i -> Bool

-- | State transition function
[delta] :: Machine s i -> s -> i -> Maybe s

-- | The <a>validate</a> function takes a machine and a list of inputs. The
--   machine is started from its initial state and run against the inputs
--   in turn. It returns the state and input on failure, and just the state
--   on success.
validate :: Machine s i -> [i] -> Either (s, i) s

-- | This function is similar to <a>validate</a>, but outputs each
--   intermediary state as well. For an incremental version, use
--   <a>simulate</a>.
validates :: Machine s i -> [i] -> [Either (s, i) s]

-- | This function produces a process that outputs all the states that a
--   machine goes through.
simulate :: Machine s i -> [i] -> Process (s, i) (s, i)

-- | A state augmented by Timestamp information is held in
--   <a>profileState</a>. When the state changes, <tt>profileMap</tt>
--   stores a map between each state and its cumulative time.
data Profile s
Profile :: s -> Timestamp -> Profile s

-- | The current state
[profileState] :: Profile s -> s

-- | The entry time of the state
[profileTime] :: Profile s -> Timestamp
profile :: (Ord s, Eq s) => Machine s i -> (i -> Timestamp) -> [i] -> Process (Profile s, i) (s, Timestamp, Timestamp)
profileIndexed :: (Ord k, Ord s, Eq s) => Machine s i -> (i -> Maybe k) -> (i -> Timestamp) -> [i] -> Process (Map k (Profile s), i) (k, (s, Timestamp, Timestamp))
profileRouted :: (Ord k, Ord s, Eq s, Eq r) => Machine s i -> Machine r i -> (r -> i -> Maybe k) -> (i -> Timestamp) -> [i] -> Process ((Map k (Profile s), r), i) (k, (s, Timestamp, Timestamp))
extractIndexed :: Ord k => (s -> i -> Maybe o) -> (i -> Maybe k) -> Map k s -> i -> Maybe (k, o)

-- | Machines sometimes need to operate on coarser input than they are
--   defined for. This function takes a function that refines input and a
--   machine that works on refined input, and produces a machine that can
--   work on coarse input.
refineM :: (i -> j) -> Machine s j -> Machine s i

-- | This function takes a machine and profiles its state.
profileM :: Ord s => (i -> Timestamp) -> Machine s i -> Machine (Profile s) i

-- | An indexed machine takes a function that multiplexes the input to a
--   key and then takes a machine description to an indexed machine.
indexM :: Ord k => (i -> Maybe k) -> Machine s i -> Machine (Map k s) i
toList :: Process e a -> [a]
toMaybe :: Process e a -> Maybe e
data Process e a
Done :: Process e a
Fail :: e -> Process e a
Prod :: a -> Process e a -> Process e a

-- | A machine can be indexed not only by the inputs, but also by the state
--   of an intermediary routing machine. This is a generalisation of
--   indexM.
routeM :: Ord k => Machine r i -> (r -> i -> Maybe k) -> Machine s i -> Machine (Map k s, r) i
instance (GHC.Show.Show e, GHC.Show.Show a) => GHC.Show.Show (GHC.RTS.Events.Analysis.Process e a)
instance GHC.Show.Show s => GHC.Show.Show (GHC.RTS.Events.Analysis.Profile s)

module GHC.RTS.Events.Analysis.Thread

-- | This datatype defines the state machine for a single thread.
data ThreadState
ThreadInitial :: ThreadState
ThreadQueued :: ThreadState
ThreadRunning :: ThreadState
ThreadStopped :: ThreadState
ThreadFinal :: ThreadState

-- | This state machine tracks the events processed by a thread.
threadMachine :: Machine ThreadState EventInfo
instance GHC.Classes.Ord GHC.RTS.Events.Analysis.Thread.ThreadState
instance GHC.Classes.Eq GHC.RTS.Events.Analysis.Thread.ThreadState
instance GHC.Show.Show GHC.RTS.Events.Analysis.Thread.ThreadState

module GHC.RTS.Events.Analysis.SparkThread
data SparkThreadState
SparkThreadInitial :: SparkThreadState
SparkThreadCreated :: SparkThreadState
SparkThreadRunning :: Int -> SparkThreadState
SparkThreadPaused :: Int -> SparkThreadState
SparkThreadFinal :: SparkThreadState
sparkThreadMachine :: Machine SparkThreadState EventInfo
capabilitySparkThreadMachine :: Machine (Map Int ThreadId, Set ThreadId) Event
capabilitySparkThreadIndexer :: (Map Int ThreadId, Set ThreadId) -> Event -> Maybe ThreadId
instance GHC.Show.Show GHC.RTS.Events.Analysis.SparkThread.SparkThreadState
instance GHC.Classes.Ord GHC.RTS.Events.Analysis.SparkThread.SparkThreadState
instance GHC.Classes.Eq GHC.RTS.Events.Analysis.SparkThread.SparkThreadState

module GHC.RTS.Events.Analysis.Capability

-- | This state machine tracks threads residing on capabilities. Each
--   thread can only reside on one capability, but can be migrated between
--   them.
capabilityThreadPoolMachine :: Machine (Map ThreadId Int) Event

-- | This state machine tracks threads running on capabilities, only one
--   thread may run on a capability at a time.
capabilityThreadRunMachine :: Machine (Map Int ThreadId) Event
capabilityThreadIndexer :: Map Int ThreadId -> Event -> Maybe ThreadId

-- | This state machine tracks Haskell tasks, represented by TaskId,
--   residing on capabilities. Each Haskell task can only reside on one
--   capability, but can be migrated between them.
capabilityTaskPoolMachine :: Machine (Map TaskId Int) Event

-- | This state machine tracks Haskell tasks (represented by the
--   KernelThreadId of their OS thread) residing on capabilities and
--   additionally tracks the (immutable) assignment of OS thread ids
--   (KernelThreadId) to tasks ids (TaskId). Each Haskell task can only
--   reside on one capability, but can be migrated between them.
--   
--   Invariant for the <tt>(Map KernelThreadId Int, Map TaskId
--   KernelThreadId)</tt> type: the second map is an injection (verified by
--   the machine in <tt>insertTaskOS</tt>) and the following sets are
--   equal: keys of the fist map and values of the second (follows from the
--   construction of the maps by the machine).
--   
--   The machine verifies as much as <a>capabilityTaskPoolMachine</a> and
--   additionally the data invariant, and offers a richer verification
--   profile.
capabilityTaskOSMachine :: Machine (Map KernelThreadId Int, Map TaskId KernelThreadId) Event

module GHC.RTS.Events.Merge
mergeEventLogs :: EventLog -> EventLog -> EventLog
instance GHC.Base.Semigroup GHC.RTS.Events.Merge.MaxVars
instance GHC.Base.Monoid GHC.RTS.Events.Merge.MaxVars
