Module Probe_emission
Probe management for code emission
type probe = private {stack_offset : int;num_stack_slots : int Stack_class.Tbl.t;probe_name : string;probe_enabled_at_init : bool;probe_handler_code_sym : string;(*Record frame info held in the corresponding mutable variables.
*)probe_label : Label.t;(*Probe site, recorded in .note.stapsdt section for enabling and disabling the probes
*)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 listval 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 ->
unitAdd a probe site.
val find_or_add_semaphore : string -> bool option -> Debuginfo.t -> stringFind or add a semaphore for a probe name. Returns the label string for the semaphore symbol.
name: probe nameenabled_at_init: whether the probe is enabled at initializationdbg: 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) ->
unitEmit probe notes and semaphores to the assembly output