环境 产品: AIX
平台: pSeries, AIX
软件版本:AIX 5.2
问题 pTools是AIX 5.2中引进的System V UNIX 提供的一组极有用的工具,用于查看进程相关的信息。
解答 pTools是AIX 5.2中引进的System V UNIX 提供的一组极有用的工具,用于查看进程相关的信息。包括命令:
procwdx, procfiles, procflags, proccred, procmap, procldd,
procsig, procstack, procstop, procrun, procwait, proctree
其中:
procwdx -- 显示进程的当前工作目录。如:
# procwdx 4448
4448: /var/spool/mqueue/
procfiles -- 显示该进程打开的所有文件描述字的信息。如:
# procfiles -n 4448
4448 : sendmail: accepting connections
Current rlimit: 2000 file descriptors
5: S_IFCHR mode:00 dev:10,4 ino:4237 uid:0 gid:0 rdev:2,1
procfiles : 4448 : 5 : Unable to retrieve fstat/fcntl information
4448 : sendmail: accepting connections
Current rlimit: 2000 file descriptors
7: S_IFREG mode:0444 dev:10,5 ino:80754 uid:0 gid:0 rdev:2,5020
procfiles : 4448 : 7 : Unable to retrieve fstat/fcntl information
..............................
procflags -- 显示/proc跟踪标记,包括等待和处理的信号量。如:
# procflags 4448
4448 : sendmail: accepting connections
data model = _ILP32 flags = PR_FORK
/12913: flags = PR_ASLEEP | PR_NOREGS
proccred -- 显示拥有该进程的有效及实际用户 ID,及保留的用户和组ID(setuid及setgid)。如:
# proccred 4448
4448: e/r/suid=0 e/r/sgid=0
procmap -- 显示进程地址空间。如:
# procmap 4448
4448 : sendmail: accepting connections
10000000 1005K read/exec sendmail
200003f0 241K read/write sendmail
d007f100 79K read/exec /usr/lib/libiconv.a
20252bf0 41K read/write /usr/lib/libiconv.a
d0076100 33K read/exec /usr/lib/libi18n.a
20250190 4K read/write /usr/lib/libi18n.a
d0073000 11K read/exec /usr/lib/nls/loc/en_US
2024d130 8K read/write /usr/lib/nls/loc/en_US
d0093100 71K read/exec /usr/lib/libodm.a
f0139220 21K read/write /usr/lib/libodm.a
d00be100 67K read/exec /usr/lib/libsrc.a
d01cdbe0 1941K read/exec /usr/lib/libc.a
..............
Total 5507K
procldd -- 显示加载的动态进程列表。如:
# procldd 4448
4448 : sendmail: accepting connections
/usr/lib/libiconv.a
/usr/lib/libi18n.a
/usr/lib/nls/loc/en_US
/usr/lib/libodm.a
/usr/lib/libsrc.a
/usr/lib/libc.a
procsig -- 显示进程对各种信号量的处理。如:
# procsig 4448
4448 : sendmail: accepting connections
HUP caught RESTART | SIGINFO
INT caught RESTART | SIGINFO
QUIT default RESTART
ILL default RESTART
TRAP default RESTART
ABRT default RESTART
EMT default RESTART
FPE default RESTART
KILL default
BUS default RESTART
SEGV default RESTART
SYS default RESTART
PIPE ignored RESTART | SIGINFO
ALRM caught RESTART | SIGINFO
TERM caught RESTART | SIGINFO
...........................................
UVTALRM default
MIGRATE default
PRE default RESTART
VIRT default
ALRM1 default
WAITING default RESTART
CPUFAIL default
KAP default
RETRACT default
SOUND default
SAK default
procstack -- 显示进程中当前线程的堆栈中的符号名和十六进制地址。如:
# procstack 4448
4448 : sendmail: accepting connections
d024fdf0 select (?, ?, ?, ?, ?) + 90
1000ec24 getrequests (?) + 714
1000051c main (?, ?, ?) + 29a8
10000100 __start () + 8c
procstop -- 将进程暂停。如:
procstop 51202
procrun -- 启动用procstop停止的进程。如:
procrun 51202
procwait -- 等待所指定的进程结束。如:
procwait 51202
proctree -- 显示进程调用的树型结构。如:
# proctree 4448
11452 /usr/sbin/srcmstr
4448 sendmail: accepting connections