ghc-events-0.20.0.0: Library and tool for parsing .eventlog files from GHC

Safe Haskell | None
Language | Haskell2010

GHC.RTS.Events

Contents

- The event log types
- Reading and writing event logs
- Utilities
- Printing
- Perf events
- For compatibility with old clients

Synopsis

- data EventLog = EventLog {
  - header :: Header
  - dat :: Data
  }
- newtype Header = Header {
  - eventTypes :: [EventType]
  }
- data Data = Data {
  - events :: [Event]
  }
- data EventType = EventType {
  - num :: EventTypeNum
  - desc :: EventTypeDesc
  - size :: Maybe EventTypeSize
  }
- data Event = Event {
  - evTime :: !Timestamp
  - evSpec :: EventInfo
  - evCap :: Maybe Int
  }
- data EventInfo
  - = EventBlock {
    - end_time :: Timestamp
    - cap :: Int
    - block_size :: BlockSize
    }
  - | UnknownEvent {
    - ref :: !EventTypeNum
    }
  - | Startup {
    - n_caps :: Int
    }
  - | Shutdown
  - | CreateThread {
    - thread :: !ThreadId
    }
  - | RunThread {
    - thread :: !ThreadId
    }
  - | StopThread {
    - thread :: !ThreadId
    - status :: !ThreadStopStatus
    }
  - | ThreadRunnable {
    - thread :: !ThreadId
    }
  - | MigrateThread {
    - thread :: !ThreadId
    - newCap :: !Int
    }
  - | WakeupThread {
    - thread :: !ThreadId
    - otherCap :: !Int
    }
  - | ThreadLabel {
    - thread :: !ThreadId
    - threadlabel :: !Text
    }
  - | CreateSparkThread {
    - sparkThread :: !ThreadId
    }
  - | SparkCounters {
    - sparksCreated :: !Word64
    - sparksDud :: !Word64
    - sparksOverflowed :: !Word64
    - sparksConverted :: !Word64
    - sparksFizzled :: !Word64
    - sparksGCd :: !Word64
    - sparksRemaining :: !Word64
    }
  - | SparkCreate
  - | SparkDud
  - | SparkOverflow
  - | SparkRun
  - | SparkSteal {
    - victimCap :: !Int
    }
  - | SparkFizzle
  - | SparkGC
  - | TaskCreate {
    - taskId :: TaskId
    - cap :: !Int
    - tid :: !KernelThreadId
    }
  - | TaskMigrate {
    - taskId :: TaskId
    - cap :: !Int
    - new_cap :: !Int
    }
  - | TaskDelete {
    - taskId :: TaskId
    }
  - | RequestSeqGC
  - | RequestParGC
  - | StartGC
  - | GCWork
  - | GCIdle
  - | GCDone
  - | EndGC
  - | GlobalSyncGC
  - | GCStatsGHC {
    - heapCapset :: !Capset
    - gen :: !Int
    - copied :: !Word64
    - slop :: !Word64
    - frag :: !Word64
    - parNThreads :: !Int
    - parMaxCopied :: !Word64
    - parTotCopied :: !Word64
    - parBalancedCopied :: !(Maybe Word64)
    }
  - | MemReturn {
    - heapCapset :: !Capset
    - current :: !Word32
    - needed :: !Word32
    - returned :: !Word32
    }
  - | HeapAllocated {
    - heapCapset :: !Capset
    - allocBytes :: !Word64
    }
  - | HeapSize {
    - heapCapset :: !Capset
    - sizeBytes :: !Word64
    }
  - | BlocksSize {
    - heapCapset :: !Capset
    - blocksSize :: !Word64
    }
  - | HeapLive {
    - heapCapset :: !Capset
    - liveBytes :: !Word64
    }
  - | HeapInfoGHC {
    - heapCapset :: !Capset
    - gens :: !Int
    - maxHeapSize :: !Word64
    - allocAreaSize :: !Word64
    - mblockSize :: !Word64
    - blockSize :: !Word64
    }
  - | CapCreate {
    - cap :: !Int
    }
  - | CapDelete {
    - cap :: !Int
    }
  - | CapDisable {
    - cap :: !Int
    }
  - | CapEnable {
    - cap :: !Int
    }
  - | CapsetCreate {
    - capset :: !Capset
    - capsetType :: CapsetType
    }
  - | CapsetDelete {
    - capset :: !Capset
    }
  - | CapsetAssignCap {
    - capset :: !Capset
    - cap :: !Int
    }
  - | CapsetRemoveCap {
    - capset :: !Capset
    - cap :: !Int
    }
  - | RtsIdentifier {
    - capset :: !Capset
    - rtsident :: !Text
    }
  - | ProgramArgs {
    - capset :: !Capset
    - args :: [Text]
    }
  - | ProgramEnv {
    - capset :: !Capset
    - env :: [Text]
    }
  - | OsProcessPid {
    - capset :: !Capset
    - pid :: !PID
    }
  - | OsProcessParentPid {
    - capset :: !Capset
    - ppid :: !PID
    }
  - | WallClockTime {
    - capset :: !Capset
    - sec :: !Word64
    - nsec :: !Word32
    }
  - | Message {
    - msg :: !Text
    }
  - | UserMessage {
    - msg :: !Text
    }
  - | UserMarker {
    - markername :: !Text
    }
  - | Version {
    - version :: String
    }
  - | ProgramInvocation {
    - commandline :: String
    }
  - | CreateMachine {
    - machine :: !MachineId
    - realtime :: !Timestamp
    }
  - | KillMachine {
    - machine :: !MachineId
    }
  - | CreateProcess {
    - process :: !ProcessId
    }
  - | KillProcess {
    - process :: !ProcessId
    }
  - | AssignThreadToProcess {
    - thread :: !ThreadId
    - process :: !ProcessId
    }
  - | EdenStartReceive
  - | EdenEndReceive
  - | SendMessage {
    - mesTag :: !MessageTag
    - senderProcess :: !ProcessId
    - senderThread :: !ThreadId
    - receiverMachine :: !MachineId
    - receiverProcess :: !ProcessId
    - receiverInport :: !PortId
    }
  - | ReceiveMessage {
    - mesTag :: !MessageTag
    - receiverProcess :: !ProcessId
    - receiverInport :: !PortId
    - senderMachine :: !MachineId
    - senderProcess :: !ProcessId
    - senderThread :: !ThreadId
    - messageSize :: !MessageSize
    }
  - | SendReceiveLocalMessage {
    - mesTag :: !MessageTag
    - senderProcess :: !ProcessId
    - senderThread :: !ThreadId
    - receiverProcess :: !ProcessId
    - receiverInport :: !PortId
    }
  - | InternString {
    - str :: String
    - sId :: !StringId
    }
  - | MerStartParConjunction {
    - dyn_id :: !ParConjDynId
    - static_id :: !ParConjStaticId
    }
  - | MerEndParConjunction {
    - dyn_id :: !ParConjDynId
    }
  - | MerEndParConjunct {
    - dyn_id :: !ParConjDynId
    }
  - | MerCreateSpark {
    - dyn_id :: !ParConjDynId
    - spark_id :: !SparkId
    }
  - | MerFutureCreate {
    - future_id :: !FutureId
    - name_id :: !StringId
    }
  - | MerFutureWaitNosuspend {
    - future_id :: !FutureId
    }
  - | MerFutureWaitSuspended {
    - future_id :: !FutureId
    }
  - | MerFutureSignal {
    - future_id :: !FutureId
    }
  - | MerLookingForGlobalThread
  - | MerWorkStealing
  - | MerLookingForLocalSpark
  - | MerReleaseThread {
    - thread_id :: !ThreadId
    }
  - | MerCapSleeping
  - | MerCallingMain
  - | PerfName {
    - perfNum :: !PerfEventTypeNum
    - name :: !Text
    }
  - | PerfCounter {
    - perfNum :: !PerfEventTypeNum
    - tid :: !KernelThreadId
    - period :: !Word64
    }
  - | PerfTracepoint {
    - perfNum :: !PerfEventTypeNum
    - tid :: !KernelThreadId
    }
  - | HeapProfBegin {
    - heapProfId :: !Word8
    - heapProfSamplingPeriod :: !Word64
    - heapProfBreakdown :: !HeapProfBreakdown
    - heapProfModuleFilter :: !Text
    - heapProfClosureDescrFilter :: !Text
    - heapProfTypeDescrFilter :: !Text
    - heapProfCostCentreFilter :: !Text
    - heapProfCostCentreStackFilter :: !Text
    - heapProfRetainerFilter :: !Text
    - heapProfBiographyFilter :: !Text
    }
  - | HeapProfCostCentre {
    - heapProfCostCentreId :: !Word32
    - heapProfLabel :: !Text
    - heapProfModule :: !Text
    - heapProfSrcLoc :: !Text
    - heapProfFlags :: !HeapProfFlags
    }
  - | InfoTableProv {
    - itInfo :: !Word64
    - itTableName :: !Text
    - itClosureDesc :: !Int
    - itTyDesc :: !Text
    - itLabel :: !Text
    - itModule :: !Text
    - itSrcLoc :: !Text
    }
  - | HeapProfSampleBegin {
    - heapProfSampleEra :: !Word64
    }
  - | HeapProfSampleEnd {
    - heapProfSampleEra :: !Word64
    }
  - | HeapBioProfSampleBegin {
    - heapProfSampleEra :: !Word64
    - heapProfSampleTime :: !Word64
    }
  - | HeapProfSampleCostCentre {
    - heapProfId :: !Word8
    - heapProfResidency :: !Word64
    - heapProfStackDepth :: !Word8
    - heapProfStack :: !(Vector Word32)
    }
  - | HeapProfSampleString {
    - heapProfId :: !Word8
    - heapProfResidency :: !Word64
    - heapProfLabel :: !Text
    }
  - | ProfSampleCostCentre {
    - profCap :: !CapNo
    - profTicks :: !Word64
    - profStackDepth :: !Word8
    - profCcsStack :: !(Vector Word32)
    }
  - | ProfBegin {
    - profTickInterval :: !Word64
    }
  - | UserBinaryMessage {
    - payload :: !ByteString
    }
  - | ConcMarkBegin
  - | ConcMarkEnd {
    - concMarkedObjectCount :: !Word32
    }
  - | ConcSyncBegin
  - | ConcSyncEnd
  - | ConcSweepBegin
  - | ConcSweepEnd
  - | ConcUpdRemSetFlush {
    - cap :: !Int
    }
  - | NonmovingHeapCensus {
    - nonmovingCensusBlkSize :: !Word16
    - nonmovingCensusActiveSegs :: !Word32
    - nonmovingCensusFilledSegs :: !Word32
    - nonmovingCensusLiveBlocks :: !Word32
    }
  - | NonmovingPrunedSegments {
    - nonmovingPrunedSegments :: !Word32
    - nonmovingFreeSegments :: !Word32
    }
  - | TickyCounterDef {
    - tickyCtrDefId :: !Word64
    - tickyCtrDefArity :: !Word16
    - tickyCtrDefKinds :: !Text
    - tickyCtrDefName :: !Text
    - tickyCtrInfoTbl :: !Word64
    - tickyCtrJsonDesc :: Maybe Text
    }
  - | TickyCounterSample {
    - tickyCtrSampleId :: !Word64
    - tickyCtrSampleEntryCount :: !Word64
    - tickyCtrSampleAllocs :: !Word64
    - tickyCtrSampleAllocd :: !Word64
    }
  - | TickyBeginSample
