Chapter 25.  proc Provider

Table of Contents

Probes
Arguments
lwpsinfo_t
psinfo_t
Examples
exec
start and exit
lwp-start and lwp-exit
signal-send
Stability

Probes

The proc probes are described in Table 25–1.

Table 25.1.  proc Probes

Probe

Description

create

Probe that fires when a process is created using fork ( 2 ) , forkall ( 2 ) , fork1 ( 2 ) , or vfork ( 2 ) . The psinfo_t corresponding to the new child process is pointed to by args[0]. You can distinguish vfork from the other fork variants by checking for PR_VFORKP in the pr_flag member of the forking thread's lwpsinfo_t. You can distinguish fork1 from forkall by examining the pr_nlwp members of both the parent process's psinfo_t (curpsinfo) and the child process's psinfo_t (args[0]). Because the create probe only fires after the process has been successfully created, and because LWP creation is part of creating a process, lwp-create will fire for any LWPs created at process creation time before the create probe fires for the new process.

exec

Probe that fires whenever a process loads a new process image with a variant of the exec ( 2 ) system call: exec ( 2 ) , execle ( 2 ) , execlp ( 2 ) , execv ( 2 ) , execve ( 2 ) , execvp ( 2 ) . The exec probe fires before the process image is loaded. Process variables like execname and curpsinfo therefore contain the process state before the image is loaded. Some time after the exec probe fires, either the exec-failure probe or the exec-success probe will subsequently fire in the same thread. The path of the new process image is pointed to by args[0].

exec-failure

Probe that fires when an exec ( 2 ) variant has failed. The exec-failure probe fires only after the exec probe has fired in the same thread. The errno ( 3C ) value is provided in args[0].

exec-success

Probe that fires when an exec ( 2 ) variant has succeeded. Like the exec-failure probe, the exec-success probe fires only after the exec probe has fired in the same thread. By the time the exec-success probe fires, process variables like execname and curpsinfo contain the process state after the new process image has been loaded.

exit

Probe that fires when the current process is exiting. The reason for exit, which is expressed as one of the SIGCHLD siginfo ( 3HEAD ) codes, is contained in args[0].

fault

Probe that fires when a thread experiences a machine fault. The fault code (as defined in proc ( 4 ) ) is in args[0]. The siginfo structure corresponding to the fault is pointed to by args[1]. Only those faults that induce a signal can trigger the fault probe.

lwp-create

Probe that fires when an LWP is created, typically as a result of thr_create ( 3C ) . The lwpsinfo_t corresponding to the new thread is pointed to by args[0]. The psinfo_t of the process containing the thread is pointed to by args[1].

lwp-start

Probe that fires within the context of a newly created LWP. The lwp-start probe will fire before any user-level instructions are executed. If the LWP is the first LWP in the process, the start probe will fire, followed by lwp-start.

lwp-exit

Probe that fires when an LWP is exiting, due either to a signal or to an explicit call to thr_exit ( 3C ) .

signal-discard

Probe that fires when a signal is sent to a single-threaded process, and the signal is both unblocked and ignored by the process. Under these conditions, the signal is discarded on generation. The lwpsinfo_t and psinfo_t of the target process and thread are in args[0] and args[1], respectively. The signal number is in args[2].

signal-send

Probe that fires when a signal is sent to a thread or process. The signal-send probe fires in the context of the sending process and thread. The lwpsinfo_t and psinfo_t of the receiving process and thread are in args[0] and args[1], respectively. The signal number is in args[2]. signal-send is always followed by signal-handle or signal-clear in the receiving process and thread.

signal-handle

Probe that fires immediately before a thread handles a signal. The signal-handle probe fires in the context of the thread that will handle the signal. The signal number is in args[0]. A pointer to the siginfo_t structure that corresponds to the signal is in args[1]. The address of the signal handler in the process is in args[2].

signal-clear

Probes that fires when a pending signal is cleared because the target thread was waiting for the signal in sigwait ( 2 ) , sigwaitinfo ( 3RT ) , or sigtimedwait ( 3RT ) . Under these conditions, the pending signal is cleared and the signal number is returned to the caller. The signal number is in args[0]. signal-clear fires in the context of the formerly waiting thread.

start

Probe that fires in the context of a newly created process. The start probe will fire before any user-level instructions are executed in the process.