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