- data ThreadStopStatus
  - = NoStatus
  - | HeapOverflow
  - | StackOverflow
  - | ThreadYielding
  - | ThreadBlocked
  - | ThreadFinished
  - | ForeignCall
  - | BlockedOnMVar
  - | BlockedOnMVarRead
  - | BlockedOnBlackHole
  - | BlockedOnRead
  - | BlockedOnWrite
  - | BlockedOnDelay
  - | BlockedOnSTM
  - | BlockedOnDoProc
  - | BlockedOnCCall
  - | BlockedOnCCall_NoUnblockExc
  - | BlockedOnMsgThrowTo
  - | ThreadMigrating
  - | BlockedOnMsgGlobalise
  - | BlockedOnBlackHoleOwnedBy !ThreadId
- data CapsetType
  - = CapsetCustom
  - | CapsetOsProcess
  - | CapsetClockDomain
  - | CapsetUnknown
- data HeapProfBreakdown
  - = HeapProfBreakdownCostCentre
  - | HeapProfBreakdownModule
  - | HeapProfBreakdownClosureDescr
  - | HeapProfBreakdownTypeDescr
  - | HeapProfBreakdownRetainer
  - | HeapProfBreakdownBiography
  - | HeapProfBreakdownClosureType
  - | HeapProfBreakdownInfoTable
  - | HeapProfBreakdownEra
