Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

procstat(1) [freebsd man page]

PROCSTAT(1)						    BSD General Commands Manual 					       PROCSTAT(1)

NAME
procstat -- get detailed process information SYNOPSIS
procstat [-CHhn] [-w interval] [-b | -c | -e | -f | -i | -j | -k | -l | -r | -s | -t | -v | -x] [-a | pid | core ...] DESCRIPTION
The procstat utility displays detailed information about the processes identified by the pid arguments, or if the -a flag is used, all pro- cesses. It can also display information extracted from a process core file, if the core file is specified as the argument. 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. -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 process's 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. -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. 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 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: 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. 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'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. 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 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 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 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) ELF Auxiliary Vector Display ELF auxiliary vector values: PID process ID COMM command AUXV auxiliary vector name VALUE auxiliary vector value EXIT STATUS
The procstat utility exits 0 on success, and >0 if an error occurs. SEE ALSO
fstat(1), ps(1), sockstat(1), cap_enter(2), cap_rights_limit(2), 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. BSD
May 16, 2014 BSD
Man Page