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

Safe Haskell | None
Language | Haskell2010

GHC.RTS.Events.Analysis.Capability

Synopsis

- capabilityThreadPoolMachine :: Machine (Map ThreadId Int) Event
- capabilityThreadRunMachine :: Machine (Map Int ThreadId) Event
- capabilityThreadIndexer :: Map Int ThreadId -> Event -> Maybe ThreadId
- capabilityTaskPoolMachine :: Machine (Map TaskId Int) Event
- capabilityTaskOSMachine :: Machine (Map KernelThreadId Int, Map TaskId KernelThreadId) Event

# Documentation

capabilityThreadPoolMachine :: Machine (Map ThreadId Int) Event Source #

This state machine tracks threads residing on capabilities. Each thread can only reside on one capability, but can be migrated between them.

capabilityThreadRunMachine :: Machine (Map Int ThreadId) Event Source #

This state machine tracks threads running on capabilities, only one thread may run on a capability at a time.

capabilityThreadIndexer :: Map Int ThreadId -> Event -> Maybe ThreadId Source #

capabilityTaskPoolMachine :: Machine (Map TaskId Int) Event Source #

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.

capabilityTaskOSMachine :: Machine (Map KernelThreadId Int, Map TaskId KernelThreadId) Event Source #

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 `(Map KernelThreadId Int, Map TaskId KernelThreadId)` type: the second map is an injection (verified by the machine in `insertTaskOS`) 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 `capabilityTaskPoolMachine` and additionally the data invariant, and offers a richer verification profile.