diff options
author | Simon Marlow <marlowsd@gmail.com> | 2009-03-17 16:42:14 +0000 |
---|---|---|
committer | Simon Marlow <marlowsd@gmail.com> | 2009-03-17 16:42:14 +0000 |
commit | 8b18faef8aeaf40150c208272a2fc117611e8ae8 (patch) | |
tree | 2aabc6115dccd0a3e303320515564b5628c8771c /includes/RtsFlags.h | |
parent | f8f4cb3f3a46e0495917a927cefe906531b7b38e (diff) | |
download | haskell-8b18faef8aeaf40150c208272a2fc117611e8ae8.tar.gz |
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)
Diffstat (limited to 'includes/RtsFlags.h')
-rw-r--r-- | includes/RtsFlags.h | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/includes/RtsFlags.h b/includes/RtsFlags.h index 5c72bbb3e2..77097872a2 100644 --- a/includes/RtsFlags.h +++ b/includes/RtsFlags.h @@ -60,6 +60,7 @@ struct DEBUG_FLAGS { rtsBool sanity; /* 'S' warning: might be expensive! */ rtsBool stable; /* 't' */ rtsBool prof; /* 'p' */ + rtsBool eventlog; /* 'e' */ rtsBool gran; /* 'r' */ rtsBool par; /* 'P' */ rtsBool linker; /* 'l' the object linker */ @@ -67,6 +68,7 @@ struct DEBUG_FLAGS { rtsBool stm; /* 'm' */ rtsBool squeeze; /* 'z' stack squeezing & lazy blackholing */ rtsBool hpc; /* 'c' coverage */ + rtsBool timestamp; /* add timestamps to traces */ }; struct COST_CENTRE_FLAGS { @@ -113,6 +115,12 @@ struct PROFILING_FLAGS { }; +#ifdef EVENTLOG +struct EVENTLOG_FLAGS { + rtsBool doEventLogging; +}; +#endif + struct CONCURRENT_FLAGS { int ctxtSwitchTime; /* in milliseconds */ int ctxtSwitchTicks; /* derived */ @@ -307,12 +315,6 @@ struct TICKY_FLAGS { FILE *tickyFile; }; -struct TRACE_FLAGS { - rtsBool sched; /* trace scheduler events for profiling */ - rtsBool gc; /* trace GC events */ - rtsBool timestamp; /* add timestamps to traces */ -}; - #ifdef USE_PAPI #define MAX_PAPI_USER_EVENTS 8 @@ -341,8 +343,10 @@ typedef struct _RTS_FLAGS { struct DEBUG_FLAGS DebugFlags; struct COST_CENTRE_FLAGS CcFlags; struct PROFILING_FLAGS ProfFlags; +#ifdef EVENTLOG + struct EVENTLOG_FLAGS EventLogFlags; +#endif struct TICKY_FLAGS TickyFlags; - struct TRACE_FLAGS TraceFlags; #if defined(THREADED_RTS) || defined(PAR) struct PAR_FLAGS ParFlags; |