jon.recoil.org

Module Probe_emission

Probe management for code emission

type probe = private {
  1. stack_offset : int;
  2. num_stack_slots : int Stack_class.Tbl.t;
  3. probe_name : string;
  4. probe_enabled_at_init : bool;
  5. probe_handler_code_sym : string;
    (*

    Record frame info held in the corresponding mutable variables.

    *)
  6. probe_label : Label.t;
    (*

    Probe site, recorded in .note.stapsdt section for enabling and disabling the probes

    *)
  7. probe_insn : Linear.instruction;
    (*

    For optimized probes, the Iprobe instruction, recorded at the probe site and used for emitting the notes and the wrapper code at the end of the compilation unit. For non-optimized probes, this will be a direct call instruction.

    *)
}
val get_probes : unit -> Probe_emission.probe list
val add_probe : stack_offset:int -> num_stack_slots:int Stack_class.Tbl.t -> probe_name:string -> probe_enabled_at_init:bool -> probe_handler_code_sym:string -> probe_label:Label.t -> probe_insn:Linear.instruction -> unit

Add a probe site.

val reset : unit -> unit

Reset the probe semaphore registry

val find_or_add_semaphore : string -> bool option -> Debuginfo.t -> string

Find or add a semaphore for a probe name. Returns the label string for the semaphore symbol.

  • name: probe name
  • enabled_at_init: whether the probe is enabled at initialization
  • dbg: debug info for error reporting Raises Emitaux.Error (Inconsistent_probe_init ...) if the same probe is used with different enabled_at_init values.
val emit_probe_notes : slot_offset:(Reg.stack_location -> Stack_class.t -> int) -> add_def_symbol:(string -> unit) -> unit

Emit probe notes and semaphores to the assembly output