xref: /freebsd/usr.bin/procstat/procstat.1 (revision 1e413cf93298b5b97441a21d9a50fdcd0ee9945e)
1.\"-
2.\" Copyright (c) 2007 Robert N. M. Watson
3.\" All rights reserved.
4.\"
5.\" Redistribution and use in source and binary forms, with or without
6.\" modification, are permitted provided that the following conditions
7.\" are met:
8.\" 1. Redistributions of source code must retain the above copyright
9.\"    notice, this list of conditions and the following disclaimer.
10.\" 2. Redistributions in binary form must reproduce the above copyright
11.\"    notice, this list of conditions and the following disclaimer in the
12.\"    documentation and/or other materials provided with the distribution.
13.\"
14.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24.\" SUCH DAMAGE.
25.\"
26.\" $FreeBSD$
27.\"
28.Dd October 30, 2007
29.Dt PROCSTAT 1
30.Os
31.Sh NAME
32.Nm procstat
33.Nd get detailed process information
34.Sh SYNOPSIS
35.Nm
36.Op Fl h
37.Op Fl w Ar interval
38.Op Fl b | c | f | k | s | t | v
39.Op Fl a | Ar pid ...
40.Sh DESCRIPTION
41The
42.Nm
43utility displays detailed information about the processes identified by the
44.Ar pid
45arguments, or if the
46.Fl a
47flag is used, all processes.
48.Pp
49By default, basic process statistics are printed; one of the following
50options may be specified in order to select more detailed process information
51for printing:
52.Bl -tag -width indent
53.It Fl b
54Display binary information for the process.
55.It Fl c
56Display command line arguments for the process.
57.It Fl f
58Display file descriptor information for the process.
59.It Fl k
60Display the stacks of kernel threads in the process, excluding stacks of
61threads currently running on a CPU and threads with stacks swapped to disk.
62If the flag is repeated, function offsets as well as function names are
63printed.
64This feature requires
65.Cd "options STACK"
66or
67.Cd "options DDB"
68to be compiled into the kernel.
69.It Fl s
70Display security credential information for the process.
71.It Fl t
72Display thread information for the process.
73.It Fl v
74Display virtual memory mappings for the process.
75.El
76.Pp
77All options generate output in the format of a table, the first field of
78which is the process ID to which the row of information corresponds.
79The
80.Fl h
81flag may be used to suppress table headers.
82.Pp
83The
84.Fl w
85flag may be used to specify a wait interval at which to repeat the printing
86of the requested process information.
87If the
88.Fl w
89flag is not specified, the output will not repeat.
90.Pp
91Some information, such as VM and file descriptor information, is available
92only to the owner of a process or the superuser.
93.Sh EXIT STATUS
94.Ex -std
95.Sh SEE ALSO
96.Xr fstat 1 ,
97.Xr ps 1 ,
98.Xr sockstat 1 ,
99.Xr DDB 4 ,
100.Xr stack 9
101.Sh AUTHORS
102.An Robert N M Watson
103.Sh BUGS
104Some field values may include spaces, which limits the extent to which the
105output of
106.Nm
107may be mechanically parsed.
108.Pp
109The display of open file or memory mapping pathnames is implemented using the
110kernel's name cache.
111It therefore does not work for file systems
112that do not use the name cache, such as
113.Xr devfs 4 ,
114or if the name is not present in the cache due to removal.
115