- newtype HeapProfFlags = HeapProfFlags Word8
- type Timestamp = Word64
- type ThreadId = Word32
- type TaskId = Word64
- newtype 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
  - | NewPE
  - | PETIDS
  - | Finish
  - | FailPE
  - | RFork
  - | Connect
  - | DataMes
  - | Head
  - | Constr
  - | Part
  - | Terminate
  - | Packet
- type ParConjDynId = Word64
- type ParConjStaticId = StringId
- type SparkId = Word32
- type FutureId = Word64
- type PerfEventTypeNum = Word32
- readEventLogFromFile :: FilePath -> IO (Either String EventLog)
- writeEventLogToFile :: FilePath -> EventLog -> IO ()
- serialiseEventLog :: EventLog -> ByteString
- data CapEvent = CapEvent {
  - ce_cap :: Maybe Int
  - ce_event :: Event
  }
- sortEvents :: [Event] -> [Event]
- buildEventTypeMap :: [EventType] -> IntMap EventType
- data TimeFormat
  - = RawTime
  - | PrettyTime
- printEventsIncremental :: Bool -> FilePath -> IO ()
- showEventInfo :: EventInfo -> String
- buildEventInfo :: EventInfo -> Builder
- showThreadStopStatus :: ThreadStopStatus -> String
- ppEventLog :: TimeFormat -> EventLog -> String
- ppEventType :: EventType -> String
- ppEvent :: TimeFormat -> IntMap EventType -> Event -> String
- buildEvent :: TimeFormat -> 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
- spec :: Event -> EventInfo
- time :: Event -> Timestamp

