]> CyberLeo.Net >> Repos - FreeBSD/stable/9.git/blob - usr.bin/procstat/procstat.1
MFC r232300 (pluknet):
[FreeBSD/stable/9.git] / usr.bin / procstat / procstat.1
1 .\"-
2 .\" Copyright (c) 2007-2009 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 February 29, 2012
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 n
38 .Op Fl C
39 .Op Fl w Ar interval
40 .Op Fl b | c | e | f | i | j | k | l | s | t | v | x
41 .Op Fl a | Ar pid ...
42 .Sh DESCRIPTION
43 The
44 .Nm
45 utility displays detailed information about the processes identified by the
46 .Ar pid
47 arguments, or if the
48 .Fl a
49 flag is used, all processes.
50 .Pp
51 By default, basic process statistics are printed; one of the following
52 options may be specified in order to select more detailed process information
53 for printing:
54 .Bl -tag -width indent
55 .It Fl b
56 Display binary information for the process.
57 .It Fl c 
58 Display command line arguments for the process.
59 .It Fl e
60 Display environment variables for the process.
61 .It Fl f
62 Display file descriptor information for the process.
63 .It Fl i
64 Display signal pending and disposition information for the process.
65 .It Fl j
66 Display signal pending and blocked information for the process threads.
67 .It Fl k
68 Display the stacks of kernel threads in the process, excluding stacks of
69 threads currently running on a CPU and threads with stacks swapped to disk.
70 If the flag is repeated, function offsets as well as function names are
71 printed.
72 .It Fl l
73 Display resource limits for the process.
74 .It Fl s
75 Display security credential information for the process.
76 .It Fl t
77 Display thread information for the process.
78 .It Fl v
79 Display virtual memory mappings for the process.
80 .It Fl x
81 Display ELF auxiliary vector for the process.
82 .El
83 .Pp
84 All options generate output in the format of a table, the first field of
85 which is the process ID to which the row of information corresponds.
86 The
87 .Fl h
88 flag may be used to suppress table headers.
89 .Pp
90 The
91 .Fl w
92 flag may be used to specify a wait interval at which to repeat the printing
93 of the requested process information.
94 If the
95 .Fl w
96 flag is not specified, the output will not repeat.
97 .Pp
98 The
99 .Fl C
100 flag requests the printing of additional capability information in the file
101 descriptor view.
102 .Pp
103 Some information, such as VM and file descriptor information, is available
104 only to the owner of a process or the superuser.
105 .Ss Binary Information
106 Display the process ID, command, and path to the process binary:
107 .Pp
108 .Bl -tag -width indent -compact
109 .It PID
110 process ID
111 .It COMM
112 command
113 .It PATH
114 path to process binary (if available)
115 .El
116 .Ss Command Line Arguments
117 Display the process ID, command, and command line arguments:
118 .Pp
119 .Bl -tag -width indent -compact
120 .It PID
121 process ID
122 .It COMM
123 command
124 .It ARGS
125 command line arguments (if available)
126 .El
127 .Ss File Descriptors
128 Display detailed information about each file descriptor referenced by a
129 process, including the process ID, command, file descriptor number, and
130 per-file descriptor object information, such as object type and file system
131 path.
132 By default, the following information will be printed:
133 .Pp
134 .Bl -tag -width indent -compact
135 .It PID
136 process ID
137 .It COMM
138 command
139 .It FD
140 file descriptor number or cwd/root/jail
141 .It T
142 file descriptor type
143 .It V
144 vnode type
145 .It FLAGS
146 file descriptor flags
147 .It REF
148 file descriptor reference count
149 .It OFFSET
150 file descriptor offset
151 .It PRO
152 network protocol
153 .It NAME
154 file path or socket addresses (if available)
155 .El
156 .Pp
157 The following file descriptor types may be displayed:
158 .Pp
159 .Bl -tag -width X -compact
160 .It c
161 crypto
162 .It e
163 POSIX semaphore
164 .It f
165 fifo
166 .It h
167 shared memory
168 .It k
169 kqueue
170 .It m
171 message queue
172 .It p
173 pipe
174 .It s
175 socket
176 .It t
177 pseudo-terminal master
178 .It v
179 vnode
180 .El
181 .Pp
182 The following vnode types may be displayed:
183 .Pp
184 .Bl -tag -width X -compact
185 .It -
186 not a vnode
187 .It b
188 block device
189 .It c
190 character device
191 .It d
192 directory
193 .It f
194 fifo
195 .It l
196 symbolic link
197 .It r
198 regular file
199 .It s
200 socket
201 .It x
202 revoked device
203 .El
204 .Pp
205 The following file descriptor flags may be displayed:
206 .Pp
207 .Bl -tag -width X -compact
208 .It r
209 read
210 .It w
211 write
212 .It a
213 append
214 .It s
215 async
216 .It f
217 fsync
218 .It n
219 non-blocking
220 .It d
221 direct I/O
222 .It l
223 lock held
224 .It c
225 descriptor is a capability
226 .El
227 .Pp
228 If the
229 .Fl C
230 flag is specified, the vnode type, reference count, and offset fields will be
231 omitted, and a new capabilities field will be included listing capabilities,
232 as described in
233 .Xr cap_new 2 ,
234 present for each capability descriptor.
235 .Ss Signal Disposition Information
236 Display signal pending and disposition for a process:
237 .Pp
238 .Bl -tag -width ident -compact
239 .It PID
240 process ID
241 .It COMM
242 command
243 .It SIG
244 signal name
245 .It FLAGS
246 process signal disposition details, three symbols
247 .Bl -tag -width X -compact
248 .It P
249 if signal is pending in the global process queue, - otherwise
250 .It I
251 if signal delivery disposition is SIGIGN, - otherwise
252 .It C
253 if signal delivery is to catch it, - otherwise
254 .El
255 .El
256 .Pp
257 If
258 .Fl n
259 switch is given, the signal numbers are shown instead of signal names.
260 .Ss Thread Signal Information
261 Display signal pending and blocked for a process threads:
262 .Pp
263 .Bl -tag -width ident -compact
264 .It PID
265 process ID
266 .It COMM
267 command
268 .It TID
269 thread ID
270 .It SIG
271 signal name
272 .It FLAGS
273 thread signal delivery status, two symbols
274 .Bl -tag -width X -compact
275 .It P
276 if signal is pending for the thread, - otherwise
277 .It B
278 if signal is blocked in the thread signal mask, - if not blocked
279 .El
280 .El
281 .Pp
282 The
283 .Fl n
284 switch has the same effect as for the
285 .Fl i
286 switch, the signals numbers are shown instead of signal names.
287 .Ss Kernel Thread Stacks
288 Display kernel thread stacks for a process, allowing further interpretation
289 of thread wait channels.
290 If the
291 .Fl k
292 flag is repeated, function offsets, not just function names, are printed.
293 .Pp
294 This feature requires
295 .Cd "options STACK"
296 or
297 .Cd "options DDB"
298 to be compiled into the kernel.
299 .Pp
300 .Bl -tag -width indent -compact
301 .It PID
302 process ID
303 .It TID
304 thread ID
305 .It COMM
306 command
307 .It TDNAME
308 thread name
309 .It KSTACK
310 kernel thread call stack
311 .El
312 .Ss Security Credentials
313 Display process credential information:
314 .Pp
315 .Bl -tag -width indent -compact
316 .It PID
317 process ID
318 .It COMM
319 command
320 .It EUID
321 effective user ID
322 .It RUID
323 real user ID
324 .It SVUID
325 saved user ID
326 .It EGID
327 effective group ID
328 .It RGID
329 real group ID
330 .It SVGID
331 saved group ID
332 .It UMASK
333 file creation mode mask
334 .It FLAGS
335 credential flags
336 .It GROUPS
337 group set
338 .El
339 .Pp
340 The following credential flags may be displayed:
341 .Pp
342 .Bl -tag -width X -compact
343 .It C
344 capability mode
345 .El
346 .Ss Thread Information
347 Display per-thread information, including process ID, per-thread ID, name,
348 CPU, and execution state:
349 .Pp
350 .Bl -tag -width indent -compact
351 .It PID
352 process ID
353 .It TID
354 thread ID
355 .It COMM
356 command
357 .It TDNAME
358 thread name
359 .It CPU
360 current or most recent CPU run on
361 .It PRI
362 thread priority
363 .It STATE
364 thread state
365 .It WCHAN
366 thread wait channel
367 .El
368 .Ss Virtual Memory Mappings
369 Display process virtual memory mappings, including addresses, mapping
370 meta-data, and mapped object information:
371 .Pp
372 .Bl -tag -width indent -compact
373 .It PID
374 process ID
375 .It START
376 starting address of mapping
377 .It END
378 ending address of mapping
379 .It PRT
380 protection flags
381 .It RES
382 resident pages
383 .It PRES
384 private resident pages
385 .It REF
386 reference count
387 .It SHD
388 shadow page count
389 .It FL
390 mapping flags
391 .It TP
392 VM object type
393 .El
394 .Pp
395 The following protection flags may be displayed:
396 .Pp
397 .Bl -tag -width X -compact
398 .It r
399 read
400 .It w
401 write
402 .It x
403 execute
404 .El
405 .Pp
406 The following VM object types may be displayed:
407 .Pp
408 .Bl -tag -width XX -compact
409 .It --
410 none
411 .It dd
412 dead
413 .It df
414 default
415 .It dv
416 device
417 .It ph
418 physical
419 .It sw
420 swap
421 .It vn
422 vnode
423 .El
424 .Pp
425 The following mapping flags may be displayed:
426 .Pp
427 .Bl -tag -width X -compact
428 .It C
429 copy-on-write
430 .It N
431 needs copy
432 .It S
433 one or more superpage mappings are used
434 .El
435 .Sh EXIT STATUS
436 .Ex -std
437 .Sh SEE ALSO
438 .Xr fstat 1 ,
439 .Xr ps 1 ,
440 .Xr sockstat 1 ,
441 .Xr cap_enter 2 ,
442 .Xr cap_new 2 ,
443 .Xr ddb 4 ,
444 .Xr stack 9
445 .Sh AUTHORS
446 .An Robert N M Watson
447 .Sh BUGS
448 Some field values may include spaces, which limits the extent to which the
449 output of
450 .Nm
451 may be mechanically parsed.
452 .Pp
453 The display of open file or memory mapping pathnames is implemented using the
454 kernel's name cache.
455 If a file system does not use the name cache, or the path to a file is not in
456 the cache, a path will not be displayed.
457 .Pp
458 .Nm
459 currently supports extracting data only from a live kernel, and not from
460 kernel crash dumps.