ln-bes2% df
/ (/dev/md/dsk/d10 ):31004448 块 5900647 文件
/devices (/devices ): 0 块 0 文件
/system/contract (ctfs ): 0 块 2147483568 文件
/proc (proc ): 0 块 29492 文件
/etc/mnttab (mnttab ): 0 块 0 文件
/etc/svc/volatile (swap ):86623952 块 4783482 文件
/system/object (objfs ): 0 块 2147483430 文件
/dev/fd (fd ): 0 块 0 文件
/tmp (swap ):86623952 块 4783482 文件
/var/run (swap ):86623952 块 4783482 文件
/dev/vx/dmp (swap ):86623952 块 4783482 文件
/dev/vx/rdmp (swap ):86623952 块 4783482 文件
/data (/dev/md/dsk/d30 ):13171894 块 8337669 文件
/dev/odm (/dev/odm ): 0 块 0 文件
在Solaris的文件系统中,有一个/proc文件系统,一些巨大的文件放在那里,/proc文件系统不是普通意义上的文件系统,它是一个到运行中进程地址空间的访问接口。通过/proc,可以用标准Unix系统调用(比如open()、read()、write()、ioctl()等等)访问进程地址空间。事实上,Solaris ps(1)命令正是利用/proc获取进程状态。 Solaris下使用/proc的工具相当完善,位于/usr/proc/bin目录中。这些工具提供了一种访问任意指定进程临界数据的简捷办法。/proc的魅力正是在于它包含了你可能想知道的关于一个进程的任何信息。
比如:
pldd -列出进程连接的动态库
pstack -调用栈
pfiles -打开的文件描述符列表
ptree -进程关系树
了解了/proc工具的使用,就能更好的了解进程状态信息,所以,让我们花点事件看看proc(1)手册页
ln-bes2% man proc
正在重新格式化页面。请等待... 完成
User Commands proc(1)
NAME
proc, pflags, pcred, pldd, psig, pstack, pfiles, pwdx,
pstop, prun, pwait, ptime - proc tools
SYNOPSIS
/usr/bin/pflags [-r] pid | core [/lwp] ...
/usr/bin/pcred [pid | core] ...
/usr/bin/pcred [-u user/uid] [-g group/gid] [-G grouplist]
pid...
/usr/bin/pcred -l login pid...
/usr/bin/pldd [-F] [pid | core] ...
/usr/bin/psig [-n] pid ...
/usr/bin/pstack [-F] pid | core [/lwp] ...
/usr/bin/pfiles [-Fn] pid...
/usr/bin/pwdx pid...
/usr/bin/pstop pid...
/usr/bin/prun pid...
/usr/bin/pwait [-v] pid...
/usr/bin/ptime command [arg...]
The proc tools are utilities that exercise features of /proc
(see proc(4)). Most of them take a list of process-ids
(pid). The tools that do take process-ids also accept
/proc/nnn as a process-id, so the shell expansion /proc/*
can be used to specify all processes in the system.
Some of the proc tools can also be applied to core files
(see core(4)). The tools that apply to core files accept a
list of either process IDs or names of core files or both.
Some of the proc tools can operate on individual threads.
Users can examine only selected threads by appending
/thread-id to the process-id or core. Multiple threads can
be selected using the - and , delimiters. For example
/1,2,7-9 examines threads 1, 2, 7, 8, and 9.
See .
SunOS 5.10 Last change: 11 Oct 2005 1
User Commands proc(1)
pflags Print the /proc tracing flags, the pending
and held signals, and other /proc status
information for each lwp in each process.
pcred Print or set the credentials (effective,
real, saved UIDs and GIDs) of each process.
pldd List the dynamic libraries linked into each
process, including shared objects explicitly
attached using dlopen(3C). See also ldd(1).
psig List the signal actions and handlers of each
process. See signal.h(3HEAD).
pstack Print a hex+symbolic stack trace for each
lwp in each process.
pfiles Report fstat(2) and fcntl(2) information for
all open files in each process. In addition,
a path to the file is reported if the infor-
mation is available from /proc/pid/path.
This is not necessarily the same name used
to open the file. See proc(4) for more
information.
pwdx Print the current working directory of each
process.
pstop Stop each process (PR_REQUESTED stop).
prun Set each process running (inverse of pstop).
pwait Wait for all of the specified processes to
terminate.
SunOS 5.10 Last change: 11 Oct 2005 2
User Commands proc(1)
ptime Time the command, like time(1), but using
microstate accounting for reproducible pre-
cision. Unlike time(1), children of the com-
mand are not timed.
The following options are supported:
-F Force. Grabs the target process even if another
process has control.
-n (psig and pfiles only) Sets non-verbose mode. psig
displays signal handler addresses rather than