# The event log types

data EventLog Source #

Constructors

EventLog |

Fields

- header :: Header
- dat :: Data

#### Instances

Instances details

Show EventLog Source # |
Instance details Defined in GHC.RTS.EventTypes Methods showsPrec :: Int -> EventLog -> ShowS Source # show :: EventLog -> String Source # showList :: [EventLog] -> ShowS Source #

newtype Header Source #

Constructors

Header |

Fields

- eventTypes :: [EventType]

#### Instances

Instances details

Show Header Source # |
Instance details Defined in GHC.RTS.EventTypes Methods showsPrec :: Int -> Header -> ShowS Source # show :: Header -> String Source # showList :: [Header] -> ShowS Source #
Eq Header Source # |
Instance details Defined in GHC.RTS.EventTypes Methods (==) :: Header -> Header -> Bool Source # (/=) :: Header -> Header -> Bool Source #

data Data Source #

Constructors

Data |

Fields

- events :: [Event]

#### Instances

Instances details

Show Data Source # |
Instance details Defined in GHC.RTS.EventTypes Methods showsPrec :: Int -> Data -> ShowS Source # show :: Data -> String Source # showList :: [Data] -> ShowS Source #

data EventType Source #

Constructors

EventType |

Fields

- num :: EventTypeNum
- desc :: EventTypeDesc
- size :: Maybe EventTypeSize

  `Nothing` indicates variable size

#### Instances

Instances details

Show EventType Source # |
Instance details Defined in GHC.RTS.EventTypes Methods showsPrec :: Int -> EventType -> ShowS Source # show :: EventType -> String Source # showList :: [EventType] -> ShowS Source #
Eq EventType Source # |
Instance details Defined in GHC.RTS.EventTypes Methods (==) :: EventType -> EventType -> Bool Source # (/=) :: EventType -> EventType -> Bool Source #

data Event Source #

Constructors

Event |

Fields

- evTime :: !Timestamp
- evSpec :: EventInfo
- evCap :: Maybe Int

#### Instances

Instances details

Show Event Source # |
Instance details Defined in GHC.RTS.EventTypes Methods showsPrec :: Int -> Event -> ShowS Source # show :: Event -> String Source # showList :: [Event] -> ShowS Source #

data EventInfo Source #

Constructors

EventBlock |

Fields

- end_time :: Timestamp
- cap :: Int
- block_size :: BlockSize

UnknownEvent |

Fields

- ref :: !EventTypeNum

Startup |

Fields

- n_caps :: Int

Shutdown |
CreateThread |

Fields

- thread :: !ThreadId

RunThread |

Fields

- thread :: !ThreadId

StopThread |

Fields

- thread :: !ThreadId
- status :: !ThreadStopStatus

ThreadRunnable |

Fields

- thread :: !ThreadId

MigrateThread |

Fields

- thread :: !ThreadId
- newCap :: !Int

WakeupThread |

Fields

- thread :: !ThreadId
- otherCap :: !Int

ThreadLabel |

Fields

- thread :: !ThreadId
- threadlabel :: !Text

CreateSparkThread |

Fields

- sparkThread :: !ThreadId

SparkCounters |

Fields

- sparksCreated :: !Word64
- sparksDud :: !Word64
- sparksOverflowed :: !Word64
- sparksConverted :: !Word64
- sparksFizzled :: !Word64
- sparksGCd :: !Word64
- sparksRemaining :: !Word64

SparkCreate |
SparkDud |
SparkOverflow |
SparkRun |
SparkSteal |

