summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/users_guide/8.10.1-notes.rst3
-rw-r--r--docs/users_guide/eventlog-formats.rst30
2 files changed, 33 insertions, 0 deletions
diff --git a/docs/users_guide/8.10.1-notes.rst b/docs/users_guide/8.10.1-notes.rst
index 7566f3f019..1dea59a063 100644
--- a/docs/users_guide/8.10.1-notes.rst
+++ b/docs/users_guide/8.10.1-notes.rst
@@ -144,6 +144,9 @@ Compiler
the sample start event contains a timestamp of when the census occurred.
The retainer profiling events are emitted using the standard events.
+- The eventlog now logs the cost centre stack on each sample. This enables
+ the `.prof` file to be partially reconstructed from the eventlog.
+
- Add new flag :ghc-flag:`-fkeep-going` which makes the compiler
continue as far as it can despite errors.
diff --git a/docs/users_guide/eventlog-formats.rst b/docs/users_guide/eventlog-formats.rst
index 27bd37cd3f..a3ed47fc3c 100644
--- a/docs/users_guide/eventlog-formats.rst
+++ b/docs/users_guide/eventlog-formats.rst
@@ -134,3 +134,33 @@ A variable-length event encoding a heap sample broken down by,
* ``Word8``: Profile ID
* ``Word64``: heap residency in bytes
* ``String``: type or closure description, or module name
+
+.. _time-profiler-events:
+
+Time profiler event log output
+------------------------------
+
+The time profiling mode enabled by ``-p`` also emits sample events to the eventlog.
+At the start of profiling the tick interval is emitted to the eventlog and then
+on each tick the current cost centre stack is emitted. Together these enable
+a user to construct an approximate track of the executation of their program.
+
+Profile begin event
+^^^^^^^^^^^^^^^^^^^
+
+ * ``EVENT_PROF_BEGIN``
+
+ * ``Word64``: Tick interval, in nanoseconds
+
+
+Tick sample event
+^^^^^^^^^^^^^^^^^^
+
+A variable-length packet encoding a profile sample.
+
+* ``EVENT_PROF_SAMPLE_COST_CENTRE``
+
+ * ``Word32``: Capability
+ * ``Word64``: Current profiling tick
+ * ``Word8``: stack depth
+ * ``Word32[]``: cost centre stack starting with inner-most (cost centre numbers)