PROCSTAT(1)

๐Ÿ“ฆ
version 15.1 ยท 2 versions
, in freebsd 15.1

๐Ÿ’… PROCSTAT(1) โ€” the procstat manual, but make it make sense โœจ

okay so bestie, this is the General Commands Manual entry for procstat, and honestly? it's a whole buffet of process info and I'm obsessed. grab a snack ๐Ÿ“

๐ŸŒธ NAME ๐ŸŒธ

procstat โ€” get detailed process information. that's it, that's the vibe. she tells you everything about your processes, no cap ๐Ÿ’–

โœจ SYNOPSIS โœจ

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 ...
pargs [--libxo] pid ...
penv [--libxo] pid ...
pwdx [--libxo] pid ...

๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

so the procstat utility is your girl for displaying detailed information about the processes โ€” specifically the ones you point at with the pid arguments, or, if you pass the -a flag, literally all of them ๐Ÿ‘‘. she can also pull info out of a process core file, if you hand her the core file as the argument. versatile icon behavior.

the pargs, penv and pwdx utilities display the arguments, environment, and current working directory (respectively, bestie, keep up ๐Ÿ’…) of the process specified by the pid argument. they mimic the behavior of Solaris utilities of the same names โ€” a little retro tribute, we love a homage.

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_options(7) for the details on command line arguments. fancy AND functional, we stan.

the following commands are available for procstat:

  • advlock โ€” print information about advisory locks on files. all three types of locks are listed: BSD-style lockf(2), POSIX-style fcntl(2) F_SETLK, and remote lockd(8) locks used by NFSv3.
โš ๏ธ heads up bestie: neither the -a option nor a pid list can be used to limit the display of the locks. mostly because some types of locks don't have local (or any) owning processes. it's giving "she answers to no one" ๐Ÿ˜ญ
  • argument(s) | -c โ€” display command line arguments for the process. substring commands are accepted ๐Ÿ’–
  • auxv | -x โ€” display ELF auxiliary vector for the process.
  • basic โ€” print basic process statistics. this is the default, so if you don't pick anything she just does this. lowkey the main character โœจ
  • binary | -b โ€” display binary information for the process. substring commands are accepted.
  • credential(s) | -s โ€” display security credential information for the process. substring commands are accepted.
  • cpuset | cs | -S โ€” display the cpuset information for the thread.
  • environment | -e โ€” display environment variables for the process. substring commands are accepted.
  • file(s) | fd(s) | -f โ€” display file descriptor information for the process. if the -C subcommand flag is used then additional capability information is printed. okay capability queen ๐Ÿ’…
  • kqueue(s) [-v] โ€” display the events registered in the process kqueues. the filter name, filter-specific identifier, flags, filter-specific flags, system and user data, and event status are displayed. if the -v verbose flag is provided to the subcommand, the values of the ext array are displayed as well. thorough!

for flags, a string is printed consisting of the following symbols corresponding to set flags:

  • O โ€” EV_ONESHOT
  • C โ€” EV_CLEAR
  • R โ€” EV_RECEIPT
  • D โ€” EV_DISPATCH
  • d โ€” EV_DROP
  • 1 โ€” EV_FLAG1
  • 2 โ€” EV_FLAG2

for status:

  • A โ€” KNOTE_STATUS_ACTIVE
  • Q โ€” KNOTE_STATUS_QUEUED
  • D โ€” KNOTE_STATUS_DISABLED
  • d โ€” KNOTE_STATUS_DETACHED
  • K โ€” KNOTE_STATUS_KQUEUE
  • kstack | -k โ€” display the stacks of kernel threads in the process, excluding stacks of threads currently running on a CPU in userspace. if the -v subcommand option is used (or the command flag is repeated), function offsets as well as function names are printed. double it up, get more info ๐Ÿ”ฅ
  • pargs โ€” display arguments for the process.
  • penv โ€” display environment variables for the process.
  • ptlwpinfo | -L โ€” display LWP info for the process pertaining to its signal driven exit.
  • pwdx โ€” display current working directory for the process.
  • rlimit | -l โ€” display resource limits for the process.
  • rlimitusage โ€” display the usage of the resource limits for the process.
  • rusage | -r โ€” 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. slay, granularity โœจ
  • signal(s) | -i โ€” 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.
  • thread(s) | -t โ€” display thread information for the process.
  • tsignal(s) | -j โ€” 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.
  • vm | -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 โ€” for when you simply don't need the labels, iykyk ๐Ÿ™ˆ

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. she said "once and done" ๐Ÿ’…

๐Ÿ”’ important one, bestie: 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. not her fault, she's just gatekept.

๐ŸŽ€ Binary Information

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)

๐Ÿ’œ Command Line Arguments

display the process ID, command, and command line arguments:

  • PID โ€” process ID
  • COMM โ€” command
  • ARGS โ€” command line arguments (if available)

๐ŸŒˆ Environment Variables

