Module Probes_lib.With_ptrace

For expert use only.
   Use [trace_existing_process ~atomically:true] and [trace_new_process] if possible,
   they do [With_ptrace] under the hood.

   Atomically get and update the state of probes using ptrace.
   A simple state machine checks that the process is stopped before trying to
   get or update the state of probes:

   (attach . (update | get_probe_state)* . detach
val attach : t -> pid -> unit

Attach to the process with pid, and stop it to allow probe update.

val start : t -> args:string list -> pid
val update : ?force:bool -> t -> actions:actions -> unit

Enable/disable probes. Raise if not attached to any process. update writes to memory of the process that must have been already stopped by attach. update does not continue process execution and can be invoked more than once. Invoke detach to continue process execution after all updates are done.

force see trace_existing_process

val get_probe_states : ?probe_names:probe_name array -> t -> probe_state array

Check which probes are enabled in the current process. Raise if not attached.

val detach : t -> unit

Let the process continue its execution and detach from it.