summaryrefslogtreecommitdiff
path: root/docs/users_guide/runtime_control.rst
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2019-09-06 05:28:56 -0400
committerBen Gamari <ben@smart-cactus.org>2019-11-22 13:45:07 -0500
commitf9f9650e142fc3ec42001b08f81509461a09aa68 (patch)
treed160d3c3dfe0ee95f367781a5cc04802f3b4ecd4 /docs/users_guide/runtime_control.rst
parent2f5ed225b78b32c65d023072d78ae5d176e2f04b (diff)
downloadhaskell-wip/init-eventlogging.tar.gz
rts: Expose interface for configuring EventLogWriterswip/init-eventlogging
This exposes a set of interfaces from the GHC API for configuring EventLogWriters. These can be used by consumers like [ghc-eventlog-socket](https://github.com/bgamari/ghc-eventlog-socket).
Diffstat (limited to 'docs/users_guide/runtime_control.rst')
-rw-r--r--docs/users_guide/runtime_control.rst22
1 files changed, 21 insertions, 1 deletions
diff --git a/docs/users_guide/runtime_control.rst b/docs/users_guide/runtime_control.rst
index 7ebb9eb207..1f4b766400 100644
--- a/docs/users_guide/runtime_control.rst
+++ b/docs/users_guide/runtime_control.rst
@@ -174,6 +174,8 @@ e.g., on stack overflow. The hooks for these are as follows:
The message printed if ``malloc`` fails.
+.. _event_log_output_api:
+
Event log output
################
@@ -190,7 +192,7 @@ Furthermore GHC lets you specify the way event log data (see :rts-flag:`-l
.. c:member:: bool writeEventLog(void *eventlog, size_t eventlog_size)
- Hands buffered event log data to your event log writer.
+ Hands buffered event log data to your event log writer. Return true on success.
Required for a custom :c:type:`EventLogWriter`.
.. c:member:: void flushEventLog(void)
@@ -202,6 +204,24 @@ Furthermore GHC lets you specify the way event log data (see :rts-flag:`-l
Called when event logging is about to stop. This can be ``NULL``.
+To use an :c:type:`EventLogWriter` the RTS API provides the following functions:
+
+.. c:func:: enum EventLogStatus eventLogStatus(void)
+
+ Query whether the current runtime system supports the eventlog (e.g. whether
+ the current executable was linked with :ghc-flag:`-eventlog`) and, if it
+ is supported, whether it is currently logging.
+
+.. c:func:: bool startEventLogging(const EventLogWriter *writer)
+
+ Start logging events to the given :c:type:`EventLogWriter`. Returns true on
+ success or false is another writer has already been configured.
+
+.. c:func:: void endEventLogging()
+
+ Tear down the active :c:type:`EventLogWriter`.
+
+
.. _rts-options-misc:
Miscellaneous RTS options