# ps
PID TTY TIME CMD
8847424 pts/0 0:00 -ksh
9437218 pts/0 0:00 ps
# find /proc/8847424
/proc/8847424
/proc/8847424/as
/proc/8847424/cred
/proc/8847424/ctl
/proc/8847424/cwd
/proc/8847424/fd
/proc/8847424/fd/0
/proc/8847424/fd/1
/proc/8847424/fd/2
/proc/8847424/fd/10
/proc/8847424/fd/63
/proc/8847424/lwp
/proc/8847424/lwp/38404245
/proc/8847424/lwp/38404245/lwpctl
/proc/8847424/lwp/38404245/lwpsinfo
/proc/8847424/lwp/38404245/lwpstatus
/proc/8847424/map
/proc/8847424/object
/proc/8847424/object/a.out
/proc/8847424/object/jfs2.10.5.487607
/proc/8847424/object/jfs2.10.5.1664
/proc/8847424/object/jfs2.10.5.4220
/proc/8847424/object/jfs2.10.5.13168
/proc/8847424/object/jfs2.10.5.339
/proc/8847424/object/jfs2.10.5.4250
/proc/8847424/psinfo
/proc/8847424/sigact
/proc/8847424/status
/proc/8847424/sysent
/proc/8847424/root
/proc/8847424/mmap
Just listing the "/proc" filesystem tree for a process does give you a good idea of what the system is doing and which resources it requires, however you need to use specialist tools such as:
Tool | Description |
procstack | Get Process Stack Trace |
procflags | Show Pending and Held Signals for Process |
procsig | Display Signal Action and Handlers for Process |
procfiles -n pid | Report stat and fcntl Info for All Open Files in Each Process |
procwdx | Display the Current Working Directory of the Process |
proctree | Display the Process Tree |
to get more information.
The "/proc" entries contain the following information:
Directory or filename | Description |
/proc/pid/as | Address space used by this process. |
/proc pid/cred | Contains a description of the credentials associated with this process. |
/proc/pid/ctl | Process control file. |
/proc/pid/cwd | A link that provides access to the current working directory of this process. Any process can access the current working directory of the process through this ink, provided it has the necessary permissions. If you run "strings" against this file it gives the same output as "ls". |
/proc/pid/fd | Contains files for all open file descriptors for this process. |
/proc/pid/map | Address space map for this process. |
/proc/pid/object | Directory for objects. |
/proc/pid/psinfo | Process status information. |
/proc/pid/sigact | Signal actions for this process. |
/proc/pid/status | Process status. |
/proc/pid/sysent | System call information for process PID. |
Thread specific files | |
/proc/pid/lwp/tid | Directory for thread. |
/proc/pid/lwp/tid/lwpctl | Control file for thread. |
/proc/pid/lwp/tid/lwpsinfo | Process status info for thread. |
/proc/pid/lwp/tid/lwpstatus | Status of thread. |
No comments:
Post a Comment