tiny_httpd/ocaml/Runtime_events/index.html
2025-03-21 12:40:14 +00:00

2 lines
54 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Runtime_events (ocaml.Runtime_events)</title><meta charset="utf-8"/><link rel="stylesheet" href="../../_odoc-theme/odoc.css"/><meta name="generator" content="odoc 3.0.0"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a> <a href="../../index.html">Index</a> &#x00BB; <a href="../index.html">ocaml</a> &#x00BB; Runtime_events</nav><header class="odoc-preamble"><h1>Module <code><span>Runtime_events</span></code></h1><p>Runtime events - ring buffer-based runtime tracing</p><p>This module enables users to enable and subscribe to tracing events from the Garbage Collector and other parts of the OCaml runtime. This can be useful for diagnostic or performance monitoring purposes. This module can be used to subscribe to events for the current process or external processes asynchronously.</p><p>When enabled (either via setting the OCAML_RUNTIME_EVENTS_START environment variable or calling Runtime_events.start) a file with the pid of the process and extension .events will be created. By default this is in the current directory but can be over-ridden by the OCAML_RUNTIME_EVENTS_DIR environment variable. Each domain maintains its own ring buffer in a section of the larger file into which it emits events.</p><p>There is additionally a set of C APIs in runtime_events.h that can enable zero-impact monitoring of the current process or bindings for other languages.</p><p>The runtime events system's behaviour can be controlled by the following environment variables:</p><ul><li>OCAML_RUNTIME_EVENTS_START if set will cause the runtime events system to be started as part of the OCaml runtime initialization.</li></ul><ul><li>OCAML_RUNTIME_EVENTS_DIR sets the directory where the runtime events ring buffers will be located. If not present the program's working directory will be used.</li></ul><ul><li>OCAML_RUNTIME_EVENTS_PRESERVE if set will prevent the OCaml runtime from removing its ring buffers when it terminates. This can help if monitoring very short running programs.</li></ul></header><div class="odoc-content"><div class="odoc-spec"><div class="spec type anchored" id="type-runtime_counter"><a href="#type-runtime_counter" class="anchor"></a><code><span><span class="keyword">type</span> runtime_counter</span><span> = </span></code><ol><li id="type-runtime_counter.EV_C_FORCE_MINOR_ALLOC_SMALL" class="def variant constructor anchored"><a href="#type-runtime_counter.EV_C_FORCE_MINOR_ALLOC_SMALL" class="anchor"></a><code><span>| </span><span><span class="constructor">EV_C_FORCE_MINOR_ALLOC_SMALL</span></span></code><div class="def-doc"><span class="comment-delim">(*</span><p>Triggering of a minor collection due to a full minor heap.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 5.0</li></ul><span class="comment-delim">*)</span></div></li><li id="type-runtime_counter.EV_C_FORCE_MINOR_MAKE_VECT" class="def variant constructor anchored"><a href="#type-runtime_counter.EV_C_FORCE_MINOR_MAKE_VECT" class="anchor"></a><code><span>| </span><span><span class="constructor">EV_C_FORCE_MINOR_MAKE_VECT</span></span></code><div class="def-doc"><span class="comment-delim">(*</span><p>Triggering of a minor collection due to Array.make.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 5.0</li></ul><span class="comment-delim">*)</span></div></li><li id="type-runtime_counter.EV_C_FORCE_MINOR_SET_MINOR_HEAP_SIZE" class="def variant constructor anchored"><a href="#type-runtime_counter.EV_C_FORCE_MINOR_SET_MINOR_HEAP_SIZE" class="anchor"></a><code><span>| </span><span><span class="constructor">EV_C_FORCE_MINOR_SET_MINOR_HEAP_SIZE</span></span></code><div class="def-doc"><span class="comment-delim">(*</span><p>Triggering of a minor collection due to Gc.minor_heap_size.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 5.0</li></ul><span class="comment-delim">*)</span></div></li><li id="type-runtime_counter.EV_C_FORCE_MINOR_MEMPROF" class="def variant constructor anchored"><a href="#type-runtime_counter.EV_C_FORCE_MINOR_MEMPROF" class="anchor"></a><code><span>| </span><span><span class="constructor">EV_C_FORCE_MINOR_MEMPROF</span></span></code><div class="def-doc"><span class="comment-delim">(*</span><p>Triggering of a minor collection during memprof young sampling.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 5.3</li></ul><span class="comment-delim">*)</span></div></li><li id="type-runtime_counter.EV_C_MINOR_PROMOTED" class="def variant constructor anchored"><a href="#type-runtime_counter.EV_C_MINOR_PROMOTED" class="anchor"></a><code><span>| </span><span><span class="constructor">EV_C_MINOR_PROMOTED</span></span></code><div class="def-doc"><span class="comment-delim">(*</span><p>Total words promoted from the minor heap to the major in the last minor collection.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 5.0</li></ul><span class="comment-delim">*)</span></div></li><li id="type-runtime_counter.EV_C_MINOR_ALLOCATED" class="def variant constructor anchored"><a href="#type-runtime_counter.EV_C_MINOR_ALLOCATED" class="anchor"></a><code><span>| </span><span><span class="constructor">EV_C_MINOR_ALLOCATED</span></span></code><div class="def-doc"><span class="comment-delim">(*</span><p>Total <b>bytes</b> allocated in the minor heap in the last minor collection.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 5.0</li></ul><span class="comment-delim">*)</span></div></li><li id="type-runtime_counter.EV_C_REQUEST_MAJOR_ALLOC_SHR" class="def variant constructor anchored"><a href="#type-runtime_counter.EV_C_REQUEST_MAJOR_ALLOC_SHR" class="anchor"></a><code><span>| </span><span><span class="constructor">EV_C_REQUEST_MAJOR_ALLOC_SHR</span></span></code><div class="def-doc"><span class="comment-delim">(*</span><p>Major slice requested due to allocation in major heap.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 5.0</li></ul><span class="comment-delim">*)</span></div></li><li id="type-runtime_counter.EV_C_REQUEST_MAJOR_ADJUST_GC_SPEED" class="def variant constructor anchored"><a href="#type-runtime_counter.EV_C_REQUEST_MAJOR_ADJUST_GC_SPEED" class="anchor"></a><code><span>| </span><span><span class="constructor">EV_C_REQUEST_MAJOR_ADJUST_GC_SPEED</span></span></code><div class="def-doc"><span class="comment-delim">(*</span><p>Major slice requested by <code>caml_adjust_gc_speed</code>.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 5.0</li></ul><span class="comment-delim">*)</span></div></li><li id="type-runtime_counter.EV_C_REQUEST_MINOR_REALLOC_REF_TABLE" class="def variant constructor anchored"><a href="#type-runtime_counter.EV_C_REQUEST_MINOR_REALLOC_REF_TABLE" class="anchor"></a><code><span>| </span><span><span class="constructor">EV_C_REQUEST_MINOR_REALLOC_REF_TABLE</span></span></code><div class="def-doc"><span class="comment-delim">(*</span><p>Triggering of a minor collection due to ref table reallocation.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 5.0</li></ul><span class="comment-delim">*)</span></div></li><li id="type-runtime_counter.EV_C_REQUEST_MINOR_REALLOC_EPHE_REF_TABLE" class="def variant constructor anchored"><a href="#type-runtime_counter.EV_C_REQUEST_MINOR_REALLOC_EPHE_REF_TABLE" class="anchor"></a><code><span>| </span><span><span class="constructor">EV_C_REQUEST_MINOR_REALLOC_EPHE_REF_TABLE</span></span></code><div class="def-doc"><span class="comment-delim">(*</span><p>Triggering of a minor collection due to ephe_ref table reallocation.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 5.0</li></ul><span class="comment-delim">*)</span></div></li><li id="type-runtime_counter.EV_C_REQUEST_MINOR_REALLOC_CUSTOM_TABLE" class="def variant constructor anchored"><a href="#type-runtime_counter.EV_C_REQUEST_MINOR_REALLOC_CUSTOM_TABLE" class="anchor"></a><code><span>| </span><span><span class="constructor">EV_C_REQUEST_MINOR_REALLOC_CUSTOM_TABLE</span></span></code><div class="def-doc"><span class="comment-delim">(*</span><p>Triggering of a minor collection due to custom table reallocation.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 5.0</li></ul><span class="comment-delim">*)</span></div></li><li id="type-runtime_counter.EV_C_MAJOR_HEAP_POOL_WORDS" class="def variant constructor anchored"><a href="#type-runtime_counter.EV_C_MAJOR_HEAP_POOL_WORDS" class="anchor"></a><code><span>| </span><span><span class="constructor">EV_C_MAJOR_HEAP_POOL_WORDS</span></span></code><div class="def-doc"><span class="comment-delim">(*</span><p>Total words in a Domain's major heap pools. This is the sum of unallocated and live words in each pool.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 5.1</li></ul><span class="comment-delim">*)</span></div></li><li id="type-runtime_counter.EV_C_MAJOR_HEAP_POOL_LIVE_WORDS" class="def variant constructor anchored"><a href="#type-runtime_counter.EV_C_MAJOR_HEAP_POOL_LIVE_WORDS" class="anchor"></a><code><span>| </span><span><span class="constructor">EV_C_MAJOR_HEAP_POOL_LIVE_WORDS</span></span></code><div class="def-doc"><span class="comment-delim">(*</span><p>Current live words in a Domain's major heap pools.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 5.1</li></ul><span class="comment-delim">*)</span></div></li><li id="type-runtime_counter.EV_C_MAJOR_HEAP_LARGE_WORDS" class="def variant constructor anchored"><a href="#type-runtime_counter.EV_C_MAJOR_HEAP_LARGE_WORDS" class="anchor"></a><code><span>| </span><span><span class="constructor">EV_C_MAJOR_HEAP_LARGE_WORDS</span></span></code><div class="def-doc"><span class="comment-delim">(*</span><p>Total words of a Domain's major heap large allocations. A large allocation is an allocation larger than the largest sized pool.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 5.1</li></ul><span class="comment-delim">*)</span></div></li><li id="type-runtime_counter.EV_C_MAJOR_HEAP_POOL_FRAG_WORDS" class="def variant constructor anchored"><a href="#type-runtime_counter.EV_C_MAJOR_HEAP_POOL_FRAG_WORDS" class="anchor"></a><code><span>| </span><span><span class="constructor">EV_C_MAJOR_HEAP_POOL_FRAG_WORDS</span></span></code><div class="def-doc"><span class="comment-delim">(*</span><p>Words in a Domain's major heap pools lost to fragmentation. This is due to there not being a pool with the exact size of an allocation and a larger sized pool needing to be used.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 5.1</li></ul><span class="comment-delim">*)</span></div></li><li id="type-runtime_counter.EV_C_MAJOR_HEAP_POOL_LIVE_BLOCKS" class="def variant constructor anchored"><a href="#type-runtime_counter.EV_C_MAJOR_HEAP_POOL_LIVE_BLOCKS" class="anchor"></a><code><span>| </span><span><span class="constructor">EV_C_MAJOR_HEAP_POOL_LIVE_BLOCKS</span></span></code><div class="def-doc"><span class="comment-delim">(*</span><p>Live blocks of a Domain's major heap pools.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 5.1</li></ul><span class="comment-delim">*)</span></div></li><li id="type-runtime_counter.EV_C_MAJOR_HEAP_LARGE_BLOCKS" class="def variant constructor anchored"><a href="#type-runtime_counter.EV_C_MAJOR_HEAP_LARGE_BLOCKS" class="anchor"></a><code><span>| </span><span><span class="constructor">EV_C_MAJOR_HEAP_LARGE_BLOCKS</span></span></code><div class="def-doc"><span class="comment-delim">(*</span><p>Live blocks of a Domain's major heap large allocations.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 5.1</li></ul><span class="comment-delim">*)</span></div></li><li id="type-runtime_counter.EV_C_MAJOR_HEAP_WORDS" class="def variant constructor anchored"><a href="#type-runtime_counter.EV_C_MAJOR_HEAP_WORDS" class="anchor"></a><code><span>| </span><span><span class="constructor">EV_C_MAJOR_HEAP_WORDS</span></span></code><div class="def-doc"><span class="comment-delim">(*</span><p>Major heap size in words of a Domain.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 5.3</li></ul><span class="comment-delim">*)</span></div></li><li id="type-runtime_counter.EV_C_MAJOR_ALLOCATED_WORDS" class="def variant constructor anchored"><a href="#type-runtime_counter.EV_C_MAJOR_ALLOCATED_WORDS" class="anchor"></a><code><span>| </span><span><span class="constructor">EV_C_MAJOR_ALLOCATED_WORDS</span></span></code><div class="def-doc"><span class="comment-delim">(*</span><p>Allocations to the major heap of this Domain in words, since the last major slice.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 5.3</li></ul><span class="comment-delim">*)</span></div></li><li id="type-runtime_counter.EV_C_MAJOR_ALLOCATED_WORK" class="def variant constructor anchored"><a href="#type-runtime_counter.EV_C_MAJOR_ALLOCATED_WORK" class="anchor"></a><code><span>| </span><span><span class="constructor">EV_C_MAJOR_ALLOCATED_WORK</span></span></code><div class="def-doc"><span class="comment-delim">(*</span><p>The amount of major GC 'work' needing to be done as a result of allocations to the major heap of this Domain in words, since the last major slice.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 5.3</li></ul><span class="comment-delim">*)</span></div></li><li id="type-runtime_counter.EV_C_MAJOR_DEPENDENT_WORK" class="def variant constructor anchored"><a href="#type-runtime_counter.EV_C_MAJOR_DEPENDENT_WORK" class="anchor"></a><code><span>| </span><span><span class="constructor">EV_C_MAJOR_DEPENDENT_WORK</span></span></code><div class="def-doc"><span class="comment-delim">(*</span><p>The amount of major GC 'work' needing to be done as a result of dependent allocations to the major heap of this Domain in words, since the last major slice. Dependent memory is non-heap memory that depends on heap memory being collected in order to be freed.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 5.3</li></ul><span class="comment-delim">*)</span></div></li><li id="type-runtime_counter.EV_C_MAJOR_EXTRA_WORK" class="def variant constructor anchored"><a href="#type-runtime_counter.EV_C_MAJOR_EXTRA_WORK" class="anchor"></a><code><span>| </span><span><span class="constructor">EV_C_MAJOR_EXTRA_WORK</span></span></code><div class="def-doc"><span class="comment-delim">(*</span><p>The amount of major GC 'work' needing to be done as a result of extra non-memory resources that are dependent on heap memory being collected in order to be freed.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 5.3</li></ul><span class="comment-delim">*)</span></div></li><li id="type-runtime_counter.EV_C_MAJOR_WORK_COUNTER" class="def variant constructor anchored"><a href="#type-runtime_counter.EV_C_MAJOR_WORK_COUNTER" class="anchor"></a><code><span>| </span><span><span class="constructor">EV_C_MAJOR_WORK_COUNTER</span></span></code><div class="def-doc"><span class="comment-delim">(*</span><p>The global amount of major GC 'work' done by all domains since the program began.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 5.3</li></ul><span class="comment-delim">*)</span></div></li><li id="type-runtime_counter.EV_C_MAJOR_ALLOC_COUNTER" class="def variant constructor anchored"><a href="#type-runtime_counter.EV_C_MAJOR_ALLOC_COUNTER" class="anchor"></a><code><span>| </span><span><span class="constructor">EV_C_MAJOR_ALLOC_COUNTER</span></span></code><div class="def-doc"><span class="comment-delim">(*</span><p>The global words of major GC allocations done by all domains since the program began.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 5.3</li></ul><span class="comment-delim">*)</span></div></li><li id="type-runtime_counter.EV_C_MAJOR_SLICE_TARGET" class="def variant constructor anchored"><a href="#type-runtime_counter.EV_C_MAJOR_SLICE_TARGET" class="anchor"></a><code><span>| </span><span><span class="constructor">EV_C_MAJOR_SLICE_TARGET</span></span></code><div class="def-doc"><span class="comment-delim">(*</span><p>The target amount of global 'work' that should be done by all domains at the end of the major slice (see EV_C_MAJOR_SLICE_COUNTER).</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 5.3</li></ul><span class="comment-delim">*)</span></div></li><li id="type-runtime_counter.EV_C_MAJOR_SLICE_BUDGET" class="def variant constructor anchored"><a href="#type-runtime_counter.EV_C_MAJOR_SLICE_BUDGET" class="anchor"></a><code><span>| </span><span><span class="constructor">EV_C_MAJOR_SLICE_BUDGET</span></span></code><div class="def-doc"><span class="comment-delim">(*</span><p>The budget in 'work' that a domain has to do during the major slice.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 5.3</li></ul><span class="comment-delim">*)</span></div></li></ol></div><div class="spec-doc"><p>The type for counter events emitted by the runtime. Counter events are used to measure a quantity at a point in time or record the occurence of an event. In the latter case their value will be one.</p></div></div><div class="odoc-spec"><div class="spec type anchored" id="type-runtime_phase"><a href="#type-runtime_phase" class="anchor"></a><code><span><span class="keyword">type</span> runtime_phase</span><span> = </span></code><ol><li id="type-runtime_phase.EV_EXPLICIT_GC_SET" class="def variant constructor anchored"><a href="#type-runtime_phase.EV_EXPLICIT_GC_SET" class="anchor"></a><code><span>| </span><span><span class="constructor">EV_EXPLICIT_GC_SET</span></span></code><div class="def-doc"><span class="comment-delim">(*</span><p>Event spanning a call to Gc.set.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 5.0</li></ul><span class="comment-delim">*)</span></div></li><li id="type-runtime_phase.EV_EXPLICIT_GC_STAT" class="def variant constructor anchored"><a href="#type-runtime_phase.EV_EXPLICIT_GC_STAT" class="anchor"></a><code><span>| </span><span><span class="constructor">EV_EXPLICIT_GC_STAT</span></span></code><div class="def-doc"><span class="comment-delim">(*</span><p>Event spanning a call to Gc.stat.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 5.0</li></ul><span class="comment-delim">*)</span></div></li><li id="type-runtime_phase.EV_EXPLICIT_GC_MINOR" class="def variant constructor anchored"><a href="#type-runtime_phase.EV_EXPLICIT_GC_MINOR" class="anchor"></a><code><span>| </span><span><span class="constructor">EV_EXPLICIT_GC_MINOR</span></span></code><div class="def-doc"><span class="comment-delim">(*</span><p>Event spanning a call to Gc.minor, which forces a minor collection.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 5.0</li></ul><span class="comment-delim">*)</span></div></li><li id="type-runtime_phase.EV_EXPLICIT_GC_MAJOR" class="def variant constructor anchored"><a href="#type-runtime_phase.EV_EXPLICIT_GC_MAJOR" class="anchor"></a><code><span>| </span><span><span class="constructor">EV_EXPLICIT_GC_MAJOR</span></span></code><div class="def-doc"><span class="comment-delim">(*</span><p>Event spanning a call to Gc.major, which forces a major collection.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 5.0</li></ul><span class="comment-delim">*)</span></div></li><li id="type-runtime_phase.EV_EXPLICIT_GC_FULL_MAJOR" class="def variant constructor anchored"><a href="#type-runtime_phase.EV_EXPLICIT_GC_FULL_MAJOR" class="anchor"></a><code><span>| </span><span><span class="constructor">EV_EXPLICIT_GC_FULL_MAJOR</span></span></code><div class="def-doc"><span class="comment-delim">(*</span><p>Event spanning a call to Gc.full_major, which forces a full major collection.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 5.0</li></ul><span class="comment-delim">*)</span></div></li><li id="type-runtime_phase.EV_EXPLICIT_GC_COMPACT" class="def variant constructor anchored"><a href="#type-runtime_phase.EV_EXPLICIT_GC_COMPACT" class="anchor"></a><code><span>| </span><span><span class="constructor">EV_EXPLICIT_GC_COMPACT</span></span></code><div class="def-doc"><span class="comment-delim">(*</span><p>Event spanning a call to Gc.compact, which triggers a compaction.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 5.0</li></ul><span class="comment-delim">*)</span></div></li><li id="type-runtime_phase.EV_MAJOR" class="def variant constructor anchored"><a href="#type-runtime_phase.EV_MAJOR" class="anchor"></a><code><span>| </span><span><span class="constructor">EV_MAJOR</span></span></code><div class="def-doc"><span class="comment-delim">(*</span><p>Event spanning any major GC work.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 5.0</li></ul><span class="comment-delim">*)</span></div></li><li id="type-runtime_phase.EV_MAJOR_SWEEP" class="def variant constructor anchored"><a href="#type-runtime_phase.EV_MAJOR_SWEEP" class="anchor"></a><code><span>| </span><span><span class="constructor">EV_MAJOR_SWEEP</span></span></code><div class="def-doc"><span class="comment-delim">(*</span><p>Event spanning the sweeping work of a major GC.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 5.0</li></ul><span class="comment-delim">*)</span></div></li><li id="type-runtime_phase.EV_MAJOR_MARK_ROOTS" class="def variant constructor anchored"><a href="#type-runtime_phase.EV_MAJOR_MARK_ROOTS" class="anchor"></a><code><span>| </span><span><span class="constructor">EV_MAJOR_MARK_ROOTS</span></span></code><div class="def-doc"><span class="comment-delim">(*</span><p>Event spanning the marking of roots in a major GC.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 5.0</li></ul><span class="comment-delim">*)</span></div></li><li id="type-runtime_phase.EV_MAJOR_MEMPROF_ROOTS" class="def variant constructor anchored"><a href="#type-runtime_phase.EV_MAJOR_MEMPROF_ROOTS" class="anchor"></a><code><span>| </span><span><span class="constructor">EV_MAJOR_MEMPROF_ROOTS</span></span></code><div class="def-doc"><span class="comment-delim">(*</span><p>Event spanning the marking of memprof roots in a major GC.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 5.3</li></ul><span class="comment-delim">*)</span></div></li><li id="type-runtime_phase.EV_MAJOR_MARK" class="def variant constructor anchored"><a href="#type-runtime_phase.EV_MAJOR_MARK" class="anchor"></a><code><span>| </span><span><span class="constructor">EV_MAJOR_MARK</span></span></code><div class="def-doc"><span class="comment-delim">(*</span><p>Event spanning the marking of the heap in a major GC.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 5.0</li></ul><span class="comment-delim">*)</span></div></li><li id="type-runtime_phase.EV_MINOR" class="def variant constructor anchored"><a href="#type-runtime_phase.EV_MINOR" class="anchor"></a><code><span>| </span><span><span class="constructor">EV_MINOR</span></span></code><div class="def-doc"><span class="comment-delim">(*</span><p>Event spanning any minor GC work.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 5.0</li></ul><span class="comment-delim">*)</span></div></li><li id="type-runtime_phase.EV_MINOR_LOCAL_ROOTS" class="def variant constructor anchored"><a href="#type-runtime_phase.EV_MINOR_LOCAL_ROOTS" class="anchor"></a><code><span>| </span><span><span class="constructor">EV_MINOR_LOCAL_ROOTS</span></span></code><div class="def-doc"><span class="comment-delim">(*</span><p>Event spanning the scanning and major allocation of local roots during a minor GC.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 5.0</li></ul><span class="comment-delim">*)</span></div></li><li id="type-runtime_phase.EV_MINOR_MEMPROF_ROOTS" class="def variant constructor anchored"><a href="#type-runtime_phase.EV_MINOR_MEMPROF_ROOTS" class="anchor"></a><code><span>| </span><span><span class="constructor">EV_MINOR_MEMPROF_ROOTS</span></span></code><div class="def-doc"><span class="comment-delim">(*</span><p>Event spanning the scanning and promotion of memprof roots in a minor GC.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 5.3</li></ul><span class="comment-delim">*)</span></div></li><li id="type-runtime_phase.EV_MINOR_MEMPROF_CLEAN" class="def variant constructor anchored"><a href="#type-runtime_phase.EV_MINOR_MEMPROF_CLEAN" class="anchor"></a><code><span>| </span><span><span class="constructor">EV_MINOR_MEMPROF_CLEAN</span></span></code><div class="def-doc"><span class="comment-delim">(*</span><p>Event spanning cleaning and updating of memprof structures at the end of a minor GC.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 5.3</li></ul><span class="comment-delim">*)</span></div></li><li id="type-runtime_phase.EV_MINOR_FINALIZED" class="def variant constructor anchored"><a href="#type-runtime_phase.EV_MINOR_FINALIZED" class="anchor"></a><code><span>| </span><span><span class="constructor">EV_MINOR_FINALIZED</span></span></code><div class="def-doc"><span class="comment-delim">(*</span><p>Event spanning the running of finalisers for dead custom blocks at the end of a minor GC.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 5.0</li></ul><span class="comment-delim">*)</span></div></li><li id="type-runtime_phase.EV_EXPLICIT_GC_MAJOR_SLICE" class="def variant constructor anchored"><a href="#type-runtime_phase.EV_EXPLICIT_GC_MAJOR_SLICE" class="anchor"></a><code><span>| </span><span><span class="constructor">EV_EXPLICIT_GC_MAJOR_SLICE</span></span></code><div class="def-doc"><span class="comment-delim">(*</span><p>Event spanning a call to Gc.major_slice.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 5.0</li></ul><span class="comment-delim">*)</span></div></li><li id="type-runtime_phase.EV_FINALISE_UPDATE_FIRST" class="def variant constructor anchored"><a href="#type-runtime_phase.EV_FINALISE_UPDATE_FIRST" class="anchor"></a><code><span>| </span><span><span class="constructor">EV_FINALISE_UPDATE_FIRST</span></span></code><div class="def-doc"><span class="comment-delim">(*</span><p>Event spanning time spent in the first phase of finalisation at the end of a major GC cycle.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 5.0</li></ul><span class="comment-delim">*)</span></div></li><li id="type-runtime_phase.EV_FINALISE_UPDATE_LAST" class="def variant constructor anchored"><a href="#type-runtime_phase.EV_FINALISE_UPDATE_LAST" class="anchor"></a><code><span>| </span><span><span class="constructor">EV_FINALISE_UPDATE_LAST</span></span></code><div class="def-doc"><span class="comment-delim">(*</span><p>Event spanning time spent in the last phase of finalisation at the end of a major GC cycle.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 5.0</li></ul><span class="comment-delim">*)</span></div></li><li id="type-runtime_phase.EV_INTERRUPT_REMOTE" class="def variant constructor anchored"><a href="#type-runtime_phase.EV_INTERRUPT_REMOTE" class="anchor"></a><code><span>| </span><span><span class="constructor">EV_INTERRUPT_REMOTE</span></span></code><div class="def-doc"><span class="comment-delim">(*</span><p>Event spanning work triggered by an interrupt from another domain. This is usually a stop-the-world request.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 5.0</li></ul><span class="comment-delim">*)</span></div></li><li id="type-runtime_phase.EV_MAJOR_EPHE_MARK" class="def variant constructor anchored"><a href="#type-runtime_phase.EV_MAJOR_EPHE_MARK" class="anchor"></a><code><span>| </span><span><span class="constructor">EV_MAJOR_EPHE_MARK</span></span></code><div class="def-doc"><span class="comment-delim">(*</span><p>Event spanning the marking of ephemeron tables in a major GC.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 5.0</li></ul><span class="comment-delim">*)</span></div></li><li id="type-runtime_phase.EV_MAJOR_EPHE_SWEEP" class="def variant constructor anchored"><a href="#type-runtime_phase.EV_MAJOR_EPHE_SWEEP" class="anchor"></a><code><span>| </span><span><span class="constructor">EV_MAJOR_EPHE_SWEEP</span></span></code><div class="def-doc"><span class="comment-delim">(*</span><p>Event spanning the sweeping of ephemeron tables in a major GC.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 5.0</li></ul><span class="comment-delim">*)</span></div></li><li id="type-runtime_phase.EV_MAJOR_FINISH_MARKING" class="def variant constructor anchored"><a href="#type-runtime_phase.EV_MAJOR_FINISH_MARKING" class="anchor"></a><code><span>| </span><span><span class="constructor">EV_MAJOR_FINISH_MARKING</span></span></code><div class="def-doc"><span class="comment-delim">(*</span><p>Event spanning work done at the end of marking in a major GC.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 5.0</li></ul><span class="comment-delim">*)</span></div></li><li id="type-runtime_phase.EV_MAJOR_GC_CYCLE_DOMAINS" class="def variant constructor anchored"><a href="#type-runtime_phase.EV_MAJOR_GC_CYCLE_DOMAINS" class="anchor"></a><code><span>| </span><span><span class="constructor">EV_MAJOR_GC_CYCLE_DOMAINS</span></span></code><div class="def-doc"><span class="comment-delim">(*</span><p>Event spanning work done at the end of a major GC cycle. This includes a minor collection.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 5.0</li></ul><span class="comment-delim">*)</span></div></li><li id="type-runtime_phase.EV_MAJOR_GC_PHASE_CHANGE" class="def variant constructor anchored"><a href="#type-runtime_phase.EV_MAJOR_GC_PHASE_CHANGE" class="anchor"></a><code><span>| </span><span><span class="constructor">EV_MAJOR_GC_PHASE_CHANGE</span></span></code><div class="def-doc"><span class="comment-delim">(*</span><p>Event spanning the change of phase in the major GC which involves a global barrier.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 5.0</li></ul><span class="comment-delim">*)</span></div></li><li id="type-runtime_phase.EV_MAJOR_GC_STW" class="def variant constructor anchored"><a href="#type-runtime_phase.EV_MAJOR_GC_STW" class="anchor"></a><code><span>| </span><span><span class="constructor">EV_MAJOR_GC_STW</span></span></code><div class="def-doc"><span class="comment-delim">(*</span><p>Event spanning the stop-the-world phase done at the end of a major GC cycle.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 5.0</li></ul><span class="comment-delim">*)</span></div></li><li id="type-runtime_phase.EV_MAJOR_MARK_OPPORTUNISTIC" class="def variant constructor anchored"><a href="#type-runtime_phase.EV_MAJOR_MARK_OPPORTUNISTIC" class="anchor"></a><code><span>| </span><span><span class="constructor">EV_MAJOR_MARK_OPPORTUNISTIC</span></span></code><div class="def-doc"><span class="comment-delim">(*</span><p>Event spanning the work done during opportunistic marking in a major GC.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 5.0</li></ul><span class="comment-delim">*)</span></div></li><li id="type-runtime_phase.EV_MAJOR_SLICE" class="def variant constructor anchored"><a href="#type-runtime_phase.EV_MAJOR_SLICE" class="anchor"></a><code><span>| </span><span><span class="constructor">EV_MAJOR_SLICE</span></span></code><div class="def-doc"><span class="comment-delim">(*</span><p>Event spanning the work done during a major slice in a major GC.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 5.0</li></ul><span class="comment-delim">*)</span></div></li><li id="type-runtime_phase.EV_MAJOR_FINISH_CYCLE" class="def variant constructor anchored"><a href="#type-runtime_phase.EV_MAJOR_FINISH_CYCLE" class="anchor"></a><code><span>| </span><span><span class="constructor">EV_MAJOR_FINISH_CYCLE</span></span></code><div class="def-doc"><span class="comment-delim">(*</span><p>Event spanning attempts to drive all domains to the end of a major GC cycle.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 5.0</li></ul><span class="comment-delim">*)</span></div></li><li id="type-runtime_phase.EV_MINOR_CLEAR" class="def variant constructor anchored"><a href="#type-runtime_phase.EV_MINOR_CLEAR" class="anchor"></a><code><span>| </span><span><span class="constructor">EV_MINOR_CLEAR</span></span></code><div class="def-doc"><span class="comment-delim">(*</span><p>Event spanning the cleaning of the minor heap and supporting structures at the end of a minor GC.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 5.0</li></ul><span class="comment-delim">*)</span></div></li><li id="type-runtime_phase.EV_MINOR_FINALIZERS_OLDIFY" class="def variant constructor anchored"><a href="#type-runtime_phase.EV_MINOR_FINALIZERS_OLDIFY" class="anchor"></a><code><span>| </span><span><span class="constructor">EV_MINOR_FINALIZERS_OLDIFY</span></span></code><div class="def-doc"><span class="comment-delim">(*</span><p>Event spanning the promotion of finalisers during a minor GC.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 5.0</li></ul><span class="comment-delim">*)</span></div></li><li id="type-runtime_phase.EV_MINOR_GLOBAL_ROOTS" class="def variant constructor anchored"><a href="#type-runtime_phase.EV_MINOR_GLOBAL_ROOTS" class="anchor"></a><code><span>| </span><span><span class="constructor">EV_MINOR_GLOBAL_ROOTS</span></span></code><div class="def-doc"><span class="comment-delim">(*</span><p>Event spanning the scanning and major allocation of global roots during a minor GC.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 5.0</li></ul><span class="comment-delim">*)</span></div></li><li id="type-runtime_phase.EV_MINOR_LEAVE_BARRIER" class="def variant constructor anchored"><a href="#type-runtime_phase.EV_MINOR_LEAVE_BARRIER" class="anchor"></a><code><span>| </span><span><span class="constructor">EV_MINOR_LEAVE_BARRIER</span></span></code><div class="def-doc"><span class="comment-delim">(*</span><p>Event spanning the time spent in the barrier at the end of a minor GC, waiting for all domains to finish their work.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 5.0</li></ul><span class="comment-delim">*)</span></div></li><li id="type-runtime_phase.EV_STW_API_BARRIER" class="def variant constructor anchored"><a href="#type-runtime_phase.EV_STW_API_BARRIER" class="anchor"></a><code><span>| </span><span><span class="constructor">EV_STW_API_BARRIER</span></span></code><div class="def-doc"><span class="comment-delim">(*</span><p>Event spanning the time spent waiting for all other domains to reach the stop-the-world entry barrier.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 5.0</li></ul><span class="comment-delim">*)</span></div></li><li id="type-runtime_phase.EV_STW_HANDLER" class="def variant constructor anchored"><a href="#type-runtime_phase.EV_STW_HANDLER" class="anchor"></a><code><span>| </span><span><span class="constructor">EV_STW_HANDLER</span></span></code><div class="def-doc"><span class="comment-delim">(*</span><p>Event spanning the time spent in the stop-the-world handler, including time spent in the stop-the-world callback itself.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 5.0</li></ul><span class="comment-delim">*)</span></div></li><li id="type-runtime_phase.EV_STW_LEADER" class="def variant constructor anchored"><a href="#type-runtime_phase.EV_STW_LEADER" class="anchor"></a><code><span>| </span><span><span class="constructor">EV_STW_LEADER</span></span></code><div class="def-doc"><span class="comment-delim">(*</span><p>Event spanning the time spent as the leader of a stop-the-world.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 5.0</li></ul><span class="comment-delim">*)</span></div></li><li id="type-runtime_phase.EV_MAJOR_FINISH_SWEEPING" class="def variant constructor anchored"><a href="#type-runtime_phase.EV_MAJOR_FINISH_SWEEPING" class="anchor"></a><code><span>| </span><span><span class="constructor">EV_MAJOR_FINISH_SWEEPING</span></span></code><div class="def-doc"><span class="comment-delim">(*</span><p>Event spanning the time spent finishing sweeping when forced to as part of domain termination.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 5.0</li></ul><span class="comment-delim">*)</span></div></li><li id="type-runtime_phase.EV_MAJOR_MEMPROF_CLEAN" class="def variant constructor anchored"><a href="#type-runtime_phase.EV_MAJOR_MEMPROF_CLEAN" class="anchor"></a><code><span>| </span><span><span class="constructor">EV_MAJOR_MEMPROF_CLEAN</span></span></code><div class="def-doc"><span class="comment-delim">(*</span><p>Event spanning the time spent cleaning memprof structures at the end of a major GC.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 5.3</li></ul><span class="comment-delim">*)</span></div></li><li id="type-runtime_phase.EV_MINOR_FINALIZERS_ADMIN" class="def variant constructor anchored"><a href="#type-runtime_phase.EV_MINOR_FINALIZERS_ADMIN" class="anchor"></a><code><span>| </span><span><span class="constructor">EV_MINOR_FINALIZERS_ADMIN</span></span></code><div class="def-doc"><span class="comment-delim">(*</span><p>Event spanning finalisers book-keeping at the end of a minor GC.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 5.0</li></ul><span class="comment-delim">*)</span></div></li><li id="type-runtime_phase.EV_MINOR_REMEMBERED_SET" class="def variant constructor anchored"><a href="#type-runtime_phase.EV_MINOR_REMEMBERED_SET" class="anchor"></a><code><span>| </span><span><span class="constructor">EV_MINOR_REMEMBERED_SET</span></span></code><div class="def-doc"><span class="comment-delim">(*</span><p>Event spanning the scanning and major allocation of remembered sets during a minor GC.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 5.0</li></ul><span class="comment-delim">*)</span></div></li><li id="type-runtime_phase.EV_MINOR_REMEMBERED_SET_PROMOTE" class="def variant constructor anchored"><a href="#type-runtime_phase.EV_MINOR_REMEMBERED_SET_PROMOTE" class="anchor"></a><code><span>| </span><span><span class="constructor">EV_MINOR_REMEMBERED_SET_PROMOTE</span></span></code><div class="def-doc"><span class="comment-delim">(*</span><p>Event spanning the promotion of blocks in the remembered set and global roots during a minor GC.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 5.0</li></ul><span class="comment-delim">*)</span></div></li><li id="type-runtime_phase.EV_MINOR_LOCAL_ROOTS_PROMOTE" class="def variant constructor anchored"><a href="#type-runtime_phase.EV_MINOR_LOCAL_ROOTS_PROMOTE" class="anchor"></a><code><span>| </span><span><span class="constructor">EV_MINOR_LOCAL_ROOTS_PROMOTE</span></span></code><div class="def-doc"><span class="comment-delim">(*</span><p>Event spanning the promotion of local roots during a minor GC.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 5.0</li></ul><span class="comment-delim">*)</span></div></li><li id="type-runtime_phase.EV_DOMAIN_CONDITION_WAIT" class="def variant constructor anchored"><a href="#type-runtime_phase.EV_DOMAIN_CONDITION_WAIT" class="anchor"></a><code><span>| </span><span><span class="constructor">EV_DOMAIN_CONDITION_WAIT</span></span></code><div class="def-doc"><span class="comment-delim">(*</span><p>Event spanning waiting in Condition.wait.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 5.0</li></ul><span class="comment-delim">*)</span></div></li><li id="type-runtime_phase.EV_DOMAIN_RESIZE_HEAP_RESERVATION" class="def variant constructor anchored"><a href="#type-runtime_phase.EV_DOMAIN_RESIZE_HEAP_RESERVATION" class="anchor"></a><code><span>| </span><span><span class="constructor">EV_DOMAIN_RESIZE_HEAP_RESERVATION</span></span></code><div class="def-doc"><span class="comment-delim">(*</span><p>Event spanning resizing the domain heap reservation, as a result of minor heap size changes.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 5.0</li></ul><span class="comment-delim">*)</span></div></li><li id="type-runtime_phase.EV_COMPACT" class="def variant constructor anchored"><a href="#type-runtime_phase.EV_COMPACT" class="anchor"></a><code><span>| </span><span><span class="constructor">EV_COMPACT</span></span></code><div class="def-doc"><span class="comment-delim">(*</span><p>Event spanning compaction of the heap during a call to Gc.compact.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 5.2</li></ul><span class="comment-delim">*)</span></div></li><li id="type-runtime_phase.EV_COMPACT_EVACUATE" class="def variant constructor anchored"><a href="#type-runtime_phase.EV_COMPACT_EVACUATE" class="anchor"></a><code><span>| </span><span><span class="constructor">EV_COMPACT_EVACUATE</span></span></code><div class="def-doc"><span class="comment-delim">(*</span><p>Event spanning evacuating major GC pools during a compaction.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 5.2</li></ul><span class="comment-delim">*)</span></div></li><li id="type-runtime_phase.EV_COMPACT_FORWARD" class="def variant constructor anchored"><a href="#type-runtime_phase.EV_COMPACT_FORWARD" class="anchor"></a><code><span>| </span><span><span class="constructor">EV_COMPACT_FORWARD</span></span></code><div class="def-doc"><span class="comment-delim">(*</span><p>Event spanning the walking of the heap to update changed pointers after an evacuation during a compaction.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 5.2</li></ul><span class="comment-delim">*)</span></div></li><li id="type-runtime_phase.EV_COMPACT_RELEASE" class="def variant constructor anchored"><a href="#type-runtime_phase.EV_COMPACT_RELEASE" class="anchor"></a><code><span>| </span><span><span class="constructor">EV_COMPACT_RELEASE</span></span></code><div class="def-doc"><span class="comment-delim">(*</span><p>Event spanning releasing the evacuated pools at the end of a compaction.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 5.2</li></ul><span class="comment-delim">*)</span></div></li></ol></div><div class="spec-doc"><p>The type for span events emitted by the runtime.</p></div></div><div class="odoc-spec"><div class="spec type anchored" id="type-lifecycle"><a href="#type-lifecycle" class="anchor"></a><code><span><span class="keyword">type</span> lifecycle</span><span> = </span></code><ol><li id="type-lifecycle.EV_RING_START" class="def variant constructor anchored"><a href="#type-lifecycle.EV_RING_START" class="anchor"></a><code><span>| </span><span><span class="constructor">EV_RING_START</span></span></code><div class="def-doc"><span class="comment-delim">(*</span><p>Event indicating that the Runtime_events ring buffer has been started. Includes the PID of the process as an argument.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 5.0</li></ul><span class="comment-delim">*)</span></div></li><li id="type-lifecycle.EV_RING_STOP" class="def variant constructor anchored"><a href="#type-lifecycle.EV_RING_STOP" class="anchor"></a><code><span>| </span><span><span class="constructor">EV_RING_STOP</span></span></code><div class="def-doc"><span class="comment-delim">(*</span><p>Event indicating that the Runtime_events ring buffer has been stopped.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 5.0</li></ul><span class="comment-delim">*)</span></div></li><li id="type-lifecycle.EV_RING_PAUSE" class="def variant constructor anchored"><a href="#type-lifecycle.EV_RING_PAUSE" class="anchor"></a><code><span>| </span><span><span class="constructor">EV_RING_PAUSE</span></span></code><div class="def-doc"><span class="comment-delim">(*</span><p>Event indicating that the Runtime_events ring buffer has been paused.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 5.0</li></ul><span class="comment-delim">*)</span></div></li><li id="type-lifecycle.EV_RING_RESUME" class="def variant constructor anchored"><a href="#type-lifecycle.EV_RING_RESUME" class="anchor"></a><code><span>| </span><span><span class="constructor">EV_RING_RESUME</span></span></code><div class="def-doc"><span class="comment-delim">(*</span><p>Event indicating that the Runtime_events ring buffer has been resumed.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 5.0</li></ul><span class="comment-delim">*)</span></div></li><li id="type-lifecycle.EV_FORK_PARENT" class="def variant constructor anchored"><a href="#type-lifecycle.EV_FORK_PARENT" class="anchor"></a><code><span>| </span><span><span class="constructor">EV_FORK_PARENT</span></span></code><div class="def-doc"><span class="comment-delim">(*</span><p>Event indicating that a fork has occurred and the current domain is the parent. Includes the PID of the child as an argument.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 5.0</li></ul><span class="comment-delim">*)</span></div></li><li id="type-lifecycle.EV_FORK_CHILD" class="def variant constructor anchored"><a href="#type-lifecycle.EV_FORK_CHILD" class="anchor"></a><code><span>| </span><span><span class="constructor">EV_FORK_CHILD</span></span></code><div class="def-doc"><span class="comment-delim">(*</span><p>Event indicating that a fork has occurred and the current domain is the child.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 5.0</li></ul><span class="comment-delim">*)</span></div></li><li id="type-lifecycle.EV_DOMAIN_SPAWN" class="def variant constructor anchored"><a href="#type-lifecycle.EV_DOMAIN_SPAWN" class="anchor"></a><code><span>| </span><span><span class="constructor">EV_DOMAIN_SPAWN</span></span></code><div class="def-doc"><span class="comment-delim">(*</span><p>Event indicating that a new domain has been spawned. Includes the PID of the new domain as an argument.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 5.0</li></ul><span class="comment-delim">*)</span></div></li><li id="type-lifecycle.EV_DOMAIN_TERMINATE" class="def variant constructor anchored"><a href="#type-lifecycle.EV_DOMAIN_TERMINATE" class="anchor"></a><code><span>| </span><span><span class="constructor">EV_DOMAIN_TERMINATE</span></span></code><div class="def-doc"><span class="comment-delim">(*</span><p>Event indicating that a domain has terminated. Includes the PID of the domain as an argument.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 5.0</li></ul><span class="comment-delim">*)</span></div></li></ol></div><div class="spec-doc"><p>Lifecycle events for Runtime_events and domains.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-lifecycle_name"><a href="#val-lifecycle_name" class="anchor"></a><code><span><span class="keyword">val</span> lifecycle_name : <span><a href="#type-lifecycle">lifecycle</a> <span class="arrow">&#45;&gt;</span></span> string</span></code></div><div class="spec-doc"><p>Return a string representation of a given lifecycle event type.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-runtime_phase_name"><a href="#val-runtime_phase_name" class="anchor"></a><code><span><span class="keyword">val</span> runtime_phase_name : <span><a href="#type-runtime_phase">runtime_phase</a> <span class="arrow">&#45;&gt;</span></span> string</span></code></div><div class="spec-doc"><p>Return a string representation of a given runtime phase event type.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-runtime_counter_name"><a href="#val-runtime_counter_name" class="anchor"></a><code><span><span class="keyword">val</span> runtime_counter_name : <span><a href="#type-runtime_counter">runtime_counter</a> <span class="arrow">&#45;&gt;</span></span> string</span></code></div><div class="spec-doc"><p>Return a string representation of a given runtime counter type.</p></div></div><div class="odoc-spec"><div class="spec type anchored" id="type-cursor"><a href="#type-cursor" class="anchor"></a><code><span><span class="keyword">type</span> cursor</span></code></div><div class="spec-doc"><p>Type of the cursor used when consuming.</p></div></div><div class="odoc-spec"><div class="spec module anchored" id="module-Timestamp"><a href="#module-Timestamp" class="anchor"></a><code><span><span class="keyword">module</span> <a href="Timestamp/index.html">Timestamp</a></span><span> : <span class="keyword">sig</span> ... <span class="keyword">end</span></span></code></div></div><div class="odoc-spec"><div class="spec module anchored" id="module-Type"><a href="#module-Type" class="anchor"></a><code><span><span class="keyword">module</span> <a href="Type/index.html">Type</a></span><span> : <span class="keyword">sig</span> ... <span class="keyword">end</span></span></code></div></div><div class="odoc-spec"><div class="spec module anchored" id="module-User"><a href="#module-User" class="anchor"></a><code><span><span class="keyword">module</span> <a href="User/index.html">User</a></span><span> : <span class="keyword">sig</span> ... <span class="keyword">end</span></span></code></div><div class="spec-doc"><p>User events is a way for libraries to provide runtime events that can be consumed by other tools. These events can carry known data types or custom values. The current maximum number of user events is 8192.</p></div></div><div class="odoc-spec"><div class="spec module anchored" id="module-Callbacks"><a href="#module-Callbacks" class="anchor"></a><code><span><span class="keyword">module</span> <a href="Callbacks/index.html">Callbacks</a></span><span> : <span class="keyword">sig</span> ... <span class="keyword">end</span></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-start"><a href="#val-start" class="anchor"></a><code><span><span class="keyword">val</span> start : <span>unit <span class="arrow">&#45;&gt;</span></span> unit</span></code></div><div class="spec-doc"><p><code>start ()</code> will start the collection of events in the runtime if not already started.</p><p>Events can be consumed by creating a cursor with <code>create_cursor</code> and providing a set of callbacks to be called for each type of event.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-path"><a href="#val-path" class="anchor"></a><code><span><span class="keyword">val</span> path : <span>unit <span class="arrow">&#45;&gt;</span></span> <span>string option</span></span></code></div><div class="spec-doc"><p>If runtime events are being collected, <code>path ()</code> returns <code>Some p</code> where <code>p</code> is a path to the runtime events file. Otherwise, it returns None.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-pause"><a href="#val-pause" class="anchor"></a><code><span><span class="keyword">val</span> pause : <span>unit <span class="arrow">&#45;&gt;</span></span> unit</span></code></div><div class="spec-doc"><p><code>pause ()</code> will pause the collection of events in the runtime. Traces are collected if the program has called <code>Runtime_events.start ()</code> or the OCAML_RUNTIME_EVENTS_START environment variable has been set.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-resume"><a href="#val-resume" class="anchor"></a><code><span><span class="keyword">val</span> resume : <span>unit <span class="arrow">&#45;&gt;</span></span> unit</span></code></div><div class="spec-doc"><p><code>resume ()</code> will resume the collection of events in the runtime. Traces are collected if the program has called <code>Runtime_events.start ()</code> or the OCAML_RUNTIME_EVENTS_START environment variable has been set.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-create_cursor"><a href="#val-create_cursor" class="anchor"></a><code><span><span class="keyword">val</span> create_cursor : <span><span><span>(string * int)</span> option</span> <span class="arrow">&#45;&gt;</span></span> <a href="#type-cursor">cursor</a></span></code></div><div class="spec-doc"><p><code>create_cursor path_pid</code> creates a cursor to read from an runtime_events. Cursors can be created for runtime_events in and out of process. A runtime_events ring-buffer may have multiple cursors reading from it at any point in time and a program may have multiple cursors open concurrently (for example if multiple consumers want different sets of events). If <code>path_pid</code> is None then a cursor is created for the current process. Otherwise the pair contains a string <code>path</code> to the directory that contains the <code>pid</code>.events file and int <code>pid</code> for the runtime_events of an external process to monitor.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-free_cursor"><a href="#val-free_cursor" class="anchor"></a><code><span><span class="keyword">val</span> free_cursor : <span><a href="#type-cursor">cursor</a> <span class="arrow">&#45;&gt;</span></span> unit</span></code></div><div class="spec-doc"><p>Free a previously created runtime_events cursor.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-read_poll"><a href="#val-read_poll" class="anchor"></a><code><span><span class="keyword">val</span> read_poll : <span><a href="#type-cursor">cursor</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Callbacks/index.html#type-t">Callbacks.t</a> <span class="arrow">&#45;&gt;</span></span> <span><span>int option</span> <span class="arrow">&#45;&gt;</span></span> int</span></code></div><div class="spec-doc"><p><code>read_poll cursor callbacks max_option</code> calls the corresponding functions on <code>callbacks</code> for up to <code>max_option</code> events read off <code>cursor</code>'s runtime_events and returns the number of events read.</p></div></div></div></body></html>