2 .\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved
3 .\" Portions Copyright 2008 Chad Mynhier
4 .\" Copyright 2012 DEY Storage Systems, Inc. All rights reserved.
5 .\" Copyright 2016 Joyent, Inc.
6 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
7 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
8 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
9 .TH PROC 1 "Apr 01, 2013"
11 proc, pflags, pcred, pldd, psig, pstack, pfiles, pwdx, pstop, prun, pwait,
16 \fB/usr/bin/pflags\fR [\fB-r\fR] \fIpid\fR | \fIcore\fR [/\fIlwp\fR] ...
21 \fB/usr/bin/pcred\fR [\fIpid\fR | \fIcore\fR]...
26 \fB/usr/bin/pcred\fR [\fB-u\fR \fIuser/uid\fR] [\fB-g\fR \fIgroup/gid\fR] [\fB-G\fR \fIgrouplist\fR] pid...
31 \fB/usr/bin/pcred\fR \fB-l\fR \fIlogin\fR \fIpid\fR...
36 \fB/usr/bin/pldd\fR [\fB-Fl\fR] [\fIpid\fR | \fIcore\fR]...
41 \fB/usr/bin/psig\fR [\fB-n\fR] \fIpid\fR...
46 \fB/usr/bin/pstack\fR [\fB-F\fR] \fIpid\fR | \fIcore\fR [/\fIlwp\fR] ...
51 \fB/usr/bin/pfiles\fR [\fB-Fn\fR] \fIpid\fR | \fIcore\fR...
56 \fB/usr/bin/pwdx\fR \fIpid\fR...
61 \fB/usr/bin/pstop\fR \fIpid\fR[/\fIlwp\fR] ...
66 \fB/usr/bin/prun\fR \fIpid\fR[/\fIlwp\fR] ...
71 \fB/usr/bin/pwait\fR [\fB-v\fR] \fIpid\fR...
76 \fB/usr/bin/ptime\fR [\fB-Fm\fR] \fB-p pidlist\fR
81 \fB/usr/bin/ptime\fR [\fB-m\fR]\fIcommand\fR [\fIarg\fR]...
86 The proc tools are utilities that exercise features of \fB/proc\fR (see
87 \fBproc\fR(4)). Most of them take a list of process-ids (\fIpid\fR). The tools
88 that do take process-ids also accept \fB/proc/\fR\fInnn\fR as a process-id, so
89 the shell expansion \fB/proc/*\fR can be used to specify all processes in the
93 Some of the proc tools can also be applied to core files (see \fBcore\fR(4)).
94 The tools that apply to core files accept a list of either process \fBID\fRs or
95 names of core files or both.
98 Some of the \fBproc\fR tools can operate on individual threads. Users can
99 examine only selected threads by appending \fI/thread-id\fR to the process-id
100 or core. Multiple threads can be selected using the \fB-\fR and \fB,\fR
101 delimiters. For example \fB/1,2,7-9\fR examines threads \fB1\fR, \fB2\fR,
102 \fB7\fR, \fB8\fR, and \fB9\fR.
112 Print the \fB/proc\fR tracing flags, the pending and held signals, and other
113 \fB/proc\fR status information for each process or specified lwps in each
123 Print or set the credentials (effective, real, saved \fBUID\fRs and \fBGID\fRs)
133 List the dynamic libraries linked into each process, including shared objects
134 explicitly attached using \fBdlopen\fR(3C). See also \fBldd\fR(1).
143 List the signal actions and handlers of each process. See
144 \fBsignal.h\fR(3HEAD).
153 Print a hex+symbolic stack trace for each process or specified lwps in each
163 Report \fBfstat\fR(2) and \fBfcntl\fR(2) information for all open files in each
164 process. For network endpoints, the local (and peer if connected) address
165 information is also provided. For sockets, the socket type, socket options and
166 send and receive buffer sizes are also provided. In addition, a path to the
167 file is reported if the information is available from \fB/proc/pid/path\fR.
168 This is not necessarily the same name used to open the file. See \fBproc\fR(4)
169 for more information.
178 Print the current working directory of each process.
187 Stop each process or the specified lwps (\fBPR_REQUESTED\fR stop).
196 Set running each process or the specified lwps (the inverse of \fBpstop\fR).
205 Wait for all of the specified processes to terminate.
214 Time the \fIcommand\fR, like \fBtime\fR(1), but using microstate accounting for
215 reproducible precision. Unlike \fBtime\fR(1), children of the command are not
218 If the \fB-p\fR \fIpidlist\fR version is used, display a snapshot of timing
219 statistics for the specified processes. The \fIpidlist\fR may have a single
220 process or be a comma or space delineated list. If a space delineated list is
221 used, callers will need to ensure that it is properly quoted or escaped for
227 The following general options are supported:
234 Force. Grabs the target process even if another process has control.
243 (\fBpsig\fR and \fBpfiles\fR only) Sets non-verbose mode. \fBpsig\fR displays
244 signal handler addresses rather than names. \fBpfiles\fR does not display
245 verbose information for each file descriptor. Instead, \fBpfiles\fR limits its
246 output to the information that would be retrieved if the process applied
247 \fBfstat\fR(2) to each of its file descriptors.
256 (\fBpflags\fR only) If the process is stopped, displays its machine registers.
265 (\fBpwait\fR only) Verbose. Reports terminations to standard output.
270 In addition to the general options, \fBpcred\fR supports the following options:
274 \fB\fB-g\fR \fIgroup/gid\fR\fR
277 Sets the real, effective, and saved group ids (\fBGID\fRs) of the target
278 processes to the specified value.
284 \fB\fB-G\fR \fIgrouplist\fR\fR
287 Sets the supplementary \fBGID\fRs of the target process to the specified list
288 of groups. The supplementary groups should be specified as a comma-separated
289 list of group names ids. An empty list clears the supplementary group list of
290 the target processes.
296 \fB\fB-l\fR \fIlogin\fR\fR
299 Sets the real, effective, and saved \fBUID\fRs of the target processes to the
300 \fBUID\fR of the specified login. Sets the real, effective, and saved
301 \fBGID\fRs of the target processes to the \fBGID\fR of the specified login.
302 Sets the supplementary group list to the supplementary groups list of the
309 \fB\fB-u\fR \fIuser/uid\fR\fR
312 Sets the real, effective, and saved user ids (\fBUID\fRs) of the target
313 processes to the specified value.
318 In addition to the general options, \fBpldd\fR supports the following option:
325 Shows unresolved dynamic linker map names.
330 In addition to the general options, \fBptime\fR supports the following options:
337 Display the full set of microstate accounting statistics.
339 The displayed fields are as follows:
364 System call CPU time.
373 Other system trap CPU time.
382 Text page fault sleep time.
391 Data page fault sleep time.
400 Kernel page fault sleep time.
409 User lock wait sleep time.
418 All other sleep time.
427 CPU latency (wait) time.
444 \fB\fB-p\fR \fIpid\fR\fR
447 Displays a snapshot of timing statistics for the specified \fIpid\fR.
452 To set the credentials of another process, a process must have sufficient
453 privilege to change its user and group ids to those specified according to the
454 rules laid out in \fBsetuid\fR(2) and it must have sufficient privilege to
455 control the target process.
458 These proc tools stop their target processes while inspecting them and
459 reporting the results: \fBpfiles\fR, \fBpldd\fR, and \fBpstack\fR. A process
460 can do nothing while it is stopped. Thus, for example, if the X server is
461 inspected by one of these proc tools running in a window under the X server's
462 control, the whole window system can become deadlocked because the proc tool
463 would be attempting to print its results to a window that cannot be refreshed.
464 Logging in from from another system using \fBrlogin\fR(1) and killing the
465 offending proc tool would clear up the deadlock in this case.
471 Caution should be exercised when using the \fB-F\fR flag. Imposing two
472 controlling processes on one victim process can lead to chaos. Safety is
473 assured only if the primary controlling process, typically a debugger, has
474 stopped the victim process and the primary controlling process is doing nothing
475 at the moment of application of the \fBproc\fR tool in question.
478 Some of the proc tools can also be applied to core files, as shown by the
479 synopsis above. A core file is a snapshot of a process's state and is produced
480 by the kernel prior to terminating a process with a signal or by the
481 \fBgcore\fR(1) utility. Some of the proc tools can need to derive the name of
482 the executable corresponding to the process which dumped core or the names of
483 shared libraries associated with the process. These files are needed, for
484 example, to provide symbol table information for \fBpstack\fR(1). If the proc
485 tool in question is unable to locate the needed executable or shared library,
486 some symbol information is unavailable for display. Similarly, if a core file
487 from one operating system release is examined on a different operating system
488 release, the run-time link-editor debugging interface (\fBlibrtld_db\fR) cannot
489 be able to initialize. In this case, symbol information for shared libraries is
493 The following exit values are returned:
500 Successful operation.
509 An error has occurred.
523 See \fBattributes\fR(5) for descriptions of the following attributes:
531 ATTRIBUTE TYPE ATTRIBUTE VALUE
533 Interface Stability See below.
538 The human readable output is Uncommitted. The options are Committed.
541 \fBgcore\fR(1), \fBldd\fR(1), \fBpargs\fR(1), \fBpgrep\fR(1), \fBpkill\fR(1),
542 \fBplimit\fR(1), \fBpmap\fR(1), \fBpreap\fR(1), \fBps\fR(1), \fBptree\fR(1),
543 \fBppgsz\fR(1), \fBpwd\fR(1), \fBrlogin\fR(1), \fBtime\fR(1), \fBtruss\fR(1),
544 \fBwait\fR(1), \fBfcntl\fR(2), \fBfstat\fR(2), \fBsetuid\fR(2),
545 \fBdlopen\fR(3C), \fBsignal.h\fR(3HEAD), \fBcore\fR(4), \fBproc\fR(4),
546 \fBprocess\fR(4), \fBattributes\fR(5), \fBzones\fR(5)
549 The following \fBproc\fR tools stop their target processes while inspecting
550 them and reporting the results: \fBpfiles\fR, \fBpldd\fR, and \fBpstack\fR.
551 However, even if \fBpstack\fR operates on an individual thread, it stops the
555 A process or thread can do nothing while it is stopped. Stopping a heavily used
556 process or thread in a production environment, even for a short amount of time,
557 can cause severe bottlenecks and even hangs of these processes or threads,
558 causing them to be unavailable to users. Some databases could also terminate
559 abnormally. Thus, for example, a database server under heavy load could hang
560 when one of the database processes or threads is traced using the above
561 mentioned \fBproc\fR tools. Because of this, stopping a UNIX process or thread
562 in a production environment should be avoided.
565 A process or thread being stopped by these tools can be identified by issuing
566 \fB/usr/bin/ps\fR \fB-eflL\fR and looking for "\fBT\fR" in the first column.
567 Notice that certain processes, for example "\fBsched\fR", can show the
568 "\fBT\fR" status by default most of the time.
571 The process ID returned for locked files on network file systems might not be