Fields

- victimCap :: !Int

SparkFizzle |
SparkGC |
TaskCreate |

Fields

- taskId :: TaskId
- cap :: !Int
- tid :: !KernelThreadId

TaskMigrate |

Fields

- taskId :: TaskId
- cap :: !Int
- new_cap :: !Int

TaskDelete |

Fields

- taskId :: TaskId

RequestSeqGC |
RequestParGC |
StartGC |
GCWork |
GCIdle |
GCDone |
EndGC |
GlobalSyncGC |
GCStatsGHC |

Fields

- heapCapset :: !Capset
- gen :: !Int
- copied :: !Word64
- slop :: !Word64
- frag :: !Word64
- parNThreads :: !Int
- parMaxCopied :: !Word64
- parTotCopied :: !Word64
- parBalancedCopied :: !(Maybe Word64)

MemReturn |

Fields

- heapCapset :: !Capset
- current :: !Word32
- needed :: !Word32
- returned :: !Word32

HeapAllocated |

Fields

- heapCapset :: !Capset
- allocBytes :: !Word64

HeapSize |

Fields

- heapCapset :: !Capset
- sizeBytes :: !Word64

BlocksSize |

Fields

- heapCapset :: !Capset
- blocksSize :: !Word64

HeapLive |

Fields

- heapCapset :: !Capset
- liveBytes :: !Word64

HeapInfoGHC |

Fields

- heapCapset :: !Capset
- gens :: !Int
- maxHeapSize :: !Word64
- allocAreaSize :: !Word64
- mblockSize :: !Word64
- blockSize :: !Word64

CapCreate |

Fields

- cap :: !Int

CapDelete |

Fields

- cap :: !Int

CapDisable |

Fields

- cap :: !Int

CapEnable |

Fields

- cap :: !Int

CapsetCreate |

Fields

- capset :: !Capset
- capsetType :: CapsetType

CapsetDelete |

Fields

- capset :: !Capset

CapsetAssignCap |

Fields

- capset :: !Capset
- cap :: !Int

CapsetRemoveCap |

Fields

- capset :: !Capset
- cap :: !Int

RtsIdentifier |

Fields

- capset :: !Capset
- rtsident :: !Text

ProgramArgs |

Fields

- capset :: !Capset
- args :: [Text]

ProgramEnv |

Fields

- capset :: !Capset
- env :: [Text]

OsProcessPid |

Fields

- capset :: !Capset
- pid :: !PID

OsProcessParentPid |

Fields

- capset :: !Capset
- ppid :: !PID

WallClockTime |

Fields

- capset :: !Capset
- sec :: !Word64
- nsec :: !Word32

Message |

Fields

- msg :: !Text

UserMessage |

Fields

- msg :: !Text

UserMarker |

Fields

- markername :: !Text

Version |

Fields

- version :: String

ProgramInvocation |

Fields

- commandline :: String

CreateMachine |

Fields

- machine :: !MachineId
- realtime :: !Timestamp

KillMachine |

Fields

- machine :: !MachineId

CreateProcess |

Fields

- process :: !ProcessId

KillProcess |

Fields

- process :: !ProcessId

AssignThreadToProcess |

Fields

- thread :: !ThreadId
- process :: !ProcessId

EdenStartReceive |
EdenEndReceive |
SendMessage |

Fields

- mesTag :: !MessageTag
- senderProcess :: !ProcessId
- senderThread :: !ThreadId
- receiverMachine :: !MachineId
- receiverProcess :: !ProcessId
- receiverInport :: !PortId

ReceiveMessage |

Fields

- mesTag :: !MessageTag
- receiverProcess :: !ProcessId
- receiverInport :: !PortId
- senderMachine :: !MachineId
- senderProcess :: !ProcessId
- senderThread :: !ThreadId
- messageSize :: !MessageSize

SendReceiveLocalMessage |

Fields

- mesTag :: !MessageTag
- senderProcess :: !ProcessId
- senderThread :: !ThreadId
- receiverProcess :: !ProcessId
- receiverInport :: !PortId

InternString |

Fields

- str :: String
- sId :: !StringId

MerStartParConjunction |

Fields

- dyn_id :: !ParConjDynId
- static_id :: !ParConjStaticId

MerEndParConjunction |

Fields

- dyn_id :: !ParConjDynId

MerEndParConjunct |

Fields

- dyn_id :: !ParConjDynId

MerCreateSpark |

Fields

- dyn_id :: !ParConjDynId
- spark_id :: !SparkId

