Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
GHC
GHC
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,273
    • Issues 4,273
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 413
    • Merge Requests 413
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Security & Compliance
    • Security & Compliance
    • Dependency List
    • License Compliance
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Glasgow Haskell Compiler
  • GHCGHC
  • Wiki
  • event log

Last edited by Sylvain Henry Nov 07, 2019
Page history New page

event log

Note: further work is being done on the project. Ideas/progress/etc is on EventLog/LiveMonitoring

Summary

EventLog is a fast, extensible event logging framework in the GHC run-time system (RTS) to support profiling of GHC run-time events. The GHC User's Guide describes how to enable event logging, after the program is linked with eventlog.

An example:

$ ghc -O -eventlog -rtsopts A.hs --make
$ ./A +RTS -l

.. produces A.eventlog ...

$ ghc-events show A.eventlog 
Event Types:
   0: Create thread (size 4)
   1: Run thread (size 4)
   2: Stop thread (size 6)
   3: Thread runnable (size 4)
   4: Migrate thread (size 6)
...

Log events in binary format to the file program.eventlog, where flags is a sequence of zero or more characters indicating which kinds of events to log. Currently there is only one type supported: -ls, for scheduler events.

The format of the log file is described by the header EventLogFormat.h that comes with GHC, and it can be parsed in Haskell using the ghc-events library. To dump the contents of a .eventlog file as text, use the tool ghc-events that comes with the ghc-events package.

Limitations

Event logging can produce "observer effects". In particular, programs can pause while writing to the .eventlog file. These display in Threadscope as periods of 100% CPU use with no obvious cause. This effect is exacerbated by heavy use of debug tools which expand the eventlog file, such as Trace.traceMarkerIO. (This effect was at least seen on OS X. In an extreme case, a program doing nothing but writing 200,000 trace markers, which took 120 ms to run, showed a single 10ms pause in the middle to write them to the .eventlog file. These periods were shown to be due to writing the .eventlog file by using dtruss -a, which shows long periods of write_nocancel syscalls, writing to the .eventlog file opened earlier with open_nocancel.)

Design

  • EventLog framework is located in ghc_root/rts/eventlog/
  • A ghc-events library to parse EventLog files for any visualizer, which relies upon the Data.Binary library.
  • Visualizer: ThreadScope

Code repository

  • Available in GHC 6.10.x in ghc_root/rts/eventlog
  • ghc-events: EventLog binary file parser for profilers
  • ThreadScope: thread-level profiler for GHC EventLog events

Publications

  • Parallel Performance Tuning for Haskell (Don Jones Jr., Simon Marlow, Satnam Singh) Haskell '09: Proceedings of the second ACM SIGPLAN symposium on Haskell, Edinburgh, Scotland, ACM, 2009

Contributors

  • Satnam Singh
  • Simon Marlow
  • Donnie Jones <donnie@…>
Clone repository

GHC Home
GHC User's Guide

Joining In

Newcomers info
Mailing Lists & IRC
The GHC Team

Documentation

GHC Status Info
Working conventions
Building Guide
Debugging
Commentary

Wiki

Title Index
Recent Changes