mirror of
https://github.com/c-cube/moonpool.git
synced 2025-12-16 15:56:21 -05:00
2 lines
No EOL
24 KiB
HTML
2 lines
No EOL
24 KiB
HTML
<!DOCTYPE html>
|
||
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Runtime_events (ocaml.Runtime_events)</title><link rel="stylesheet" href="../../_odoc-theme/odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 2.2.1"/><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">ocaml</a> » 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></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></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></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></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></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></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></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></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></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></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></li></ol></div><div class="spec-doc"><p>The type for counter events emitted by the runtime</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></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></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></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></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></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></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></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></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></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></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></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></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></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></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></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></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></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></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></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></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></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></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></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></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></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></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></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></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></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></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></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></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></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></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></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></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></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></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></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></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></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></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></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></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></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></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></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></li></ol></div><div class="spec-doc"><p>Lifecycle events for the ring itself</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">-></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">-></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">-></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-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">-></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-pause"><a href="#val-pause" class="anchor"></a><code><span><span class="keyword">val</span> pause : <span>unit <span class="arrow">-></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">-></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">-></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">-></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">-></span></span> <span><a href="Callbacks/index.html#type-t">Callbacks.t</a> <span class="arrow">-></span></span> <span><span>int option</span> <span class="arrow">-></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> |