MerFutureCreate |

Fields

- future_id :: !FutureId
- name_id :: !StringId

MerFutureWaitNosuspend |

Fields

- future_id :: !FutureId

MerFutureWaitSuspended |

Fields

- future_id :: !FutureId

MerFutureSignal |

Fields

- future_id :: !FutureId

MerLookingForGlobalThread |
MerWorkStealing |
MerLookingForLocalSpark |
MerReleaseThread |

Fields

- thread_id :: !ThreadId

MerCapSleeping |
MerCallingMain |
PerfName |

Fields

- perfNum :: !PerfEventTypeNum
- name :: !Text

PerfCounter |

Fields

- perfNum :: !PerfEventTypeNum
- tid :: !KernelThreadId
- period :: !Word64

PerfTracepoint |

Fields

- perfNum :: !PerfEventTypeNum
- tid :: !KernelThreadId

HeapProfBegin |

Fields

- heapProfId :: !Word8
- heapProfSamplingPeriod :: !Word64
- heapProfBreakdown :: !HeapProfBreakdown
- heapProfModuleFilter :: !Text
- heapProfClosureDescrFilter :: !Text
- heapProfTypeDescrFilter :: !Text
- heapProfCostCentreFilter :: !Text
- heapProfCostCentreStackFilter :: !Text
- heapProfRetainerFilter :: !Text
- heapProfBiographyFilter :: !Text

HeapProfCostCentre |

Fields

- heapProfCostCentreId :: !Word32
- heapProfLabel :: !Text
- heapProfModule :: !Text
- heapProfSrcLoc :: !Text
- heapProfFlags :: !HeapProfFlags

InfoTableProv |

Fields

- itInfo :: !Word64
- itTableName :: !Text
- itClosureDesc :: !Int
- itTyDesc :: !Text
- itLabel :: !Text
- itModule :: !Text
- itSrcLoc :: !Text

HeapProfSampleBegin |

Fields

- heapProfSampleEra :: !Word64

HeapProfSampleEnd |

Fields

- heapProfSampleEra :: !Word64

HeapBioProfSampleBegin |

Fields

- heapProfSampleEra :: !Word64
- heapProfSampleTime :: !Word64

HeapProfSampleCostCentre |

Fields

- heapProfId :: !Word8
- heapProfResidency :: !Word64
- heapProfStackDepth :: !Word8
- heapProfStack :: !(Vector Word32)

HeapProfSampleString |

Fields

- heapProfId :: !Word8
- heapProfResidency :: !Word64
- heapProfLabel :: !Text

ProfSampleCostCentre |

Fields

- profCap :: !CapNo
- profTicks :: !Word64
- profStackDepth :: !Word8
- profCcsStack :: !(Vector Word32)

ProfBegin |

Fields

- profTickInterval :: !Word64

UserBinaryMessage |

Fields

- payload :: !ByteString

ConcMarkBegin |
ConcMarkEnd |

Fields

- concMarkedObjectCount :: !Word32

ConcSyncBegin |
ConcSyncEnd |
ConcSweepBegin |
ConcSweepEnd |
ConcUpdRemSetFlush |

Fields

- cap :: !Int

NonmovingHeapCensus |

Fields

- nonmovingCensusBlkSize :: !Word16
- nonmovingCensusActiveSegs :: !Word32
- nonmovingCensusFilledSegs :: !Word32
- nonmovingCensusLiveBlocks :: !Word32

NonmovingPrunedSegments |

Fields

- nonmovingPrunedSegments :: !Word32

  The number of pruned segments.

- nonmovingFreeSegments :: !Word32

  The number of leftover free segments. These could not be pruned as they belong to megablocks with at least one non-free segment.

TickyCounterDef |

Fields

- tickyCtrDefId :: !Word64
- tickyCtrDefArity :: !Word16
- tickyCtrDefKinds :: !Text
- tickyCtrDefName :: !Text
- tickyCtrInfoTbl :: !Word64
- tickyCtrJsonDesc :: Maybe Text

TickyCounterSample |

Fields

- tickyCtrSampleId :: !Word64
- tickyCtrSampleEntryCount :: !Word64
- tickyCtrSampleAllocs :: !Word64
- tickyCtrSampleAllocd :: !Word64

TickyBeginSample |

#### Instances

Instances details

Show EventInfo Source # |
Instance details Defined in GHC.RTS.EventTypes Methods showsPrec :: Int -> EventInfo -> ShowS Source # show :: EventInfo -> String Source # showList :: [EventInfo] -> ShowS Source #

