diff options
author | Duncan Coutts <duncan@well-typed.com> | 2012-10-15 00:52:32 +0100 |
---|---|---|
committer | Duncan Coutts <duncan@well-typed.com> | 2012-10-15 12:28:29 +0100 |
commit | a609027da31c7c9103d8b9741ba3fc6807b7b7b9 (patch) | |
tree | d0e5340b10ef2d2e3935c3d682e3b35e4737d1ac /rts/Trace.h | |
parent | 8af2d940c786136a29a061fa9542e39f65e6d6fb (diff) | |
download | haskell-a609027da31c7c9103d8b9741ba3fc6807b7b7b9.tar.gz |
Add a new traceMarker# primop for use in profiling output
In time-based profiling visualisations (e.g. heap profiles and ThreadScope)
it would be useful to be able to mark particular points in the execution and
have those points in time marked in the visualisation.
The traceMarker# primop currently emits an event into the eventlog. In
principle it could be extended to do something in the heap profiling too.
Diffstat (limited to 'rts/Trace.h')
-rw-r--r-- | rts/Trace.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/rts/Trace.h b/rts/Trace.h index 4f1ac3bf0a..31aefcb58d 100644 --- a/rts/Trace.h +++ b/rts/Trace.h @@ -197,6 +197,12 @@ void trace_(char *msg, ...); */ void traceUserMsg(Capability *cap, char *msg); +/* + * A marker event emitted by the program + * Used by Debug.Trace.{traceMarker, traceMarkerIO} + */ +void traceUserMarker(Capability *cap, char *msg); + /* * An event to record a Haskell thread's label/name * Used by GHC.Conc.labelThread @@ -310,6 +316,7 @@ INLINE_HEADER void traceEventStartup_ (int n_caps STG_UNUSED) {}; #if !defined(DEBUG) && !defined(TRACING) && defined(DTRACE) void dtraceUserMsgWrapper(Capability *cap, char *msg); +void dtraceUserMarkerWrapper(Capability *cap, char *msg); #endif /* !defined(DEBUG) && !defined(TRACING) && defined(DTRACE) */ @@ -356,6 +363,8 @@ INLINE_HEADER void dtraceStartup (int num_caps) { HASKELLEVENT_CAP_DISABLE(cap) #define dtraceUserMsg(cap, msg) \ HASKELLEVENT_USER_MSG(cap, msg) +#define dtraceUserMarker(cap, msg) \ + HASKELLEVENT_USER_MARKER(cap, msg) #define dtraceGcIdle(cap) \ HASKELLEVENT_GC_IDLE(cap) #define dtraceGcWork(cap) \ @@ -435,6 +444,7 @@ INLINE_HEADER void dtraceStartup (int num_caps) { #define dtraceThreadLabel(cap, tso, label) /* nothing */ INLINE_HEADER void dtraceStartup (int num_caps STG_UNUSED) {}; #define dtraceUserMsg(cap, msg) /* nothing */ +#define dtraceUserMarker(cap, msg) /* nothing */ #define dtraceGcIdle(cap) /* nothing */ #define dtraceGcWork(cap) /* nothing */ #define dtraceGcDone(cap) /* nothing */ |