PROCSTAT(1)

NAME
procstat - get detailed process information

SYNOPSIS
procstat [-h] [-n] [-w interval] [-b | -c | -f | -i | -j | -k | -s | -t | -v] [-a | pid ...]

DESCRIPTION
The procstat utility displays detailed information about the processes identified by the pid arguments, or if the -a flag is used, all processes.

By default, basic process statistics are printed; one of the following options may be specified in order to select more detailed process information for printing:

-b  Display binary information for the process.

-c  Display command line arguments 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 process 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.

-s  Display security credential information for the process.

-t  Display thread information for the process.

-v  Display virtual memory mappings 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.

Some information, such as VM and file descriptor information, is available only to the owner of a process or the superuser.

  Binary Information
Display the process ID, command, and path to the process binary:

PID process ID
COMM
    command
PATH
    path to process binary (if available)

  Command Line Arguments
Display the process ID, command, and command line arguments:

PID process ID
COMM
    command
ARGS
    command line arguments (if available)

  File Descriptors
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:

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
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
f   fifo
l   symbolic link
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

  Signal Disposition Information
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.

  Thread Signal Information
Display signal pending and blocked for a process threads:

PID process ID
COMM
    command
TID thread ID
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 signals numbers are shown instead of signal names.

  Kernel Thread Stacks
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 options STACK or options DDB to be compiled into the kernel.

PID process ID
TID thread ID
COMM
    command
TDNAME
    thread name
KSTACK
    kernel thread call stack

  Security Credentials
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
GROUPS
    group set

  Thread Information
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

  Virtual Memory Mappings
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
ph  physical
sw  swap
vn  vnode

The following mapping flags may be displayed:

C   copy-on-write
N   needs copy

EXIT STATUS

SEE ALSO
fstat(1), ps(1), sockstat(1), ddb(4), stack(9)

AUTHORS
Robert N M Watson

BUGS
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 kernel's 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.