Process Control APIs
-
struct ps_prochandle *dtrace_proc_create(dtrace_hdl_t *dtp, const char *file, char *const *argv)
-
Creates a process under the control of DTrace. The
file
argument is the program to be executed. Theargv
argument isargv
for the executed process. The process is left in a stopped state and needs to be restarted by callingdtrace_proc_continue
(). Seedtrace_proc_create
(3DTRACE). -
struct ps_prochandle *dtrace_proc_grab(dtrace_hdl_t *dtp, pid_t pid, int flags)
-
Places an existing process under the control of DTrace. The
pid
argument is thepid
of the process in question. The possible values for the flag's argument are defined bylibproc
, which is a private API. Seedtrace_proc_grab
(3DTRACE). -
void dtrace_proc_release(dtrace_hdl_t *dtp, struct ps_prochandle *P)
-
Releases a process under DTrace control. The second argument,
P
, is the value returned by a previous call todtrace_proc_create
() ordtrace_proc_grab
(). Seedtrace_proc_release
(3DTRACE). -
void dtrace_proc_continue(dtrace_hdl_t *dtp, struct ps_prochandle *P)
-
Starts a stopped process. See
dtrace_proc_continue
(3DTRACE).