data ThreadStopStatus Source #

Constructors

NoStatus |
HeapOverflow |
StackOverflow |
ThreadYielding |
ThreadBlocked |
ThreadFinished |
ForeignCall |
BlockedOnMVar |
BlockedOnMVarRead |
BlockedOnBlackHole |
BlockedOnRead |
BlockedOnWrite |
BlockedOnDelay |
BlockedOnSTM |
BlockedOnDoProc |
BlockedOnCCall |
BlockedOnCCall_NoUnblockExc |
BlockedOnMsgThrowTo |
ThreadMigrating |
BlockedOnMsgGlobalise |
BlockedOnBlackHoleOwnedBy !ThreadId |

#### Instances

Instances details

Show ThreadStopStatus Source # |
Instance details Defined in GHC.RTS.EventTypes Methods showsPrec :: Int -> ThreadStopStatus -> ShowS Source # show :: ThreadStopStatus -> String Source # showList :: [ThreadStopStatus] -> ShowS Source #

data CapsetType Source #

Constructors

CapsetCustom |
CapsetOsProcess |
CapsetClockDomain |
CapsetUnknown |

#### Instances

Instances details

Show CapsetType Source # |
Instance details Defined in GHC.RTS.EventTypes Methods showsPrec :: Int -> CapsetType -> ShowS Source # show :: CapsetType -> String Source # showList :: [CapsetType] -> ShowS Source #

data HeapProfBreakdown Source #

Sample break-down types in heap profiling

Constructors

HeapProfBreakdownCostCentre |
HeapProfBreakdownModule |
HeapProfBreakdownClosureDescr |
HeapProfBreakdownTypeDescr |
HeapProfBreakdownRetainer |
HeapProfBreakdownBiography |
HeapProfBreakdownClosureType |
HeapProfBreakdownInfoTable |
HeapProfBreakdownEra |

#### Instances

Instances details

Binary HeapProfBreakdown Source # |
Instance details Defined in GHC.RTS.EventTypes Methods put :: HeapProfBreakdown -> Put Source # get :: Get HeapProfBreakdown Source # putList :: [HeapProfBreakdown] -> Put Source #
Show HeapProfBreakdown Source # |
Instance details Defined in GHC.RTS.EventTypes Methods showsPrec :: Int -> HeapProfBreakdown -> ShowS Source # show :: HeapProfBreakdown -> String Source # showList :: [HeapProfBreakdown] -> ShowS Source #

newtype HeapProfFlags Source #

Constructors

HeapProfFlags Word8 |

#### Instances

Instances details

Binary HeapProfFlags Source # |
Instance details Defined in GHC.RTS.EventTypes Methods put :: HeapProfFlags -> Put Source # get :: Get HeapProfFlags Source # putList :: [HeapProfFlags] -> Put Source #
Show HeapProfFlags Source # |
Instance details Defined in GHC.RTS.EventTypes Methods showsPrec :: Int -> HeapProfFlags -> ShowS Source # show :: HeapProfFlags -> String Source # showList :: [HeapProfFlags] -> ShowS Source #

type Timestamp = Word64 Source #

type ThreadId = Word32 Source #

type TaskId = Word64 Source #

newtype KernelThreadId Source #

Constructors

KernelThreadId |

Fields

- kernelThreadId :: Word64

#### Instances

Instances details

Binary KernelThreadId Source # |
Instance details Defined in GHC.RTS.EventTypes Methods put :: KernelThreadId -> Put Source # get :: Get KernelThreadId Source # putList :: [KernelThreadId] -> Put Source #
Show KernelThreadId Source # |
Instance details Defined in GHC.RTS.EventTypes Methods showsPrec :: Int -> KernelThreadId -> ShowS Source # show :: KernelThreadId -> String Source # showList :: [KernelThreadId] -> ShowS Source #
Eq KernelThreadId Source # |
Instance details Defined in GHC.RTS.EventTypes Methods (==) :: KernelThreadId -> KernelThreadId -> Bool Source # (/=) :: KernelThreadId -> KernelThreadId -> Bool Source #
Ord KernelThreadId Source # |

Instance details

Defined in GHC.RTS.EventTypes

Methods

compare :: KernelThreadId -> KernelThreadId -> Ordering Source #

(<) :: KernelThreadId -> KernelThreadId -> Bool Source #

(<=) :: KernelThreadId -> KernelThreadId -> Bool Source #

(>) :: KernelThreadId -> KernelThreadId -> Bool Source #

(>=) :: KernelThreadId -> KernelThreadId -> Bool Source #

