User Tools

Site Tools


proc:status_file

This is an old revision of the document!


Proc - Status file

To get the status information of a process, all you have to do is read the file /proc/PID/status:

cat /proc/self/status

returns:

Name:   cat
State:  R (running)
Tgid:   5452
Pid:    5452
PPid:   743
TracerPid:      0						(2.4)
Uid:    501     501     501     501
Gid:    100     100     100     100
FDSize: 256
Groups: 100 14 16
VmPeak:     5004 kB
VmSize:     5004 kB
VmLck:         0 kB
VmHWM:       476 kB
VmRSS:       476 kB
VmData:      156 kB
VmStk:        88 kB
VmExe:        68 kB
VmLib:      1412 kB
VmPTE:        20 kb
VmSwap:        0 kB
Threads:        1
SigQ:   0/28578
SigPnd: 0000000000000000
ShdPnd: 0000000000000000
SigBlk: 0000000000000000
SigIgn: 0000000000000000
SigCgt: 0000000000000000
CapInh: 00000000fffffeff
CapPrm: 0000000000000000
CapEff: 0000000000000000
CapBnd: ffffffffffffffff
voluntary_ctxt_switches:        0
nonvoluntary_ctxt_switches:     1

This shows you nearly the same information you would get if you viewed it with the ps command. In fact, ps uses the proc file system to obtain its information. But you get a more detailed view of the process by reading the file /proc/PID/status.

Contents of the status files (as of 2.6.30-rc7)

FieldContent
NameFilename of the executable.
StateState (R is running, S is sleeping, D is sleeping in an uninterruptible wait, Z is zombie, T is traced or stopped).
TgidThread group ID.
PidProcess id.
PPidProcess id of the parent process.
TracerPidPID of process tracing this process (0 if not).
UidReal, effective, saved set, and file system UIDs.
GidReal, effective, saved set, and file system GIDs.
FDSizeNumber of file descriptor slots currently allocated.
GroupsSupplementary group list.
VmPeakPeak virtual memory size.
VmSizeTotal program size.
VmLckLocked memory size.
VmHWMPeak resident set size (“high water mark”).
VmRSSSize of memory portions.
VmDataSize of data, stack, and text segments.
VmStkSize of data, stack, and text segments.
VmExeSize of text segment.
VmLibSize of shared library code.
VmPTESize of page table entries.
VmSwapSize of swap usage (the number of referred swapents).
ThreadsNumber of threads.
SigQNumber of signals queued/max. number for queue.
SigPndBitmap of pending signals for the thread.
ShdPndBitmap of shared pending signals for the process.
SigBlkBitmap of blocked signals.
SigIgnBitmap of ignored signals.
SigCgtBitmap of catched signals.
CapInhBitmap of inheritable capabilities.
CapPrmBitmap of permitted capabilities.
CapEffBitmap of effective capabilities.
CapBndBitmap of capabilities bounding set.
Cpus_allowedMask of CPUs on which this process may run.
Cpus_allowed_listSame as previous, but in “list format”.
Mems_allowedMask of memory nodes allowed to this process.
Mems_allowed_listSame as previous, but in “list format”.
voluntary_ctxt_switchesNumber of voluntary context switches.
nonvoluntary_ctxt_switchesNumber of non voluntary context switches.
proc/status_file.1491385631.txt.gz · Last modified: 2020/07/15 09:30 (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki