package mirage-runtime

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Mirage run-time utilities.

Release v4.4.1

Log thresholds

type log_threshold = [ `All | `Src of string ] * Logs.level option

The type for log threshold. A log level of None disables logging.

val set_level : default:Logs.level option -> log_threshold list -> unit

set_level ~default l set the log levels needed to have all of the log sources appearing in l be used.

module Arg : sig ... end
include module type of Functoria_runtime with module Arg := Arg
module Key : sig ... end

Key defines values that can be set by runtime command-line arguments. This module is the runtime companion of Key.

val argument_error : int

argument_error is the exit code used for argument parsing errors: 64.

val with_argv : unit Cmdliner.Term.t list -> string -> string array -> unit

with_argv keys name argv evaluates the keys terms on the command-line argv. name is the executable name. On evaluation error the application calls exit(3) with status 64. If `Help or `Version were evaluated, exit(3) is called with status 63.

type info = {
  1. name : string;
  2. libraries : (string * string) list;
    (*

    the result of dune-build-info

    *)
}

The type for build information available at runtime.

Registering scheduler hooks

val at_exit : (unit -> unit Lwt.t) -> unit

at_exit hook registers hook, which will be executed before the unikernel exits. The first hook registered will be executed last.

val at_enter_iter : (unit -> unit) -> unit

at_enter_iter hook registers hook to be executed at the beginning of each event loop iteration. The first hook registered will be executed last.

If hook calls at_enter_iter recursively, the new hook will run only on the next event loop iteration.

val at_leave_iter : (unit -> unit) -> unit

at_leave_iter hook registers hook to be executed at the end of each event loop iteration. See at_enter_iter for details.

Running hooks

This is mainly for for developers implementing new targets.

val run_exit_hooks : unit -> unit Lwt.t

run_exit_hooks () calls the sequence of hooks registered with at_exit in sequence.

val run_enter_iter_hooks : unit -> unit

run_enter_iter_hooks () calls the sequence of hooks registered with at_enter_iter in sequence.

val run_leave_iter_hooks : unit -> unit

run_leave_iter_hooks () call the sequence of hooks registered with at_leave_iter in sequence.