|-b||Display binary information for the process.|
|-c||Display command line arguments for the process.|
|-e||Display environment variables for the process.|
|-f||Display file descriptor information for the process.|
|-i||Display signal pending and disposition information for the process.|
|-j||Display signal pending and blocked information for the processs threads.|
|-k||Display the stacks of kernel threads in the process, excluding stacks of threads currently running on a CPU and threads with stacks swapped to disk. If the flag is repeated, function offsets as well as function names are printed.|
|-l||Display resource limits for the process.|
|-r||Display resource usage information for the process.|
|-s||Display security credential information for the process.|
|-S||Display the cpuset information for the thread.|
|-t||Display thread information for the process.|
|-v||Display virtual memory mappings for the process.|
|-x||Display ELF auxiliary vector for the process.|
All options generate output in the format of a table, the first field of which is the process ID to which the row of information corresponds. The -h flag may be used to suppress table headers.
The -w flag may be used to specify a wait interval at which to repeat the printing of the requested process information. If the -w flag is not specified, the output will not repeat.
The -C flag requests the printing of additional capability information in the file descriptor view.
The -H flag may be used to request per-thread statistics rather than per-process statistics for some options. For those options, the second field in the table will list the thread ID to which the row of information corresponds. The -H flag is implied for the -S mode.
Information for VM, file descriptor, and cpuset options is available only to the owner of a process or the superuser. A cpuset value displayed as -1 means that the information is either invalid or not available.
Display the process ID, command, and path to the process binary:
PID process ID COMM command OSREL osreldate for process binary PATH path to process binary (if available)
Display the process ID, command, and command line arguments:
PID process ID COMM command ARGS command line arguments (if available)
Display the process ID, command, and environment variables:
PID process ID COMM command ENVIRONMENT environment variables (if available)
Display detailed information about each file descriptor referenced by a process, including the process ID, command, file descriptor number, and per-file descriptor object information, such as object type and file system path. By default, the following information will be printed:
PID process ID COMM command FD file descriptor number or cwd/root/jail T file descriptor type V vnode type FLAGS file descriptor flags REF file descriptor reference count OFFSET file descriptor offset PRO network protocol NAME file path or socket addresses (if available)
The following file descriptor types may be displayed:
c crypto e POSIX semaphore f fifo h shared memory k kqueue m message queue p pipe s socket t pseudo-terminal master v vnode
The following vnode types may be displayed:
- not a vnode b block device c character device d directory f fifo l symbolic link r regular file s socket x revoked device
The following file descriptor flags may be displayed:
r read w write a append s async f fsync n non-blocking d direct I/O l lock held
If the -C flag is specified, the vnode type, reference count, and offset fields will be omitted, and a new capabilities field will be included listing capabilities, as described in cap_rights_limit(2), present for each capability descriptor.
Display signal pending and disposition for a process:
PID process ID COMM command SIG signal name FLAGS process signal disposition details, three symbols P if signal is pending in the global process queue, - otherwise I if signal delivery disposition is SIGIGN, - otherwise C if signal delivery is to catch it, - otherwise
If -n switch is given, the signal numbers are shown instead of signal names.
Display signal pending and blocked for a processs threads:
PID process ID TID thread ID COMM command SIG signal name FLAGS thread signal delivery status, two symbols P if signal is pending for the thread, - otherwise B if signal is blocked in the thread signal mask, - if not blocked
The -n switch has the same effect as for the -i switch: the signal numbers are shown instead of signal names.
Display kernel thread stacks for a process, allowing further interpretation of thread wait channels. If the -k flag is repeated, function offsets, not just function names, are printed.
This feature requires
.Cd options STACK or
.Cd options DDB to be compiled into the kernel.
PID process ID TID thread ID COMM command TDNAME thread name KSTACK kernel thread call stack
Display resource limits for a process:
PID process ID COMM command RLIMIT resource limit name SOFT soft limit HARD hard limit
Display resource usage for a process. If the -H flag is specified, resource usage for individual threads is displayed instead.
PID process ID TID thread ID ( if -H is specified ) COMM command RESOURCE resource name VALUE current usage
Display process credential information:
PID process ID COMM command EUID effective user ID RUID real user ID SVUID saved user ID EGID effective group ID RGID real group ID SVGID saved group ID UMASK file creation mode mask FLAGS credential flags GROUPS group set
The following credential flags may be displayed:
C capability mode
Display per-thread information, including process ID, per-thread ID, name, CPU, and execution state:
PID process ID TID thread ID COMM command TDNAME thread name CPU current or most recent CPU run on PRI thread priority STATE thread state WCHAN thread wait channel
Display process virtual memory mappings, including addresses, mapping meta-data, and mapped object information:
PID process ID START starting address of mapping END ending address of mapping PRT protection flags RES resident pages PRES private resident pages REF reference count SHD shadow page count FL mapping flags TP VM object type
The following protection flags may be displayed:
r read w write x execute
The following VM object types may be displayed:
-- none dd dead df default dv device md device with managed pages (GEM/TTM) ph physical sg scatter/gather sw swap vn vnode
The following mapping flags may be displayed:
C copy-on-write N needs copy S one or more superpage mappings are used D grows down (top-down stack) U grows up (bottom-up stack)
Display ELF auxiliary vector values:
PID process ID COMM command AUXV auxiliary vector name VALUE auxiliary vector value
.An Robert N M Watson
Some field values may include spaces, which limits the extent to which the output of procstat may be mechanically parsed.
The display of open file or memory mapping pathnames is implemented using the kernels name cache. If a file system does not use the name cache, or the path to a file is not in the cache, a path will not be displayed.
procstat currently supports extracting data only from a live kernel, and not from kernel crash dumps.