display the process ID, command, and environment variables:

  • PID โ€” process ID
  • COMM โ€” command
  • ENVIRONMENT โ€” environment variables (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. 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:

  • e โ€” POSIX semaphore
  • E โ€” eventfd
  • f โ€” fifo
  • h โ€” shared memory
  • i โ€” inotify descriptor
  • 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. she switches up her whole format for you, flexible queen ๐Ÿ‘‘

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

AF_INET, AF_INET6

  • ICM โ€” IPPROTO_ICMP; see icmp(4).
  • IP? โ€” unknown protocol.
  • RAW โ€” IPPROTO_RAW; see ip(4).
  • SCT โ€” IPPROTO_SCTP; see sctp(4).
  • TCP โ€” IPPROTO_TCP; see tcp(4).
  • UDP โ€” IPPROTO_UDP; see udp(4).

AF_LOCAL

  • UDD โ€” Datagram socket.
  • UDS โ€” Stream socket.
  • UDQ โ€” Sequential Packet Stream socket.
  • UD? โ€” unknown protocol.

AF_DIVERT

  • IPD โ€” Divert socket; see divert(4).
  • ? โ€” unknown address family.

๐Ÿ’€ 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 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.

๐Ÿ”ฅ Thread Signal Information

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.

๐Ÿซถ 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. no kernel option, no stack tea, sorry bestie ๐Ÿ˜ญ
  • PID โ€” process ID
  • TID โ€” thread ID
  • COMM โ€” command
  • TDNAME โ€” thread name
  • KSTACK โ€” kernel thread call stack

๐Ÿ“ Resource Limits

display resource limits for a process:

  • PID โ€” process ID
  • COMM โ€” command
  • RLIMIT โ€” resource limit name
  • SOFT โ€” soft limit
  • HARD โ€” hard limit

๐ŸŒธ Resource Usage

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

๐Ÿ‘‘ Security Credentials

display process credential information:

  • PID โ€” process ID, the classic ๐Ÿ’…
  • COMM โ€” command, aka what program is this
  • 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 โœจ

๐Ÿงต Thread Information

This one gives you per-thread tea โ˜• โ€” 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

Process virtual memory mappings, bestie โ€” addresses, mapping meta-data, and mapped object info:

  • 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
  • gd โ€” guard (pseudo-type)

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)
  • W โ€” pages in this range are locked by mlock(2) or mlockall(2)

๐Ÿงš ELF Auxiliary Vector

ELF auxiliary vector values, coming right up ๐ŸŽ€

  • PID โ€” process ID
  • COMM โ€” command
  • AUXV โ€” auxiliary vector name
  • VALUE โ€” auxiliary vector value

๐Ÿ”’ Advisory Lock Information

  • RW โ€” Read/Write type, RO for read, RW for write lock
  • TYPE โ€” Type of the lock, one of FLOCK for flock(2), FCNTL for fcntl(2), LOCKD for remote
  • PID โ€” Process id of the owner, for FCNTL and remote types
  • SYSID โ€” Remote system id if applicable
  • FSID โ€” File system id where the locked file resize <span>๐Ÿ˜ญ</span> (that's literally what the page says, no cap โ€” we're quoting it verbatim)
  • RDEV โ€” rdev for the file system
  • INO โ€” Unique file identifier (inode number) of the locked file on the file system
  • START โ€” Start offset of the locked range
  • LEN โ€” Length of the locked range. Zero means till EOF
  • PATH โ€” If available, the path of the locked file

๐Ÿšช EXIT STATUS

The procstat utility exits 0 on success, and >0 if an error occurs. That's it, that's the vibe check โœจ

๐ŸŒธ EXAMPLES

Show binary information about the current shell:

$ procstat binary $$
  PID COMM                OSREL PATH
46620 bash              1201000 /usr/local/bin/bash

Same as above but showing information about open file descriptors โ€” lowkey obsessed with how clean this output is:

$ procstat files $$
  PID COMM                FD T V FLAGS    REF  OFFSET PRO NAME
46620 bash              text v r r-------   -       - -   /usr/local/bin/bash
46620 bash              ctty v c rw------   -       - -   /dev/pts/12
46620 bash               cwd v d r-------   -       - -   /tmp
46620 bash              root v d r-------   -       - -   /
46620 bash                 0 v c rw------   7  372071 -   /dev/pts/12
46620 bash                 1 v c rw------   7  372071 -   /dev/pts/12
46620 bash                 2 v c rw------   7  372071 -   /dev/pts/12
46620 bash               255 v c rw------   7  372071 -   /dev/pts/12

Show the arguments used to launch init(8):

$ procstat arguments 1
  PID COMM             ARGS
    1 init             /sbin/init --

Extract binary information from a core dump:

$ procstat binary core.36642
  PID COMM                OSREL PATH
36642 top               1201000 /usr/bin/top
Trying to extract information from a core file generated in a different major FreeBSD version might show an error like this โ€” yeah, that's a whole mood ๐Ÿ’€
$ procstat mplayer.core
procstat: kinfo_proc structure size mismatch
procstat: procstat_getprocs()

๐Ÿ‘€ SEE ALSO

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

๐Ÿ‘‘ AUTHORS

  • Robert N M Watson <rwatson@FreeBSD.org> โ€” the main character who wrote this.
  • libxo(3) support was added by Allan Jude โŸจallanjude@FreeBSD.orgโŸฉ.
  • Juraj Lutter โŸจjuraj@lutter.skโŸฉ added the pargs, penv and pwdx functionality. King behaviour fr fr ๐Ÿซถ

๐Ÿ› BUGS

The display of open file or memory mapping pathnames is implemented using the kernel's name cache. So if a file system doesn't use the name cache, or the path to a file just isn't in the cache โ€” no path for you, bestie. It simply won't be displayed. ๐Ÿ™ˆ

procstat currently supports extracting data only from a live kernel, and not from kernel crash dumps. Noted. No cap.


and that's the whole page, bestie โ€” you ate that ๐Ÿ’…โœจ pop off with your new procstat knowledge, iykyk

This absolute icon of a manpage is from the Debian crew, dated July 16, 2025, and it lives at PROCSTAT(1). Go forth and procstat responsibly ๐Ÿฆ‹๐Ÿ’–

๐Ÿ“ฆ where this page comes from
  • freebsd 15.1: base 15.1
  • ๐Ÿ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms