summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2019-09-06 05:28:56 -0400
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-11-23 18:54:41 -0500
commite43e6ece1418f84e50d572772394ab639a083e79 (patch)
tree0404fb13a6aff166b8f0561b4f40ae980d36f2bc /docs
parent8a33abfcdf5a3ae9ae1777b92891890d6a045f8b (diff)
downloadhaskell-e43e6ece1418f84e50d572772394ab639a083e79.tar.gz
rts: Expose interface for configuring EventLogWriters
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')
-rw-r--r--docs/users_guide/8.10.1-notes.rst4
-rw-r--r--docs/users_guide/runtime_control.rst22
2 files changed, 25 insertions, 1 deletions
diff --git a/docs/users_guide/8.10.1-notes.rst b/docs/users_guide/8.10.1-notes.rst
index d9b48d95e0..e5ed23ca3e 100644
--- a/docs/users_guide/8.10.1-notes.rst
+++ b/docs/users_guide/8.10.1-notes.rst
@@ -222,6 +222,10 @@ Runtime system
out-of-the-box compatibility with OpenBSD and macOS Catalina (see
:ghc-ticket:`17353`)
+- The RTS API now exposes :ref:`an interface <event_log_output_api>` to
+ configure ``EventLogWriters``, allowing eventlog data to fed to sinks other
+ than ``.eventlog`` files.
+
Template Haskell
~~~~~~~~~~~~~~~~
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