package mirage-profile

  1. Overview
  2. Docs

Module MProf.TraceSource

Functions that libraries can use to add events to the trace. * * If mirage-profile is compiled with tracing disabled, these are null-ops (or * call the underlying untraced operation, as appropriate). The compiler should * optimise them out in this case.

General tracing calls for libraries

Sourceval label : string -> unit

Attach a label/comment to the currently executing thread.

Sourceval named_wait : string -> 'a Lwt.t * 'a Lwt.u

Wrapper for Lwt.wait that labels the new thread.

Sourceval named_task : string -> 'a Lwt.t * 'a Lwt.u

Wrapper for Lwt.task that labels the new thread.

Sourceval named_condition : string -> 'a Lwt_condition.t

Create a Lwt_condition that will label its thread with the given name.

Sourceval named_mvar_empty : string -> 'a Lwt_mvar.t

Create a Lwt_mvar that will label its threads with the given name.

Sourceval named_mvar : string -> 'a -> 'a Lwt_mvar.t

Create a Lwt_mvar that will label its threads with the given name.

Sourceval note_increase : string -> int -> unit
Sourceval note_counter_value : string -> int -> unit

Records the current value of the named counter. * (for internal use: use Counter.set_value instead)

Sourceval should_resolve : 'a Lwt.t -> unit

Add a hint that this thread is expected to resolve. * This is useful if a thread never completes and you want to find out why. * Without the hint, the viewer makes such threads almost invisible.

Interface for the main loop

Sourcetype hiatus_reason =
  1. | Wait_for_work
  2. | Suspend
  3. | Hibernate
Sourceval note_hiatus : hiatus_reason -> unit

Record that the process is about to stop running for a while.

Sourceval note_resume : unit -> unit

Record that the program has just resumed running.

OCaml

Innovation. Community. Security.