Private.Trace
Trace Eio events using OCaml's runtime events system.
val mint_id : unit -> id
mint_id ()
is a fresh unique id
.
Libraries and applications can use these functions to make the traces more useful.
val name : id -> string -> unit
name id label
sets label
as the name for id
.
with_span op fn
runs fn ()
, labelling the timespan during which it runs with op
.
suspend_fiber op
records that the current fiber is now suspended waiting for op
.
These are normally only called by the scheduler.
create_fiber ~cc id
records the creation of fiber id
in context cc
.
val create_cc : id -> Eio_runtime_events.cc_ty -> unit
create_cc id ty
records the creation of cancellation context id
.
val create_obj : ?label:string -> id -> Eio_runtime_events.obj_ty -> unit
create_obj id ty
records the creation of id
.
val get : id -> unit
get src
records reading a promise, taking from a stream, taking a lock, etc.
val try_get : id -> unit
try_get src
records that the current fiber wants to get from src
(which is not currently ready).
val put : id -> unit
put dst
records resolving a promise, adding to a stream, releasing a lock, etc.
val fiber : id -> unit
fiber id
records that id
is now the current fiber for this domain.
val suspend_domain : Runtime_events.Type.span -> unit
suspend_domain
records when the event loop is stopped waiting for events from the OS.
val exit_fiber : id -> unit
exit_fiber id
records that fiber id
has finished.
val error : id -> exn -> unit
error id exn
records that id
received an error.