summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2009-09-25 15:02:43 +0000
committerSimon Marlow <marlowsd@gmail.com>2009-09-25 15:02:43 +0000
commit5407ad8e0a5c08ac5193c1a9ede2a12570baee0b (patch)
tree0676ae90bb68e88ad42fd05a0c0282cd48c8b140 /includes
parente43a5e498520b933a0d9f4c7e9ddfb7ed2032cfd (diff)
downloadhaskell-5407ad8e0a5c08ac5193c1a9ede2a12570baee0b.tar.gz
Add a way to generate tracing events programmatically
added: primop TraceEventOp "traceEvent#" GenPrimOp Addr# -> State# s -> State# s { Emits an event via the RTS tracing framework. The contents of the event is the zero-terminated byte string passed as the first argument. The event will be emitted either to the .eventlog file, or to stderr, depending on the runtime RTS flags. } and added the required RTS functionality to support it. Also a bit of refactoring in the RTS tracing code.
Diffstat (limited to 'includes')
-rw-r--r--includes/rts/EventLogFormat.h3
-rw-r--r--includes/rts/Flags.h6
-rw-r--r--includes/stg/MiscClosures.h1
3 files changed, 8 insertions, 2 deletions
diff --git a/includes/rts/EventLogFormat.h b/includes/rts/EventLogFormat.h
index c4551c1424..eaad0f234a 100644
--- a/includes/rts/EventLogFormat.h
+++ b/includes/rts/EventLogFormat.h
@@ -116,8 +116,9 @@
#define EVENT_LOG_MSG 16 /* (message ...) */
#define EVENT_STARTUP 17 /* (num_capabilities) */
#define EVENT_BLOCK_MARKER 18 /* (size, end_time, capability) */
+#define EVENT_USER_MSG 19 /* (message ...) */
-#define NUM_EVENT_TAGS 19
+#define NUM_EVENT_TAGS 20
#if 0 /* DEPRECATED EVENTS: */
#define EVENT_CREATE_SPARK 13 /* (cap, thread) */
diff --git a/includes/rts/Flags.h b/includes/rts/Flags.h
index 733318a002..e78bed2d85 100644
--- a/includes/rts/Flags.h
+++ b/includes/rts/Flags.h
@@ -117,8 +117,12 @@ struct PROFILING_FLAGS {
};
+#define TRACE_NONE 0
+#define TRACE_EVENTLOG 1
+#define TRACE_STDERR 2
+
struct TRACE_FLAGS {
- rtsBool trace_stderr;
+ int tracing;
rtsBool timestamp; /* show timestamp in stderr output */
rtsBool scheduler; /* trace scheduler events */
diff --git a/includes/stg/MiscClosures.h b/includes/stg/MiscClosures.h
index 031c74b45f..24323cdaff 100644
--- a/includes/stg/MiscClosures.h
+++ b/includes/stg/MiscClosures.h
@@ -593,6 +593,7 @@ RTS_FUN(stg_getSparkzh);
RTS_FUN(stg_noDuplicatezh);
RTS_FUN(stg_traceCcszh);
+RTS_FUN(stg_traceEventzh);
/* Other misc stuff */
// See wiki:Commentary/Compiler/Backends/PprC#Prototypes