Add fast event logging
authorSimon Marlow <marlowsd@gmail.com>
Tue, 17 Mar 2009 16:42:14 +0000 (16:42 +0000)
committerSimon Marlow <marlowsd@gmail.com>
Tue, 17 Mar 2009 16:42:14 +0000 (16:42 +0000)
commit8b18faef8aeaf40150c208272a2fc117611e8ae8
tree2aabc6115dccd0a3e303320515564b5628c8771c
parentf8f4cb3f3a46e0495917a927cefe906531b7b38e
Add fast event logging

Generate binary log files from the RTS containing a log of runtime
events with timestamps.  The log file can be visualised in various
ways, for investigating runtime behaviour and debugging performance
problems.  See for example the forthcoming ThreadScope viewer.

New GHC option:

  -eventlog   (link-time option) Enables event logging.

  +RTS -l     (runtime option) Generates <prog>.eventlog with
              the binary event information.

This replaces some of the tracing machinery we already had in the RTS:
e.g. +RTS -vg  for GC tracing (we should do this using the new event
logging instead).

Event logging has almost no runtime cost when it isn't enabled, though
in the future we might add more fine-grained events and this might
change; hence having a link-time option and compiling a separate
version of the RTS for event logging.  There's a small runtime cost
for enabling event-logging, for most programs it shouldn't make much
difference.

(Todo: docs)
20 files changed:
compiler/main/StaticFlagParser.hs
compiler/main/StaticFlags.hs
includes/EventLogFormat.h [new file with mode: 0644]
includes/RtsFlags.h
mk/config.mk.in
rts/Capability.c
rts/Makefile
rts/RaiseAsync.c
rts/RtsFlags.c
rts/RtsStartup.c
rts/Schedule.c
rts/Schedule.h
rts/Threads.c
rts/Trace.c
rts/Trace.h
rts/eventlog/EventLog.c [new file with mode: 0644]
rts/eventlog/EventLog.h [new file with mode: 0644]
rts/sm/GC.c
rts/sm/GCUtils.c
rts/sm/Sweep.c