max :: KernelThreadId -> KernelThreadId -> KernelThreadId Source #

min :: KernelThreadId -> KernelThreadId -> KernelThreadId Source #

type EventTypeNum = Word16 Source #

type EventTypeDesc = Text Source #

type EventTypeSize = Word16 Source #

type BlockSize = Word32 Source #

type Capset = Word32 Source #

type PID = Word32 Source #

type StringId = Word32 Source #

type ProcessId = Word32 Source #

type MachineId = Word16 Source #

type PortId = ThreadId Source #

type MessageSize = Word32 Source #

data MessageTag Source #

Constructors

Ready |
NewPE |
PETIDS |
Finish |
FailPE |
RFork |
Connect |
DataMes |
Head |
Constr |
Part |
Terminate |
Packet |

#### Instances

Instances details

Enum MessageTag Source # |

Instance details

Defined in GHC.RTS.EventTypes

Methods

succ :: MessageTag -> MessageTag Source #

pred :: MessageTag -> MessageTag Source #

toEnum :: Int -> MessageTag Source #

fromEnum :: MessageTag -> Int Source #

enumFrom :: MessageTag -> [MessageTag] Source #

enumFromThen :: MessageTag -> MessageTag -> [MessageTag] Source #

enumFromTo :: MessageTag -> MessageTag -> [MessageTag] Source #

enumFromThenTo :: MessageTag -> MessageTag -> MessageTag -> [MessageTag] Source #

Show MessageTag Source # |
Instance details Defined in GHC.RTS.EventTypes Methods showsPrec :: Int -> MessageTag -> ShowS Source # show :: MessageTag -> String Source # showList :: [MessageTag] -> ShowS Source #

type ParConjDynId = Word64 Source #

type ParConjStaticId = StringId Source #

type SparkId = Word32 Source #

type FutureId = Word64 Source #

type PerfEventTypeNum = Word32 Source #

# Reading and writing event logs

readEventLogFromFile :: FilePath -> IO (Either String EventLog) Source #

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.

writeEventLogToFile :: FilePath -> EventLog -> IO () Source #

Writes the `EventLog` to file. The log is expected to NOT have `EventBlock` markers/events - the parsers no longer emit them and they are handled behind the scenes.

serialiseEventLog :: EventLog -> ByteString Source #

Serialises an `EventLog` back to a `ByteString`, usually for writing it back to a file.

# Utilities

data CapEvent Source #

Deprecated: CapEvents will be removed soon, now Event has a field evCap

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

Constructors

CapEvent | Deprecated: CapEvents will be removed soon, now Event has a field evCap

Fields

- ce_cap :: Maybe Int
- ce_event :: Event

#### Instances

Instances details

Show CapEvent Source # |
Instance details Defined in GHC.RTS.EventTypes Methods showsPrec :: Int -> CapEvent -> ShowS Source # show :: CapEvent -> String Source # showList :: [CapEvent] -> ShowS Source #

sortEvents :: [Event] -> [Event] Source #

buildEventTypeMap :: [EventType] -> IntMap EventType Source #

# Printing

data TimeFormat Source #

How to format event timestamps

Constructors

RawTime |
PrettyTime |

printEventsIncremental Source #

Arguments

:: Bool | Follow the file or not
-> FilePath |
-> IO () |

Read an event log file and pretty print it to stdout

showEventInfo :: EventInfo -> String Source #

buildEventInfo :: EventInfo -> Builder Source #

showThreadStopStatus :: ThreadStopStatus -> String Source #

ppEventLog :: TimeFormat -> EventLog -> String Source #

ppEventType :: EventType -> String Source #

ppEvent Source #

Arguments

:: TimeFormat |
-> IntMap EventType | Look up ``UnknownEvent`.`ref`` to find a suitable description.
-> Event |
-> String |

Pretty prints an `Event`, with clean handling for `UnknownEvent`

buildEvent :: TimeFormat -> IntMap EventType -> Event -> Builder Source #

buildEvent' :: Event -> Builder Source #

# Perf events

nEVENT_PERF_NAME :: EventTypeNum Source #

nEVENT_PERF_COUNTER :: EventTypeNum Source #

nEVENT_PERF_TRACEPOINT :: EventTypeNum Source #

sz_perf_num :: EventTypeSize Source #

sz_kernel_tid :: EventTypeSize Source #

# For compatibility with old clients

spec :: Event -> EventInfo Source #

Deprecated: The field is now called evSpec

time :: Event -> Timestamp Source #

Deprecated: The field is now called evTime