man.bsd.lv manual page server

Manual Page Search Parameters

PROCSTAT(1) General Commands Manual PROCSTAT(1)

procstatget detailed process information

procstat [--libxo] [-h] [-M core] [-N system] [-w interval] command [pid ... | core ...]

procstat [--libxo] -a [-h] [-M core] [-N system] [-w interval] command

procstat [--libxo] [-h] [-M core] [-N system] [-w interval] [-b | -c | -e | -f [-C] | -i [-n] | -j [-n] | -k [-k] | -l | -r [-H] | -s | -S | -t | -v | -x] [pid ... | core ...]

procstat [--libxo] -a [-h] [-M core] [-N system] [-w interval] [-b | -c | -e | -f [-C] | -i [-n] | -j [-n] | -k [-k] | -l | -r [-H] | -s | -S | -t | -v | -x]

procstat [--libxo] -L [-h] [-M core] [-N system] [-w interval] core ...

procstat utility displays detailed information about the processes identified by the pid arguments, or if the -a flag is used, all processes. It can also display information extracted from a process core file, if the core file is specified as the argument.

If the --libxo flag is specified the output is generated via libxo(3) in a selection of different human and machine readable formats. See xo_parse_args(3) for details on command line arguments.

The following commands are available:

basic
Print basic process statistics (this is the default).
binary |
Display binary information for the process.

Substring commands are accepted.

argument(s) |
Display command line arguments for the process.

Substring commands are accepted.

environment |
Display environment variables for the process.

Substring commands are accepted.

file(s) | fd(s) |
Display file descriptor information for the process.

If the -C subcommand flag is used then additional capability information is printed.

signal(s) |
Display signal pending and disposition information for the process.

If the -n subcommand option is used, the signal numbers are shown instead of signal names.

Substring commands are accepted.

tsignal(s) |
Display signal pending and blocked information for the process's threads.

If the -n subcommand option is used, the signal numbers are shown instead of signal names.

Substring commands are accepted.

kstack |
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 -v subcommand option is used (or the command flag is repeated), function offsets as well as function names are printed.

rlimit |
Display resource limits for the process.
ptlwpinfo |
Display LWP info for the process pertaining to its signal driven exit.
rusage |
Display resource usage information for the process.

If the -v (or -H) subcommand flag is used then per-thread statistics are printed, rather than per-process statistics. The second field in the table will list the thread ID to which the row of information corresponds.

credential(s) |
Display security credential information for the process.

Substring commands are accepted.

cpuset | cs |
Display the cpuset information for the thread.
thread(s) |
Display thread information for the process.
vm |
Display virtual memory mappings for the process.
auxv |
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.

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
process descriptor
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.

The following network protocols may be displayed (grouped by address family):

AF_INET, AF_INET6

ICM
; see icmp(4).
IPD
; see divert(4).
IP?
unknown protocol.
RAW
; see ip(4).
SCT
; see sctp(4).
TCP
; see tcp(4).
UDP
; see udp(4).

AF_LOCAL

UDD
; see udp(4).
UDS
; see tcp(4).
UD?
unknown protocol.

?
unknown address family.

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 SIG_IGN; - otherwise.
C
if the signal will be caught; - otherwise.

If -n switch is given, the signal numbers are shown instead of signal names.

Display signal pending and blocked for a process's 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 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

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
FLAG
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

The procstat utility exits 0 on success, and >0 if an error occurs.

fstat(1), ps(1), sockstat(1), cap_enter(2), cap_rights_limit(2), libprocstat(3), libxo(3), signal(3), xo_parse_args(3), ddb(4), divert(4), icmp(4), ip(4), sctp(4), tcp(4), udp(4), stack(9)

Robert N M Watson <rwatson@FreeBSD.org>.
libxo(3) support was added by Allan Jude <allanjude@FreeBSD.org>.

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.

October 14, 2017 FreeBSD-12.0