You can display detailed, technical information about or control active processes by using some of the process tool commands that are contained in the /usr/proc/bin directory. Table 23–3 lists some of the /proc tools.
If a process becomes trapped in an endless loop, or if it takes too long to execute, you might want to stop (kill) the process. For more information about stopping processes using the pkill command, see Chapter 23, Managing System Processes (Tasks).
The /proc file system is a directory hierarchy that contains additional subdirectories for state information and control functions.
It also provides a watchpoint facility that is used to remap read and write permissions on the individual pages of a process's address space. This facility has no restrictions and is MT-safe.
Debugging tools have been modified to use /proc's watchpoint facility, which means that the entire watchpoint process is faster.
The following restrictions have been removed when setting watchpoints by using the dbx debugging tool:
Setting watchpoints on local variables on the stack due to SPARC register windows
Setting watchpoints on multithreaded processes
For more information, see proc(4), core(4), and mdb(1).
Table 23–3 /usr/proc/bin Tools
Process Tool |
Description |
---|---|
pcred |
Displays process credential information |
pfiles |
Reports fstat and fcntl information for open files in a process |
pflags |
Prints /proc tracing flags, pending and held signals, and other status information |
pldd |
Lists the dynamic libraries that are linked into a process |
pmap |
Prints the address space map of each process |
psig |
Lists the signal actions and handlers of each process |
prun |
Starts each process |
pstack |
Prints a hex+symbolic stack trace for each lwp in each process |
pstop |
Stops each process |
ptime |
Times a process by using microstate accounting |
ptree |
Displays the process trees that contain the process |
pwait |
Displays status information after a process terminates |
pwdx |
Displays the current working directory for a process |
For more information, see proc(1).
To avoid typing long command names, add the process tool directory to your PATH variable. Then, you can run process tools by entering only the last part of each file name (for example, pwdx instead of /usr/proc/bin/pwdx).