Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 5,402
    • Issues 5,402
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 590
    • Merge requests 590
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell CompilerGlasgow Haskell Compiler
  • GHCGHC
  • Wiki
  • Event log
  • live monitoring

live monitoring · Changes

Page history
Updated the ghc-events API authored Aug 18, 2014 by kvelicka's avatar kvelicka
Hide whitespace changes
Inline Side-by-side
event-log/live-monitoring.md
View page @ 2ceb812f
......@@ -152,10 +152,7 @@ Possible solutions to remove EventBlock:
Client API relevant to real-time event monitoring. The full API is larger; you can find it in the [ ghc-events library documentation](https://hackage.haskell.org/package/ghc-events).
```wiki
-- Datatype that holds a link to the eventlog
data EventHandle -- Abstract
-- Equivalent to the current API:
-- Equivalent to the current API: --------------------------------
data EventInfo = {...}
data ThreadStopStatus = {...}
data CapsetType = {...}
......@@ -165,20 +162,6 @@ type Timestamp = Word64
type ThreadId = Word32
type TaskId = Word64
data Event = Event { ev_time :: Timestamp,
, ev_cap :: Maybe Int
, ev_info :: EventInfo
} deriving Show
-- Opens the event stream from the specified handle,
-- reads the header info, and initialises the EventHandle
openEventHandle :: Handle -> IO EventHandle
-- Reads one event from the handle (incrementally). Returns Nothing if no events
-- are readable from the log
readEvent :: EventHandle -> IO (Maybe CapEvent)
-- Read/write from/to files
readEventLogFromFile :: FilePath -> IO (Either String [Event])
writeEventLogToFile :: FilePath -> [Event] -> IO ()
......@@ -197,6 +180,47 @@ nEVENT_PERF_TRACEPOINT :: EventTypeNum
sz_perf_num :: EventTypeSize
sz_kernel_tid :: EventTypeSize
-- Note: new field and changed names
data Event = Event { evTime :: Timestamp,
, evCap :: Maybe Int
, evInfo :: EventInfo
} deriving Show
-- New functionality: --------------------------------------------
-- Datatype that holds a link to the eventlog
data EventParserState -- Abstract
-- Datatype that describes the result of getEvent
data Result a
-- Successfully parsed an item
= One a
-- The eventlog wasn't complete but the input did not contain any more complete
-- items
| PartialEventLog
-- Parsing was completed successfully
| CompleteEventLog
-- An error in parsing has occurred
| EventLogParsingError String
-- Creates a fresh instance of EventParserState for a parser
initEventParser :: EventParserState
-- Given a state and a bytestring, parses at most one event (if the BS contains
-- enough data) and keeps the remainder ofthe BS in the state (to be used in
-- successive call to readEvent). Expects the first bytes to contain a complete Header
readEvent :: EventParserState -> B.ByteString -> (Result Event, EventParserState)
-- Deprecated functions and datatypes
time :: Event -> Timestamp
spec :: Event -> EventInfo
data CapEvent
= CapEvent { ce_cap :: Maybe Int,
ce_event :: Event
} deriving Show
```
### RTS
......
Clone repository Edit sidebar
  • Adventures in GHC compile times
  • All things layout
  • AndreasK
  • AndreasPK
  • Back End and Run Time System
  • Backpack refactoring
  • Backpack units
  • Brief Guide for Compiling GHC to iOS
  • Building GHC on Windows with Stack protector support (SSP) (using Make)
  • CAFs
  • CafInfo rework
  • Compiling Case Expressions in ghc
  • Compiling Data.Aeson Error
  • Contributing a Patch
  • Core interface section
View All Pages