]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man5/proc.5
Changes: Ready for 3.51
[thirdparty/man-pages.git] / man5 / proc.5
CommitLineData
fea681da 1.\" Copyright (C) 1994, 1995 by Daniel Quinlan (quinlan@yggdrasil.com)
b4e9ee8f 2.\" and Copyright (C) 2002-2008 Michael Kerrisk <mtk.manpages@gmail.com>
fea681da
MK
3.\" with networking additions from Alan Cox (A.Cox@swansea.ac.uk)
4.\" and scsi additions from Michael Neuffer (neuffer@mail.uni-mainz.de)
5.\" and sysctl additions from Andries Brouwer (aeb@cwi.nl)
6.\" and System V IPC (as well as various other) additions from
c11b1abf 7.\" Michael Kerrisk <mtk.manpages@gmail.com>
fea681da 8.\"
1dd72f9c 9.\" %%%LICENSE_START(GPLv2+_DOC_FULL)
fea681da
MK
10.\" This is free documentation; you can redistribute it and/or
11.\" modify it under the terms of the GNU General Public License as
12.\" published by the Free Software Foundation; either version 2 of
13.\" the License, or (at your option) any later version.
14.\"
15.\" The GNU General Public License's references to "object code"
16.\" and "executables" are to be interpreted as the output of any
17.\" document formatting or typesetting system, including
18.\" intermediate and printed output.
19.\"
20.\" This manual is distributed in the hope that it will be useful,
21.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
22.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23.\" GNU General Public License for more details.
24.\"
25.\" You should have received a copy of the GNU General Public
c715f741
MK
26.\" License along with this manual; if not, see
27.\" <http://www.gnu.org/licenses/>.
6a8d8745 28.\" %%%LICENSE_END
fea681da
MK
29.\"
30.\" Modified 1995-05-17 by faith@cs.unc.edu
31.\" Minor changes by aeb and Marty Leisner (leisner@sdsp.mc.xerox.com).
32.\" Modified 1996-04-13, 1996-07-22 by aeb@cwi.nl
33.\" Modified 2001-12-16 by rwhron@earthlink.net
34.\" Modified 2002-07-13 by jbelton@shaw.ca
35.\" Modified 2002-07-22, 2003-05-27, 2004-04-06, 2004-05-25
c11b1abf 36.\" by Michael Kerrisk <mtk.manpages@gmail.com>
5d6d14a0
MK
37.\" 2004-11-17, mtk -- updated notes on /proc/loadavg
38.\" 2004-12-01, mtk, rtsig-max and rtsig-nr went away in 2.6.8
568105c6
MK
39.\" 2004-12-14, mtk, updated 'statm', and fixed error in order of list
40.\" 2005-05-12, mtk, updated 'stat'
6d64ca9c 41.\" 2005-07-13, mtk, added /proc/sys/fs/mqueue/*
363f747c
MK
42.\" 2005-09-16, mtk, Added /proc/sys/fs/suid_dumpable
43.\" 2005-09-19, mtk, added /proc/zoneinfo
b4e9ee8f 44.\" 2005-03-01, mtk, moved /proc/sys/fs/mqueue/* material to mq_overview.7.
69119dc7
MK
45.\" 2008-06-05, mtk, Added /proc/[pid]/oom_score, /proc/[pid]/oom_adj,
46.\" /proc/[pid]/limits, /proc/[pid]/mountinfo, /proc/[pid]/mountstats,
47.\" and /proc/[pid]/fdinfo/*.
48.\" 2008-06-19, mtk, Documented /proc/[pid]/status.
cc2d5c36 49.\" 2008-07-15, mtk, added /proc/config.gz
363f747c 50.\"
c533af9d 51.\" FIXME 2.6.13 seems to have /proc/vmcore implemented
c13182ef
MK
52.\" in the source code, but there is no option available under
53.\" 'make xconfig'; eventually this should be fixed, and then info
54.\" from the patch-2.6.13 and change log could be used to write an
c533af9d 55.\" entry in this man page.
cc2d5c36 56.\" Needs CONFIG_VMCORE
8cf9de1b 57.\"
c13182ef
MK
58.\" FIXME cross check against Documentation/filesystems/proc.txt
59.\" to see what information could be imported from that file
c533af9d 60.\" into this file.
fea681da 61.\"
18cdd0ac 62.TH PROC 5 2013-04-17 "Linux" "Linux Programmer's Manual"
fea681da 63.SH NAME
24d01c53 64proc \- process information pseudo-file system
fea681da
MK
65.SH DESCRIPTION
66The
67.I proc
24d01c53 68file system is a pseudo-file system which is used as an interface to
c13182ef
MK
69kernel data structures.
70It is commonly mounted at
fea681da 71.IR /proc .
c13182ef 72Most of it is read-only, but some files allow kernel variables to be
fea681da
MK
73changed.
74.LP
743638fd
MK
75The following outline gives a quick tour through the
76.I /proc
77hierarchy.
fea681da
MK
78.PD 1
79.TP
69119dc7 80.I /proc/[pid]
fea681da
MK
81There is a numerical subdirectory for each running process; the
82subdirectory is named by the process ID.
83Each such subdirectory contains the following
84pseudo-files and directories.
69119dc7
MK
85.\" FIXME Describe /proc/[pid]/attr and
86.\" /proc/[pid]/task/[tid]/attr
b4e9ee8f
MK
87.\" This is a directory
88.\" Added in ???
89.\" CONFIG_SECURITY
90.\"
fea681da 91.TP
69119dc7 92.IR /proc/[pid]/auxv " (since 2.6.0-test7)"
857f1942 93This contains the contents of the ELF interpreter information passed
c13182ef 94to the process at exec time.
857f1942 95The format is one \fIunsigned long\fP ID
c13182ef 96plus one \fIunsigned long\fP value for each entry.
857f1942 97The last entry contains two zeros.
b5d204d0 98.TP
8d708d6b 99.IR /proc/[pid]/cgroup " (since Linux 2.6.24)"
b5d204d0
MK
100.\" Info in Documentation/cgroups/cgroups.txt
101This file describes control groups to which the process/task belongs.
102For each cgroup hierarchy there is one entry containing
103colon-separated fields of the form:
104.nf
105.ft CW
106
107 5:cpuacct,cpu,cpuset:/daemons
108.ft
109.fi
110.IP
111The colon-separated fields are, from left to right:
112.RS 11
113.IP 1. 3
114hierarchy ID number
115.IP 2.
116set of subsystems bound to the hierarchy
117.IP 3.
118control group in the hierarchy to which the process belongs
119.RE
120.IP
90878f7c 121This file is present only if the
b5d204d0
MK
122.B CONFIG_CGROUPS
123kernel configuration option is enabled.
b4e9ee8f 124.\"
69119dc7 125.\" FIXME Describe /proc/[pid]/clear_refs
b4e9ee8f
MK
126.\" Added in 2.6.22
127.\" "Clears page referenced bits shown in smaps output"
128.\" write-only
129.\" CONFIG_PROC_PAGE_MONITOR
857f1942 130.TP
69119dc7 131.I /proc/[pid]/cmdline
b447cd58
MK
132This holds the complete command line for the process,
133unless the process is a zombie.
134.\" In 2.3.26, this also used to be true if the process was swapped out.
135In the latter case, there is nothing in this file:
75b94dc3 136that is, a read on this file will return 0 characters.
b447cd58 137The command-line arguments appear in this file as a set of
6596d270
MK
138strings separated by null bytes (\(aq\\0\(aq),
139with a further null byte after the last string.
fea681da 140.TP
69119dc7 141.IR /proc/[pid]/coredump_filter " (since kernel 2.6.23)"
b4e9ee8f
MK
142See
143.BR core (5).
5c411b17 144.TP
69119dc7
MK
145.IR /proc/[pid]/cpuset " (since kernel 2.6.12)"
146.\" and/proc/[pid]/task/[tid]/cpuset
5c411b17
MK
147See
148.BR cpuset (7).
b4e9ee8f 149.TP
69119dc7 150.I /proc/[pid]/cwd
c13182ef 151This is a symbolic link to the current working directory of the process.
59a40ed7
MK
152To find out the current working directory of process 20,
153for instance, you can do this:
fea681da 154
59a40ed7 155.in +4n
fea681da 156.nf
b43a3b30 157.RB "$" " cd /proc/20/cwd; /bin/pwd"
fea681da 158.fi
59a40ed7 159.in
fea681da 160
c13182ef
MK
161Note that the
162.I pwd
e7b489f0 163command is often a shell built-in, and might
c13182ef 164not work properly.
743638fd
MK
165In
166.BR bash (1),
167you may use
168.IR "pwd\ \-P" .
afcaf646
MK
169
170.\" The following was still true as at kernel 2.6.13
c13182ef
MK
171In a multithreaded process, the contents of this symbolic link
172are not available if the main thread has already terminated
afcaf646 173(typically by calling
59a40ed7 174.BR pthread_exit (3)).
fea681da 175.TP
69119dc7 176.I /proc/[pid]/environ
fea681da 177This file contains the environment for the process.
f81fb444 178The entries are separated by null bytes (\(aq\\0\(aq),
b4e9ee8f 179and there may be a null byte at the end.
fea681da 180Thus, to print out the environment of process 1, you would do:
a08ea57c 181.in +4n
fea681da 182.nf
a08ea57c 183
fea681da 184.ft CW
13912780 185.RB "$" " strings /proc/1/environ"
fea681da
MK
186.fi
187.ft P
a08ea57c 188.in
fea681da 189.TP
69119dc7 190.I /proc/[pid]/exe
fea681da 191Under Linux 2.2 and later, this file is a symbolic link
2d7195b8 192containing the actual pathname of the executed command.
c13182ef
MK
193This symbolic link can be dereferenced normally; attempting to open
194it will open the executable.
195You can even type
69119dc7 196.I /proc/[pid]/exe
c13182ef 197to run another copy of the same executable as is being run by
69119dc7 198process [pid].
afcaf646 199.\" The following was still true as at kernel 2.6.13
c13182ef
MK
200In a multithreaded process, the contents of this symbolic link
201are not available if the main thread has already terminated
afcaf646
MK
202(typically by calling
203.BR pthread_exit (3)).
fea681da
MK
204
205Under Linux 2.0 and earlier
69119dc7 206.I /proc/[pid]/exe
c13182ef
MK
207is a pointer to the binary which was executed,
208and appears as a symbolic link.
209A
fea681da
MK
210.BR readlink (2)
211call on this file under Linux 2.0 returns a string in the format:
212
59a40ed7 213 [device]:inode
fea681da
MK
214
215For example, [0301]:1502 would be inode 1502 on device major 03 (IDE,
216MFM, etc. drives) minor 01 (first partition on the first drive).
217
218.BR find (1)
59a40ed7
MK
219with the
220.I \-inum
221option can be used to locate the file.
fea681da 222.TP
69119dc7 223.I /proc/[pid]/fd
fea681da
MK
224This is a subdirectory containing one entry for each file which the
225process has open, named by its file descriptor, and which is a
c13182ef
MK
226symbolic link to the actual file.
227Thus, 0 is standard input, 1 standard output, 2 standard error, etc.
fea681da 228
afcaf646
MK
229.\" The following was still true as at kernel 2.6.13
230In a multithreaded process, the contents of this directory
c13182ef 231are not available if the main thread has already terminated
afcaf646
MK
232(typically by calling
233.BR pthread_exit (3)).
234
59a40ed7
MK
235Programs that will take a filename as a command-line argument,
236but will not take input from standard input if no argument is supplied,
237or that write to a file named as a command-line argument,
238but will not send their output to standard output
239if no argument is supplied, can nevertheless be made to use
240standard input or standard out using
69119dc7 241.IR /proc/[pid]/fd .
59a40ed7
MK
242For example, assuming that
243.I \-i
244is the flag designating an input file and
245.I \-o
246is the flag designating an output file:
a08ea57c 247.in +4n
fea681da
MK
248.nf
249
b43a3b30 250.RB "$" " foobar \-i /proc/self/fd/0 \-o /proc/self/fd/1 ..."
fea681da 251.fi
a08ea57c
MK
252.in
253
fea681da
MK
254and you have a working filter.
255.\" The following is not true in my tests (MTK):
256.\" Note that this will not work for
257.\" programs that seek on their files, as the files in the fd directory
258.\" are not seekable.
259
59a40ed7
MK
260.I /proc/self/fd/N
261is approximately the same as
262.I /dev/fd/N
008f1ecc 263in some UNIX and UNIX-like systems.
c13182ef 264Most Linux MAKEDEV scripts symbolically link
59a40ed7
MK
265.I /dev/fd
266to
267.IR /proc/self/fd ,
268in fact.
269
270Most systems provide symbolic links
271.IR /dev/stdin ,
272.IR /dev/stdout ,
273and
274.IR /dev/stderr ,
275which respectively link to the files
276.IR 0 ,
277.IR 1 ,
278and
279.IR 2
280in
281.IR /proc/self/fd .
282Thus the example command above could be written as:
283.in +4n
284.nf
285
b43a3b30 286.RB "$" " foobar \-i /dev/stdin \-o /dev/stdout ..."
59a40ed7
MK
287.fi
288.in
69ab425e
MK
289.\" FIXME Describe /proc/[pid]/loginuid
290.\" Added in 2.6.11; updating requires CAP_AUDIT_CONTROL
291.\" CONFIG_AUDITSYSCALL
292.TP
293.IR /proc/[pid]/fdinfo/ " (since kernel 2.6.22)"
294This is a subdirectory containing one entry for each file which the
295process has open, named by its file descriptor.
296The contents of each file can be read to obtain information
297about the corresponding file descriptor, for example:
298.in +4n
299.nf
300
301.RB "$" " cat /proc/12015/fdinfo/4"
302pos: 1000
303flags: 01002002
304.fi
305.in
306
307The
308.I pos
309field is a decimal number showing the current file offset.
310The
311.I flags
312field is an octal number that displays the
313file access mode and file status flags (see
314.BR open (2)).
315
316The files in this directory are readable only by the owner of the process.
317.\" FIXME document /proc/[pid]/io
318.\" .TP
319.\" .IR /proc/[pid]/io " (since kernel 2.6.20)"
320.TP
321.IR /proc/[pid]/limits " (since kernel 2.6.24)"
322This file displays the soft limit, hard limit, and units of measurement
323for each of the process's resource limits (see
324.BR getrlimit (2)).
325Up to and including Linux 2.6.35,
326this file is protected to allow reading only by the real UID of the process.
327Since Linux 2.6.36,
328.\" commit 3036e7b490bf7878c6dae952eec5fb87b1106589
329this file is readable by all users on the system.
b4f89985
PE
330.TP
331.IR /proc/[pid]/map_files/ " (since kernel 3.3)
18cdd0ac
MK
332.\" commit 640708a2cff7f81e246243b0073c66e6ece7e53e
333This subdirectory contains entries corresponding to memory-mapped
b4f89985
PE
334files (see
335.BR mmap (2)).
18cdd0ac
MK
336Entries are named by memory region start and end
337address pair (expressed as hexadecimal numbers),
338and are symbolic links to the mapped files themselves.
339Here is an example, with the output wrapped and reformatted to fit on an 80-column display:
b4f89985
PE
340.in +4n
341.nf
342
343.RB "$" " ls -l /proc/self/map_files/"
18cdd0ac
MK
344lr\-\-\-\-\-\-\-\-. 1 root root 64 Apr 16 21:31
345 3252e00000\-3252e20000 \-> /usr/lib64/ld-2.15.so
b4f89985
PE
346\&...
347.fi
348.in
349
350Although these entries are present for memory regions that were
18cdd0ac 351mapped with the
b4f89985 352.BR MAP_FILE
18cdd0ac 353flag, the way anonymous shared memory (regions created with the
b4f89985
PE
354.B MAP_ANON | MAP_SHARED
355flags)
356is implemented in Linux
18cdd0ac
MK
357means that such regions also appear on this directory.
358Here is an example where the target file is the deleted
359.I /dev/zero
360one:
b4f89985
PE
361.in +4n
362.nf
363
364.RB
18cdd0ac
MK
365lrw\-\-\-\-\-\-\-. 1 root root 64 Apr 16 21:33
366 7fc075d2f000\-7fc075e6f000 \-> /dev/zero (deleted)
b4f89985
PE
367.fi
368.in
369
370This directory appears only if the
371.B CONFIG_CHECKPOINT_RESTORE
372kernel configuration option is enabled.
fea681da 373.TP
69119dc7 374.I /proc/[pid]/maps
fea681da
MK
375A file containing the currently mapped memory regions and their access
376permissions.
bbf9f397
MK
377See
378.BR mmap (2)
379for some further information about memory mappings.
fea681da 380
dd0c3b96 381The format of the file is:
fea681da 382
21781757 383.in -7n
fea681da
MK
384.nf
385.ft CW
fea681da 386.ft
21781757
MK
387.I "address perms offset dev inode pathname"
38800400000-00452000 r-xp 00000000 08:02 173521 /usr/bin/dbus-daemon
38900651000-00652000 r--p 00051000 08:02 173521 /usr/bin/dbus-daemon
39000652000-00655000 rw-p 00052000 08:02 173521 /usr/bin/dbus-daemon
39100e03000-00e24000 rw-p 00000000 00:00 0 [heap]
39200e24000-011f7000 rw-p 00000000 00:00 0 [heap]
182090db 393\&...
21781757
MK
39435b1800000-35b1820000 r-xp 00000000 08:02 135522 /usr/lib64/ld-2.15.so
39535b1a1f000-35b1a20000 r--p 0001f000 08:02 135522 /usr/lib64/ld-2.15.so
39635b1a20000-35b1a21000 rw-p 00020000 08:02 135522 /usr/lib64/ld-2.15.so
39735b1a21000-35b1a22000 rw-p 00000000 00:00 0
39835b1c00000-35b1dac000 r-xp 00000000 08:02 135870 /usr/lib64/libc-2.15.so
39935b1dac000-35b1fac000 ---p 001ac000 08:02 135870 /usr/lib64/libc-2.15.so
40035b1fac000-35b1fb0000 r--p 001ac000 08:02 135870 /usr/lib64/libc-2.15.so
40135b1fb0000-35b1fb2000 rw-p 001b0000 08:02 135870 /usr/lib64/libc-2.15.so
182090db 402\&...
21781757 403f2c6ff8c000-7f2c7078c000 rw-p 00000000 00:00 0 [stack:986]
182090db 404\&...
21781757
MK
4057fffb2c0d000-7fffb2c2e000 rw-p 00000000 00:00 0 [stack]
4067fffb2d48000-7fffb2d49000 r-xp 00000000 00:00 0 [vdso]
fea681da 407.fi
21781757 408.in
fea681da 409
3eb8c588
MK
410The
411.I address
412field is the address space in the process that the mapping occupies.
413The
414.I perms
415field is a set of permissions:
fea681da
MK
416
417.nf
418.in +5
419r = read
420w = write
421x = execute
422s = shared
423p = private (copy on write)
424.fi
425.in
426
3eb8c588
MK
427The
428.I offset
b844cf04 429field is the offset into the file/whatever;
3eb8c588
MK
430.I dev
431is the device
dd0c3b96 432(major:minor);
3eb8c588
MK
433.I inode
434is the inode on that device.
59a40ed7 4350 indicates that no inode is associated with the memory region,
16e64bae 436as would be the case with BSS (uninitialized data).
fea681da 437
3eb8c588
MK
438The
439.I pathname
440field will usually be the file that is backing the mapping.
491ea6f1 441For ELF files,
3eb8c588
MK
442you can easily coordinate with the
443.I offset
444field by looking at the
491ea6f1
MK
445Offset field in the ELF program headers
446.RI ( "readelf\ \-l" ).
37d32c38 447
491ea6f1 448There are additional helpful pseudo-paths:
61b0b1f4
MK
449.RS 12
450.TP
451.IR [stack]
16e64bae 452The initial process's (also known as the main thread's) stack.
61b0b1f4 453.TP
3eb8c588 454.IR [stack:<tid>] " (since Linux 3.4)"
a60894c5 455.\" commit b76437579d1344b612cf1851ae610c636cec7db0
61b0b1f4 456A thread's stack (where the
3eb8c588 457.IR <tid>
61b0b1f4 458is a thread ID).
491ea6f1 459It corresponds to the
3eb8c588 460.IR /proc/[pid]/task/[tid]/
37d32c38 461path.
61b0b1f4
MK
462.TP
463.IR [vdso]
464The virtual dynamically linked shared object.
465.TP
466.IR [heap]
467The process's heap.
468.in
469.fi
470.RE
471.IP
3eb8c588
MK
472If the
473.I pathname
474field is blank,
491ea6f1 475this is an anonymous mapping as obtained via the
37d32c38 476.BR mmap (2)
491ea6f1 477function.
61b0b1f4
MK
478There is no easy way to coordinate this back to a process's source,
479short of running it through
491ea6f1
MK
480.BR gdb (1),
481.BR strace (1),
482or similar.
37d32c38 483
fea681da
MK
484Under Linux 2.0 there is no field giving pathname.
485.TP
69119dc7 486.I /proc/[pid]/mem
fea681da
MK
487This file can be used to access the pages of a process's memory through
488.BR open (2),
489.BR read (2),
490and
ccb2bb0d 491.BR lseek (2).
b4e9ee8f 492.TP
69119dc7 493.IR /proc/[pid]/mountinfo " (since Linux 2.6.26)"
b4e9ee8f
MK
494.\" This info adapted from Documentation/filesystems/proc.txt
495This file contains information about mount points.
496It contains lines of the form:
497.nf
498.ft CW
b4e9ee8f
MK
499
50036 35 98:0 /mnt1 /mnt2 rw,noatime master:1 - ext3 /dev/root rw,errors=continue
501(1)(2)(3) (4) (5) (6) (7) (8) (9) (10) (11)
b4e9ee8f
MK
502.ft
503.fi
504.IP
505The numbers in parentheses are labels for the descriptions below:
3bc960c2 506.RS 7
b4e9ee8f
MK
507.TP 5
508(1)
509mount ID: unique identifier of the mount (may be reused after
510.BR umount (2)).
511.TP
512(2)
513parent ID: ID of parent mount (or of self for the top of the mount tree).
514.TP
515(3)
516major:minor: value of
517.I st_dev
518for files on file system (see
519.BR stat (2)).
520.TP
521(4)
522root: root of the mount within the file system.
523.TP
524(5)
525mount point: mount point relative to the process's root.
526.TP
527(6)
528mount options: per-mount options.
529.TP
530(7)
531optional fields: zero or more fields of the form "tag[:value]".
532.TP
533(8)
534separator: marks the end of the optional fields.
535.TP
536(9)
537file system type: name of file system in the form "type[.subtype]".
538.TP
539(10)
540mount source: file system-specific information or "none".
541.TP
542(11)
543super options: per-super block options.
544.RE
545.IP
546Parsers should ignore all unrecognized optional fields.
547Currently the possible optional fields are:
548.RS 12
549.TP 18
550shared:X
551mount is shared in peer group X
552.TP
553master:X
554mount is slave to peer group X
555.TP
556propagate_from:X
557mount is slave and receives propagation from peer group X (*)
558.TP
559unbindable
560mount is unbindable
561.RE
562.IP
563(*) X is the closest dominant peer group under the process's root.
564If X is the immediate master of the mount,
565or if there is no dominant peer group under the same root,
566then only the "master:X" field is present
567and not the "propagate_from:X" field.
568
569For more information on mount propagation see:
570.I Documentation/filesystems/sharedsubtree.txt
66a9882e 571in the Linux kernel source tree.
b4e9ee8f 572.TP
cea61382
MK
573.IR /proc/[pid]/mounts " (since Linux 2.4.19)"
574This is a list of all the file systems currently mounted in the
732e54dd 575process's mount namespace.
cea61382
MK
576The format of this file is documented in
577.BR fstab (5).
578Since kernel version 2.6.15, this file is pollable:
579after opening the file for reading, a change in this file
580(i.e., a file system mount or unmount) causes
581.BR select (2)
582to mark the file descriptor as readable, and
583.BR poll (2)
584and
585.BR epoll_wait (2)
586mark the file as having an error condition.
587.TP
69119dc7 588.IR /proc/[pid]/mountstats " (since Linux 2.6.17)"
783a6233 589This file exports information (statistics, configuration information)
b4e9ee8f
MK
590about the mount points in the process's name space.
591Lines in this file have the form:
592.nf
593
594device /dev/sda7 mounted on /home with fstype ext3 [statistics]
595( 1 ) ( 2 ) (3 ) (4)
596.fi
597.IP
598The fields in each line are:
3bc960c2 599.RS 7
b4e9ee8f
MK
600.TP 5
601(1)
602The name of the mounted device
603(or "nodevice" if there is no corresponding device).
604.TP
605(2)
606The mount point within the file system tree.
607.TP
608(3)
609The file system type.
610.TP
611(4)
612Optional statistics and configuration information.
613Currently (as at Linux 2.6.26), only NFS file systems export
614information via this field.
615.RE
616.IP
90878f7c 617This file is readable only by the owner of the process.
b4e9ee8f 618.TP
b4a185e5 619.IR /proc/[pid]/ns/ " (since Linux 3.0)"
2c4201f0 620.\" See commit 6b4e306aa3dc94a0545eb9279475b1ab6209a31f
b4a185e5
EB
621This is a subdirectory containing one entry for each namespace that
622supports being manipulated by
80e63655
MK
623.BR setns (2).
624For information about namespaces, see
625.BR clone (2).
b4a185e5
EB
626.TP
627.IR /proc/[pid]/ns/ipc " (since Linux 3.0)"
80e63655
MK
628Bind mounting this file (see
629.BR mount (2))
630to somewhere else in the filesystem keeps
c409c4ff 631the IPC namespace of the process specified by
b4a185e5 632.I pid
80e63655 633alive even if all processes currently in the namespace terminate.
b4a185e5 634
80e63655 635Opening this file returns a file handle for the IPC namespace
b4a185e5 636of the process specified by
80e63655
MK
637.IR pid .
638As long as this file descriptor remains open,
639the IPC namespace will remain alive,
640even if all processes in the namespace terminate.
641The file descriptor can be passed to
642.BR setns (2).
b4a185e5
EB
643.TP
644.IR /proc/[pid]/ns/net " (since Linux 3.0)"
80e63655
MK
645Bind mounting this file (see
646.BR mount (2))
647to somewhere else in the filesystem keeps
c409c4ff 648the network namespace of the process specified by
b4a185e5 649.I pid
80e63655 650alive even if all processes in the namespace terminate.
b4a185e5 651
80e63655 652Opening this file returns a file handle for the network namespace
b4a185e5 653of the process specified by
80e63655
MK
654.IR pid .
655As long as this file descriptor remains open,
656the network namespace will remain alive,
657even if all processes in the namespace terminate.
658The file descriptor can be passed to
659.BR setns (2).
b4a185e5
EB
660.TP
661.IR /proc/[pid]/ns/uts " (since Linux 3.0)"
80e63655
MK
662Bind mounting this file (see
663.BR mount (2))
664to somewhere else in the filesystem keeps
c409c4ff 665the UTS namespace of the process specified by
b4a185e5 666.I pid
80e63655 667alive even if all processes currently in the namespace terminate.
b4a185e5 668
80e63655 669Opening this file returns a file handle for the UTS namespace
b4a185e5 670of the process specified by
80e63655
MK
671.IR pid .
672As long as this file descriptor remains open,
673the UTS namespace will remain alive,
674even if all processes in the namespace terminate.
675The file descriptor can be passed to
676.BR setns (2).
b4a185e5 677.TP
69119dc7 678.IR /proc/[pid]/numa_maps " (since Linux 2.6.14)"
610f75cc
MK
679See
680.BR numa (7).
7388733a 681.TP
69119dc7 682.IR /proc/[pid]/oom_adj " (since Linux 2.6.11)"
b4e9ee8f 683This file can be used to adjust the score used to select which process
0425de01 684should be killed in an out-of-memory (OOM) situation.
b4e9ee8f
MK
685The kernel uses this value for a bit-shift operation of the process's
686.IR oom_score
687value:
5b8dbfd4
MK
688valid values are in the range \-16 to +15,
689plus the special value \-17,
b4e9ee8f
MK
690which disables OOM-killing altogether for this process.
691A positive score increases the likelihood of this
692process being killed by the OOM-killer;
693a negative score decreases the likelihood.
de8e9cc1 694.IP
b4e9ee8f
MK
695The default value for this file is 0;
696a new process inherits its parent's
697.I oom_adj
698setting.
699A process must be privileged
700.RB ( CAP_SYS_RESOURCE )
701to update this file.
f2c8b197
MK
702.IP
703Since Linux 2.6.36, use of this file is deprecated in favor of
704.IR /proc/[pid]/oom_score_adj .
b4e9ee8f 705.TP
69119dc7 706.IR /proc/[pid]/oom_score " (since Linux 2.6.11)"
b4e9ee8f
MK
707.\" See mm/oom_kill.c::badness() in the 2.6.25 sources
708This file displays the current score that the kernel gives to
709this process for the purpose of selecting a process
710for the OOM-killer.
711A higher score means that the process is more likely to be
712selected by the OOM-killer.
713The basis for this score is the amount of memory used by the process,
714with increases (+) or decreases (\-) for factors including:
715.\" See mm/oom_kill.c::badness() in the 2.6.25 sources
716.RS
717.IP * 2
718whether the process creates a lot of children using
719.BR fork (2)
720(+);
721.IP *
722whether the process has been running a long time,
723or has used a lot of CPU time (\-);
724.IP *
725whether the process has a low nice value (i.e., > 0) (+);
726.IP *
727whether the process is privileged (\-); and
728.\" More precisely, if it has CAP_SYS_ADMIN or CAP_SYS_RESOURCE
729.IP *
730whether the process is making direct hardware access (\-).
731.\" More precisely, if it has CAP_SYS_RAWIO
732.RE
733.IP
734The
735.I oom_score
f2c8b197
MK
736also reflects the adjustment specified by the
737.I oom_score_adj
738or
b4e9ee8f
MK
739.I oom_adj
740setting for the process.
f2c8b197
MK
741.TP
742.IR /proc/[pid]/oom_score_adj " (since Linux 2.6.36)"
743.\" Text taken from 3.7 Documentation/filesystems/proc.txt
744This file can be used to adjust the badness heuristic used to select which
745process gets killed in out-of-memory conditions.
746
747The badness heuristic assigns a value to each candidate task ranging from 0
748(never kill) to 1000 (always kill) to determine which process is targeted.
749The units are roughly a proportion along that range of
750allowed memory the process may allocate from,
751based on an estimation of its current memory and swap use.
752For example, if a task is using all allowed memory,
753its badness score will be 1000.
754If it is using half of its allowed memory, its score will be 500.
755
756There is an additional factor included in the badness score: root
757processes are given 3% extra memory over other tasks.
758
759The amount of "allowed" memory depends on the context
0633f951 760in which the OOM-killer was called.
f2c8b197
MK
761If it is due to the memory assigned to the allocating task's cpuset
762being exhausted,
763the allowed memory represents the set of mems assigned to that
764cpuset (see
765.BR cpuset (7)).
766If it is due to a mempolicy's node(s) being exhausted,
767the allowed memory represents the set of mempolicy nodes.
768If it is due to a memory limit (or swap limit) being reached,
769the allowed memory is that configured limit.
770Finally, if it is due to the entire system being out of memory, the
771allowed memory represents all allocatable resources.
772
773The value of
0633f951 774.I oom_score_adj
f2c8b197
MK
775is added to the badness score before it
776is used to determine which task to kill.
777Acceptable values range from \-1000
778(OOM_SCORE_ADJ_MIN) to +1000 (OOM_SCORE_ADJ_MAX).
0633f951 779This allows user space to control the preference for OOM-killing,
f2c8b197 780ranging from always preferring a certain
0633f951 781task or completely disabling it from OOM-killing.
f2c8b197 782The lowest possible value, \-1000, is
0633f951 783equivalent to disabling OOM-killing entirely for that task,
f2c8b197
MK
784since it will always report a badness score of 0.
785
786Consequently, it is very simple for user space to define
787the amount of memory to consider for each task.
788Setting a
789.I oom_score_adj
790value of +500, for example,
791is roughly equivalent to allowing the remainder of tasks sharing the
792same system, cpuset, mempolicy, or memory controller resources
793to use at least 50% more memory.
794A value of \-500, on the other hand, would be roughly
795equivalent to discounting 50% of the task's
796allowed memory from being considered as scoring against the task.
797
0633f951 798For backward compatibility with previous kernels,
f2c8b197
MK
799.I /proc/[pid]/oom_adj
800can still be used to tune the badness score.
801Its value is
9f1b9726 802scaled linearly with
f2c8b197
MK
803.IR oom_score_adj .
804
805Writing to
806.IR /proc/[pid]/oom_score_adj
807or
808.IR /proc/[pid]/oom_adj
809will change the other with its scaled value.
69119dc7 810.\" FIXME Describe /proc/[pid]/pagemap
b4e9ee8f
MK
811.\" Added in 2.6.25
812.\" CONFIG_PROC_PAGE_MONITOR
fea681da 813.TP
69119dc7 814.I /proc/[pid]/root
008f1ecc 815UNIX and Linux support the idea of a per-process root of the
24d01c53 816file system, set by the
fea681da 817.BR chroot (2)
c13182ef
MK
818system call.
819This file is a symbolic link that points to the process's
fea681da 820root directory, and behaves as exe, fd/*, etc. do.
afcaf646
MK
821
822.\" The following was still true as at kernel 2.6.13
c13182ef
MK
823In a multithreaded process, the contents of this symbolic link
824are not available if the main thread has already terminated
afcaf646
MK
825(typically by calling
826.BR pthread_exit (3)).
69119dc7 827.\" FIXME Describe /proc/[pid]/seccomp
6aefb6df 828.\" Added in 2.6.12
69119dc7 829.\" FIXME Describe /proc/[pid]/sessionid
b4e9ee8f
MK
830.\" Added in 2.6.25; read-only; only readable by real UID
831.\" CONFIG_AUDITSYSCALL
69119dc7 832.\" FIXME Describe /proc/[pid]/sched
b4e9ee8f
MK
833.\" Added in 2.6.23
834.\" CONFIG_SCHED_DEBUG, and additional fields if CONFIG_SCHEDSTATS
835.\" Displays various scheduling parameters
836.\" This file can be written, to reset stats
69119dc7
MK
837.\" FIXME Describe /proc/[pid]/schedstats and
838.\" /proc/[pid]/task/[tid]/schedstats
b4e9ee8f
MK
839.\" Added in 2.6.9
840.\" CONFIG_SCHEDSTATS
fea681da 841.TP
69119dc7 842.IR /proc/[pid]/smaps " (since Linux 2.6.14)"
b4e9ee8f 843.\" CONFIG_PROC_PAGE_MONITOR
b07b19c4 844This file shows memory consumption for each of the process's mappings.
59a40ed7 845For each of mappings there is a series of lines such as the following:
a08ea57c 846.in +4n
b07b19c4
MK
847.nf
848
84908048000-080bc000 r-xp 00000000 03:02 13130 /bin/bash
850Size: 464 kB
851Rss: 424 kB
852Shared_Clean: 424 kB
853Shared_Dirty: 0 kB
854Private_Clean: 0 kB
855Private_Dirty: 0 kB
856
857.fi
a08ea57c 858.in
b07b19c4
MK
859The first of these lines shows the same information as is displayed
860for the mapping in
69119dc7 861.IR /proc/[pid]/maps .
b07b19c4
MK
862The remaining lines show the size of the mapping,
863the amount of the mapping that is currently resident in RAM,
c7ce200d
VN
864the number of clean and dirty shared pages in the mapping,
865and the number of clean and dirty private pages in the mapping.
b07b19c4 866
90878f7c 867This file is present only if the
097585ed
MK
868.B CONFIG_MMU
869kernel configuration
b07b19c4
MK
870option is enabled.
871.TP
69119dc7 872.I /proc/[pid]/stat
c13182ef
MK
873Status information about the process.
874This is used by
875.BR ps (1).
876It is defined in
fea681da
MK
877.IR /usr/src/linux/fs/proc/array.c "."
878
879The fields, in order, with their proper
880.BR scanf (3)
881format specifiers, are:
882.RS
59a40ed7 883.TP 12
fea681da 884\fIpid\fP %d
aa610245 885(1) The process ID.
fea681da
MK
886.TP
887\fIcomm\fP %s
aa610245 888(2) The filename of the executable, in parentheses.
c13182ef 889This is visible whether or not the executable is swapped out.
fea681da
MK
890.TP
891\fIstate\fP %c
aa610245 892(3) One character from the string "RSDZTW" where R is running, S is
fea681da
MK
893sleeping in an interruptible wait, D is waiting in uninterruptible
894disk sleep, Z is zombie, T is traced or stopped (on a signal),
895and W is paging.
896.TP
897\fIppid\fP %d
aa610245 898(4) The PID of the parent.
fea681da
MK
899.TP
900\fIpgrp\fP %d
aa610245 901(5) The process group ID of the process.
fea681da
MK
902.TP
903\fIsession\fP %d
aa610245 904(6) The session ID of the process.
fea681da 905.TP
fea681da 906\fItty_nr\fP %d
aa610245 907(7) The controlling terminal of the process.
59a40ed7
MK
908(The minor device number is contained in the combination of bits
90931 to 20 and 7 to 0;
b97deb97 910the major device number is in bits 15 to 8.)
fea681da
MK
911.TP
912\fItpgid\fP %d
913.\" This field and following, up to and including wchan added 0.99.1
aa610245 914(8) The ID of the foreground process group of the controlling
59a40ed7 915terminal of the process.
fea681da 916.TP
2ebfeb1b 917\fIflags\fP %u (%lu before Linux 2.6.22)
aa610245 918(9) The kernel flags word of the process.
c13182ef 919For bit meanings,
66a9882e 920see the PF_* defines in the Linux kernel source file
00702acc 921.IR include/linux/sched.h .
fea681da
MK
922Details depend on the kernel version.
923.TP
924\fIminflt\fP %lu
aa610245 925(10) The number of minor faults the process has made which have not
fea681da
MK
926required loading a memory page from disk.
927.TP
59a40ed7 928.\" field 11
fea681da 929\fIcminflt\fP %lu
aa610245 930(11) The number of minor faults that the process's
fea681da
MK
931waited-for children have made.
932.TP
933\fImajflt\fP %lu
aa610245 934(12) The number of major faults the process has made which have
fea681da
MK
935required loading a memory page from disk.
936.TP
937\fIcmajflt\fP %lu
aa610245 938(13) The number of major faults that the process's
fea681da
MK
939waited-for children have made.
940.TP
941\fIutime\fP %lu
aa610245 942(14) Amount of time that this process has been scheduled in user mode,
7a017e24 943measured in clock ticks (divide by
67914165 944.IR sysconf(_SC_CLK_TCK) ).
a1c9dc59
MK
945This includes guest time, \fIguest_time\fP
946(time spent running a virtual CPU, see below),
947so that applications that are not aware of the guest time field
948do not lose that time from their calculations.
fea681da
MK
949.TP
950\fIstime\fP %lu
aa610245 951(15) Amount of time that this process has been scheduled in kernel mode,
7a017e24 952measured in clock ticks (divide by
67914165 953.IR sysconf(_SC_CLK_TCK) ).
fea681da
MK
954.TP
955\fIcutime\fP %ld
aa610245 956(16) Amount of time that this process's
7a017e24
MK
957waited-for children have been scheduled in user mode,
958measured in clock ticks (divide by
67914165 959.IR sysconf(_SC_CLK_TCK) ).
c13182ef 960(See also
fea681da 961.BR times (2).)
a1c9dc59
MK
962This includes guest time, \fIcguest_time\fP
963(time spent running a virtual CPU, see below).
fea681da
MK
964.TP
965\fIcstime\fP %ld
aa610245 966(17) Amount of time that this process's
7a017e24
MK
967waited-for children have been scheduled in kernel mode,
968measured in clock ticks (divide by
67914165 969.IR sysconf(_SC_CLK_TCK) ).
fea681da
MK
970.TP
971\fIpriority\fP %ld
aa610245 972(18) (Explanation for Linux 2.6)
59a40ed7
MK
973For processes running a real-time scheduling policy
974.RI ( policy
975below; see
976.BR sched_setscheduler (2)),
977this is the negated scheduling priority, minus one;
978that is, a number in the range \-2 to \-100,
979corresponding to real-time priorities 1 to 99.
980For processes running under a non-real-time scheduling policy,
981this is the raw nice value
982.RB ( setpriority (2))
983as represented in the kernel.
984The kernel stores nice values as numbers
985in the range 0 (high) to 39 (low),
986corresponding to the user-visible nice range of \-20 to 19.
987
988Before Linux 2.6, this was a scaled value based on
989the scheduler weighting given to this process.
990.\" And back in kernel 1.2 days things were different again.
fea681da
MK
991.TP
992\fInice\fP %ld
aa610245 993(19) The nice value (see
59a40ed7
MK
994.BR setpriority (2)),
995a value in the range 19 (low priority) to \-20 (high priority).
996.\" Back in kernel 1.2 days things were different.
fea681da
MK
997.\" .TP
998.\" \fIcounter\fP %ld
999.\" The current maximum size in jiffies of the process's next timeslice,
1000.\" or what is currently left of its current timeslice, if it is the
1001.\" currently running process.
1002.\" .TP
1003.\" \fItimeout\fP %u
1004.\" The time in jiffies of the process's next timeout.
0e94f77b 1005.\" timeout was removed sometime around 2.1/2.2
aa610245 1006.TP
0e94f77b 1007\fInum_threads\fP %ld
aa610245 1008(20) Number of threads in this process (since Linux 2.6).
bb83d1b9 1009Before kernel 2.6, this field was hard coded to 0 as a placeholder
0e94f77b 1010for an earlier removed field.
fea681da 1011.TP
59a40ed7 1012.\" field 21
fea681da 1013\fIitrealvalue\fP %ld
aa610245 1014(21) The time in jiffies before the next
8bd58774
MK
1015.B SIGALRM
1016is sent to the process due to an interval timer.
0e94f77b
MK
1017Since kernel 2.6.17, this field is no longer maintained,
1018and is hard coded as 0.
fea681da 1019.TP
0e94f77b 1020\fIstarttime\fP %llu (was %lu before Linux 2.6)
aa610245 1021(22) The time the process started after system boot.
055024ed
MK
1022In kernels before Linux 2.6, this value was expressed in jiffies.
1023Since Linux 2.6, the value is expressed in clock ticks (divide by
1024.IR sysconf(_SC_CLK_TCK) ).
fea681da
MK
1025.TP
1026\fIvsize\fP %lu
aa610245 1027(23) Virtual memory size in bytes.
fea681da
MK
1028.TP
1029\fIrss\fP %ld
aa610245 1030(24) Resident Set Size: number of pages the process has in real memory.
c13182ef 1031This is just the pages which
5fab2e7c 1032count toward text, data, or stack space.
c13182ef 1033This does not include pages
fea681da
MK
1034which have not been demand-loaded in, or which are swapped out.
1035.TP
59a40ed7 1036\fIrsslim\fP %lu
aa610245 1037(25) Current soft limit in bytes on the rss of the process;
59a40ed7
MK
1038see the description of
1039.B RLIMIT_RSS
1040in
2b5407af 1041.BR getrlimit (2).
fea681da
MK
1042.TP
1043\fIstartcode\fP %lu
aa610245 1044(26) The address above which program text can run.
fea681da
MK
1045.TP
1046\fIendcode\fP %lu
aa610245 1047(27) The address below which program text can run.
fea681da
MK
1048.TP
1049\fIstartstack\fP %lu
aa610245 1050(28) The address of the start (i.e., bottom) of the stack.
fea681da
MK
1051.TP
1052\fIkstkesp\fP %lu
aa610245 1053(29) The current value of ESP (stack pointer), as found in the
fea681da
MK
1054kernel stack page for the process.
1055.TP
1056\fIkstkeip\fP %lu
aa610245 1057(30) The current EIP (instruction pointer).
fea681da 1058.TP
59a40ed7 1059.\" field 31
fea681da 1060\fIsignal\fP %lu
aa610245 1061(31) The bitmap of pending signals, displayed as a decimal number.
59a40ed7 1062Obsolete, because it does not provide information on real-time signals; use
69119dc7 1063.I /proc/[pid]/status
59a40ed7 1064instead.
fea681da
MK
1065.TP
1066\fIblocked\fP %lu
aa610245 1067(32) The bitmap of blocked signals, displayed as a decimal number.
59a40ed7 1068Obsolete, because it does not provide information on real-time signals; use
69119dc7 1069.I /proc/[pid]/status
59a40ed7 1070instead.
fea681da
MK
1071.TP
1072\fIsigignore\fP %lu
aa610245 1073(33) The bitmap of ignored signals, displayed as a decimal number.
59a40ed7 1074Obsolete, because it does not provide information on real-time signals; use
69119dc7 1075.I /proc/[pid]/status
59a40ed7 1076instead.
fea681da
MK
1077.TP
1078\fIsigcatch\fP %lu
aa610245 1079(34) The bitmap of caught signals, displayed as a decimal number.
59a40ed7 1080Obsolete, because it does not provide information on real-time signals; use
69119dc7 1081.I /proc/[pid]/status
59a40ed7 1082instead.
fea681da
MK
1083.TP
1084\fIwchan\fP %lu
aa610245 1085(35) This is the "channel" in which the process is waiting.
c13182ef 1086It is the
fea681da 1087address of a system call, and can be looked up in a namelist if you
c13182ef 1088need a textual name.
9a67332e
MK
1089(If you have an up-to-date
1090.IR /etc/psdatabase ,
1091then
4d9b6984 1092try \fIps \-l\fP to see the WCHAN field in action.)
fea681da
MK
1093.TP
1094\fInswap\fP %lu
0633f951
DP
1095(36)
1096.\" nswap was added in 2.0
4d9b6984 1097Number of pages swapped (not maintained).
fea681da
MK
1098.TP
1099\fIcnswap\fP %lu
0633f951
DP
1100(37)
1101.\" cnswap was added in 2.0
4d9b6984 1102Cumulative \fInswap\fP for child processes (not maintained).
fea681da 1103.TP
2ebfeb1b 1104\fIexit_signal\fP %d (since Linux 2.1.22)
aa610245 1105(38) Signal to be sent to parent when we die.
fea681da 1106.TP
2ebfeb1b 1107\fIprocessor\fP %d (since Linux 2.2.8)
aa610245 1108(39) CPU number last executed on.
568105c6 1109.TP
2ebfeb1b 1110\fIrt_priority\fP %u (since Linux 2.5.19; was %lu before Linux 2.6.22)
aa610245 1111(40) Real-time scheduling priority, a number in the range 1 to 99 for
59a40ed7
MK
1112processes scheduled under a real-time policy,
1113or 0, for non-real-time processes (see
568105c6
MK
1114.BR sched_setscheduler (2)).
1115.TP
59a40ed7 1116.\" field 41
2ebfeb1b 1117\fIpolicy\fP %u (since Linux 2.5.19; was %lu before Linux 2.6.22)
aa610245 1118(41) Scheduling policy (see
568105c6 1119.BR sched_setscheduler (2)).
cd60dedd 1120Decode using the SCHED_* constants in
59a40ed7 1121.IR linux/sched.h .
167450d6 1122.TP
2ebfeb1b 1123\fIdelayacct_blkio_ticks\fP %llu (since Linux 2.6.18)
aa610245 1124(42) Aggregated block I/O delays, measured in clock ticks (centiseconds).
14c06953
MK
1125.TP
1126\fIguest_time\fP %lu (since Linux 2.6.24)
aa610245 1127(43) Guest time of the process (time spent running a virtual CPU
7a017e24 1128for a guest operating system), measured in clock ticks (divide by
67914165 1129.IR sysconf(_SC_CLK_TCK) ).
14c06953
MK
1130.TP
1131\fIcguest_time\fP %ld (since Linux 2.6.24)
aa610245 1132(44) Guest time of the process's children, measured in clock ticks (divide by
67914165 1133.IR sysconf(_SC_CLK_TCK) ).
fea681da
MK
1134.RE
1135.TP
69119dc7 1136.I /proc/[pid]/statm
59a40ed7 1137Provides information about memory usage, measured in pages.
c13182ef 1138The columns are:
a08ea57c
MK
1139.in +4n
1140.nf
1141
cb42fb56 1142size (1) total program size
69119dc7 1143 (same as VmSize in \fI/proc/[pid]/status\fP)
cb42fb56 1144resident (2) resident set size
69119dc7 1145 (same as VmRSS in \fI/proc/[pid]/status\fP)
cb42fb56
MK
1146share (3) shared pages (i.e., backed by a file)
1147text (4) text (code)
59a40ed7 1148.\" (not including libs; broken, includes data segment)
cb42fb56
MK
1149lib (5) library (unused in Linux 2.6)
1150data (6) data + stack
59a40ed7 1151.\" (including libs; broken, includes library text)
cb42fb56 1152dt (7) dirty pages (unused in Linux 2.6)
a08ea57c
MK
1153.fi
1154.in
fea681da 1155.TP
69119dc7 1156.I /proc/[pid]/status
fea681da 1157Provides much of the information in
69119dc7 1158.I /proc/[pid]/stat
fea681da 1159and
69119dc7 1160.I /proc/[pid]/statm
fea681da 1161in a format that's easier for humans to parse.
16b5f7ba
MK
1162Here's an example:
1163.in +4n
1164.nf
1165
b43a3b30 1166.RB "$" " cat /proc/$$/status"
16b5f7ba
MK
1167Name: bash
1168State: S (sleeping)
1169Tgid: 3515
1170Pid: 3515
1171PPid: 3452
1172TracerPid: 0
1173Uid: 1000 1000 1000 1000
1174Gid: 100 100 100 100
1175FDSize: 256
1176Groups: 16 33 100
1177VmPeak: 9136 kB
1178VmSize: 7896 kB
1179VmLck: 0 kB
1180VmHWM: 7572 kB
1181VmRSS: 6316 kB
1182VmData: 5224 kB
1183VmStk: 88 kB
1184VmExe: 572 kB
1185VmLib: 1708 kB
1186VmPTE: 20 kB
1187Threads: 1
1188SigQ: 0/3067
1189SigPnd: 0000000000000000
1190ShdPnd: 0000000000000000
1191SigBlk: 0000000000010000
1192SigIgn: 0000000000384004
1193SigCgt: 000000004b813efb
1194CapInh: 0000000000000000
1195CapPrm: 0000000000000000
1196CapEff: 0000000000000000
1197CapBnd: ffffffffffffffff
1198Cpus_allowed: 00000001
1199Cpus_allowed_list: 0
1200Mems_allowed: 1
1201Mems_allowed_list: 0
1202voluntary_ctxt_switches: 150
1203nonvoluntary_ctxt_switches: 545
1204.fi
1205.in
1206.IP
1207The fields are as follows:
1208.RS
1209.IP * 2
1210.IR Name :
1211Command run by this process.
1212.IP *
1213.IR State :
4175f999
MK
1214Current state of the process.
1215One of
16b5f7ba
MK
1216"R (running)",
1217"S (sleeping)",
1218"D (disk sleep)",
1219"T (stopped)",
1220"T (tracing stop)",
1221"Z (zombie)",
1222or
1223"X (dead)".
1224.IP *
1225.IR Tgid :
1226Thread group ID (i.e., Process ID).
1227.IP *
1228.IR Pid :
1229Thread ID (see
1230.BR gettid (2)).
1231.IP *
a1bc91d5
MK
1232.IR PPid :
1233PID of parent process.
1234.IP *
16b5f7ba
MK
1235.IR TracerPid :
1236PID of process tracing this process (0 if not being traced).
1237.IP *
1238.IR Uid ", " Gid :
1239Real, effective, saved set, and file system UIDs (GIDs).
1240.IP *
1241.IR FDSize :
1242Number of file descriptor slots currently allocated.
1243.IP *
1244.IR Groups :
1245Supplementary group list.
1246.IP *
1247.IR VmPeak :
1248Peak virtual memory size.
1249.IP *
1250.IR VmSize :
1251Virtual memory size.
1252.IP *
1253.IR VmLck :
fde39195
MK
1254Locked memory size (see
1255.BR mlock (3)).
16b5f7ba
MK
1256.IP *
1257.IR VmHWM :
1258Peak resident set size ("high water mark").
1259.IP *
1260.IR VmRSS :
1261Resident set size.
1262.IP *
1263.IR VmData ", " VmStk ", " VmExe :
1264Size of data, stack, and text segments.
1265.IP *
1266.IR VmLib :
1267Shared library code size.
1268.IP *
1269.IR VmPTE :
1270Page table entries size (since Linux 2.6.10).
1271.IP *
1272.IR Threads :
1273Number of threads in process containing this thread.
1274.IP *
6ee625eb
MK
1275.IR SigQ :
1276This field contains two slash-separated numbers that relate to
1277queued signals for the real user ID of this process.
1278The first of these is the number of currently queued
1279signals for this real user ID, and the second is the
1280resource limit on the number of queued signals for this process
1281(see the description of
1282.BR RLIMIT_SIGPENDING
1283in
1284.BR getrlimit (2)).
1285.IP *
16b5f7ba
MK
1286.IR SigPnd ", " ShdPnd :
1287Number of signals pending for thread and for process as a whole (see
1288.BR pthreads (7)
1289and
1290.BR signal (7)).
1291.IP *
1292.IR SigBlk ", " SigIgn ", " SigCgt :
1293Masks indicating signals being blocked, ignored, and caught (see
1294.BR signal (7)).
1295.IP *
1296.IR CapInh ", " CapPrm ", " CapEff :
1297Masks of capabilities enabled in inheritable, permitted, and effective sets
1298(see
1299.BR capabilities (7)).
1300.IP *
1301.IR CapBnd :
1302Capability Bounding set
1303(since kernel 2.6.26, see
1304.BR capabilities (7)).
1305.IP *
1306.IR Cpus_allowed :
1307Mask of CPUs on which this process may run
1308(since Linux 2.6.24, see
1309.BR cpuset (7)).
1310.IP *
1311.IR Cpus_allowed_list :
1312Same as previous, but in "list format"
1313(since Linux 2.6.26, see
1314.BR cpuset (7)).
1315.IP *
1316.IR Mems_allowed :
1317Mask of memory nodes allowed to this process
1318(since Linux 2.6.24, see
1319.BR cpuset (7)).
1320.IP *
1321.IR Mems_allowed_list :
1322Same as previous, but in "list format"
1323(since Linux 2.6.26, see
1324.BR cpuset (7)).
1325.IP *
1326.IR voluntary_context_switches ", " nonvoluntary_context_switches :
1327Number of voluntary and involuntary context switches (since Linux 2.6.23).
1328.RE
fea681da 1329.TP
69119dc7 1330.IR /proc/[pid]/task " (since Linux 2.6.0-test6)"
afcaf646
MK
1331This is a directory that contains one subdirectory
1332for each thread in the process.
69119dc7
MK
1333The name of each subdirectory is the numerical thread ID
1334.RI ( [tid] )
1335of the thread (see
afcaf646
MK
1336.BR gettid (2)).
1337Within each of these subdirectories, there is a set of
1338files with the same names and contents as under the
69119dc7 1339.I /proc/[pid]
afcaf646
MK
1340directories.
1341For attributes that are shared by all threads, the contents for
1342each of the files under the
69119dc7 1343.I task/[tid]
afcaf646 1344subdirectories will be the same as in the corresponding
c13182ef 1345file in the parent
69119dc7 1346.I /proc/[pid]
afcaf646 1347directory
c13182ef 1348(e.g., in a multithreaded process, all of the
69119dc7 1349.I task/[tid]/cwd
c13182ef 1350files will have the same value as the
69119dc7 1351.I /proc/[pid]/cwd
c13182ef 1352file in the parent directory, since all of the threads in a process
afcaf646
MK
1353share a working directory).
1354For attributes that are distinct for each thread,
c13182ef 1355the corresponding files under
69119dc7 1356.I task/[tid]
afcaf646 1357may have different values (e.g., various fields in each of the
69119dc7 1358.I task/[tid]/status
afcaf646
MK
1359files may be different for each thread).
1360
1361.\" The following was still true as at kernel 2.6.13
1362In a multithreaded process, the contents of the
69119dc7 1363.I /proc/[pid]/task
c13182ef 1364directory are not available if the main thread has already terminated
afcaf646
MK
1365(typically by calling
1366.BR pthread_exit (3)).
1367.TP
fea681da 1368.I /proc/apm
097585ed
MK
1369Advanced power management version and battery information when
1370.B CONFIG_APM
1371is defined at kernel compilation time.
fea681da
MK
1372.TP
1373.I /proc/bus
1374Contains subdirectories for installed busses.
1375.TP
1376.I /proc/bus/pccard
59a40ed7 1377Subdirectory for PCMCIA devices when
097585ed
MK
1378.B CONFIG_PCMCIA
1379is set at kernel compilation time.
fea681da
MK
1380.TP
1381.I /proc/bus/pccard/drivers
1382.TP
1383.I /proc/bus/pci
c13182ef 1384Contains various bus subdirectories and pseudo-files containing
59a40ed7 1385information about PCI busses, installed devices, and device
c13182ef
MK
1386drivers.
1387Some of these files are not ASCII.
fea681da
MK
1388.TP
1389.I /proc/bus/pci/devices
59a40ed7 1390Information about PCI devices.
c13182ef 1391They may be accessed through
fea681da
MK
1392.BR lspci (8)
1393and
1394.BR setpci (8).
1395.TP
1396.I /proc/cmdline
c13182ef
MK
1397Arguments passed to the Linux kernel at boot time.
1398Often done via a boot manager such as
59a40ed7
MK
1399.BR lilo (8)
1400or
1401.BR grub (8).
f6e524c4
MK
1402.TP
1403.IR /proc/config.gz " (since Linux 2.6)"
1404This file exposes the configuration options that were used
c3d9780d 1405to build the currently running kernel,
f6e524c4
MK
1406in the same format as they would be shown in the
1407.I .config
1408file that resulted when configuring the kernel (using
1409.IR "make xconfig" ,
1410.IR "make config" ,
1411or similar).
1412The file contents are compressed; view or search them using
1413.BR zcat (1),
1414.BR zgrep (1),
1415etc.
1416As long as no changes have been made to the following file,
250e01ec
MK
1417the contents of
1418.I /proc/config.gz
1419are the same as those provided by :
f6e524c4
MK
1420.in +4n
1421.nf
1422
c3074d70 1423cat /lib/modules/$(uname \-r)/build/.config
f6e524c4
MK
1424.fi
1425.in
250e01ec
MK
1426.IP
1427.I /proc/config.gz
90878f7c 1428is provided only if the kernel is configured with
250e01ec 1429.BR CONFIG_IKCONFIG_PROC .
fea681da
MK
1430.TP
1431.I /proc/cpuinfo
1432This is a collection of CPU and system architecture dependent items,
1433for each supported architecture a different list.
1434Two common entries are \fIprocessor\fP which gives CPU number and
c13182ef
MK
1435\fIbogomips\fP; a system constant that is calculated
1436during kernel initialization.
1437SMP machines have information for
fea681da 1438each CPU.
a091f002
MK
1439The
1440.BR lscpu (1)
1441command gathers its information from this file.
fea681da
MK
1442.TP
1443.I /proc/devices
c13182ef
MK
1444Text listing of major numbers and device groups.
1445This can be used by MAKEDEV scripts for consistency with the kernel.
fea681da
MK
1446.TP
1447.IR /proc/diskstats " (since Linux 2.5.69)"
1448This file contains disk I/O statistics for each disk device.
66a9882e 1449See the Linux kernel source file
fea681da
MK
1450.I Documentation/iostats.txt
1451for further information.
1452.TP
1453.I /proc/dma
c13182ef 1454This is a list of the registered \fIISA\fP DMA (direct memory access)
fea681da
MK
1455channels in use.
1456.TP
1457.I /proc/driver
1458Empty subdirectory.
1459.TP
1460.I /proc/execdomains
1461List of the execution domains (ABI personalities).
1462.TP
1463.I /proc/fb
097585ed
MK
1464Frame buffer information when
1465.B CONFIG_FB
1466is defined during kernel compilation.
fea681da
MK
1467.TP
1468.I /proc/filesystems
24d01c53
MK
1469A text listing of the file systems which are supported by the kernel,
1470namely file systems which were compiled into the kernel or whose kernel
6387216b
MK
1471modules are currently loaded.
1472(See also
fb477da2 1473.BR filesystems (5).)
24d01c53 1474If a file system is marked with "nodev",
809d0164 1475this means that it does not require a block device to be mounted
24d01c53 1476(e.g., virtual file system, network file system).
809d0164
MK
1477
1478Incidentally, this file may be used by
1479.BR mount (8)
24d01c53
MK
1480when no file system is specified and it didn't manage to determine the
1481file system type.
1482Then file systems contained in this file are tried
809d0164 1483(excepted those that are marked with "nodev").
fea681da
MK
1484.TP
1485.I /proc/fs
1486Empty subdirectory.
1487.TP
1488.I /proc/ide
1489This directory
59a40ed7
MK
1490exists on systems with the IDE bus.
1491There are directories for each IDE channel and attached device.
c13182ef 1492Files include:
fea681da 1493
a08ea57c 1494.in +4n
fea681da
MK
1495.nf
1496cache buffer size in KB
1497capacity number of sectors
1498driver driver version
1499geometry physical and logical geometry
9fdfa163 1500identify in hexadecimal
fea681da
MK
1501media media type
1502model manufacturer's model number
1503settings drive settings
9fdfa163
MK
1504smart_thresholds in hexadecimal
1505smart_values in hexadecimal
fea681da 1506.fi
a08ea57c 1507.in
fea681da 1508
c13182ef 1509The
fea681da
MK
1510.BR hdparm (8)
1511utility provides access to this information in a friendly format.
1512.TP
1513.I /proc/interrupts
23ec6ff0
MK
1514This is used to record the number of interrupts per CPU per IO device.
1515Since Linux 2.6.24,
1516for the i386 and x86_64 architectures, at least, this also includes
1517interrupts internal to the system (that is, not associated with a device
1518as such), such as NMI (nonmaskable interrupt), LOC (local timer interrupt),
1519and for SMP systems, TLB (TLB flush interrupt), RES (rescheduling
1520interrupt), CAL (remote function call interrupt), and possibly others.
1521Very easy to read formatting, done in ASCII.
fea681da
MK
1522.TP
1523.I /proc/iomem
1524I/O memory map in Linux 2.4.
1525.TP
1526.I /proc/ioports
c13182ef 1527This is a list of currently registered Input-Output port regions that
fea681da
MK
1528are in use.
1529.TP
1530.IR /proc/kallsyms " (since Linux 2.5.71)"
1531This holds the kernel exported symbol definitions used by the
1532.BR modules (X)
1533tools to dynamically link and bind loadable modules.
1534In Linux 2.5.47 and earlier, a similar file with slightly different syntax
1535was named
1536.IR ksyms .
1537.TP
1538.I /proc/kcore
1539This file represents the physical memory of the system and is stored
c13182ef
MK
1540in the ELF core file format.
1541With this pseudo-file, and an unstripped
9a67332e
MK
1542kernel
1543.RI ( /usr/src/linux/vmlinux )
1544binary, GDB can be used to
fea681da
MK
1545examine the current state of any kernel data structures.
1546
1547The total length of the file is the size of physical memory (RAM) plus
15484KB.
1549.TP
1550.I /proc/kmsg
1551This file can be used instead of the
1552.BR syslog (2)
c13182ef
MK
1553system call to read kernel messages.
1554A process must have superuser
fea681da 1555privileges to read this file, and only one process should read this
c13182ef
MK
1556file.
1557This file should not be read if a syslog process is running
fea681da
MK
1558which uses the
1559.BR syslog (2)
1560system call facility to log kernel messages.
1561
1562Information in this file is retrieved with the
c4517613 1563.BR dmesg (1)
fea681da
MK
1564program.
1565.TP
1566.IR /proc/ksyms " (Linux 1.1.23-2.5.47)"
1567See
1568.IR /proc/kallsyms .
1569.TP
1570.I /proc/loadavg
6b05dc38
MK
1571The first three fields in this file are load average figures
1572giving the number of jobs in the run queue (state R)
fea681da
MK
1573or waiting for disk I/O (state D) averaged over 1, 5, and 15 minutes.
1574They are the same as the load average numbers given by
1575.BR uptime (1)
1576and other programs.
6b05dc38 1577The fourth field consists of two numbers separated by a slash (/).
78fc91ec
EDB
1578The first of these is the number of currently runnable kernel
1579scheduling entities (processes, threads).
6b05dc38
MK
1580The value after the slash is the number of kernel scheduling entities
1581that currently exist on the system.
1582The fifth field is the PID of the process that was most
1583recently created on the system.
fea681da
MK
1584.TP
1585.I /proc/locks
1586This file shows current file locks
1587.RB ( flock "(2) and " fcntl (2))
1588and leases
1589.RB ( fcntl (2)).
1590.TP
89dd5f8a 1591.IR /proc/malloc " (only up to and including Linux 2.2)"
59a40ed7 1592.\" It looks like this only ever did something back in 1.0 days
90878f7c 1593This file is present only if
89dd5f8a 1594.B CONFIG_DEBUG_MALLOC
097585ed 1595was defined during compilation.
fea681da
MK
1596.TP
1597.I /proc/meminfo
77b802ec
MK
1598This file reports statistics about memory usage on the system.
1599It is used by
fea681da
MK
1600.BR free (1)
1601to report the amount of free and used memory (both physical and swap)
1602on the system as well as the shared memory and buffers used by the
1603kernel.
3ba3d5b1
MK
1604Each line of the file consists of a parameter name, followed by a colon,
1605the value of the parameter, and an option unit of measurement (e.g., "kB").
1606The list below describes the parameter names and
1607the format specifier required to read the field value.
1608Except as noted below,
1609all of the fields have been present since at least Linux 2.6.0.
90878f7c 1610Some fileds are displayed only if the kernel was configured
3ba3d5b1
MK
1611with various options; those dependencies are noted in the list.
1612.RS
1613.TP
1614.IR MemTotal " %lu"
1615Total usable RAM (i.e. physical RAM minus a few reserved
99e91586 1616bits and the kernel binary code).
3ba3d5b1
MK
1617.TP
1618.IR MemFree " %lu"
7bccb7d4
DP
1619The sum of
1620.IR LowFree + HighFree .
3ba3d5b1
MK
1621.TP
1622.IR Buffers " %lu"
99e91586 1623Relatively temporary storage for raw disk blocks that
3ba3d5b1
MK
1624shouldn't get tremendously large (20MB or so).
1625.TP
1626.IR Cached " %lu"
1627In-memory cache for files read from the disk (the page cache).
1628Doesn't include
1629.IR SwapCached .
1630.TP
1631.IR SwapCached " %lu"
1632Memory that once was swapped out, is swapped back in but
1633still also is in the swap file.
fa1d2749 1634(If memory pressure is high, these pages
3ba3d5b1 1635don't need to be swapped out again because they are already
99e91586 1636in the swap file.
3ba3d5b1
MK
1637This saves I/O.)
1638.TP
1639.IR Active " %lu"
1640Memory that has been used more recently and usually not
1641reclaimed unless absolutely necessary.
1642.TP
1643.IR Inactive " %lu"
1644Memory which has been less recently used.
1645It is more eligible to be reclaimed for other purposes.
1646.TP
1647.IR Active(anon) " %lu (since Linux 2.6.28)"
1648[To be documented.]
1649.TP
1650.IR Inactive(anon) " %lu (since Linux 2.6.28)"
1651[To be documented.]
1652.TP
1653.IR Active(file) " %lu (since Linux 2.6.28)"
1654[To be documented.]
1655.TP
1656.IR Inactive(file) " %lu (since Linux 2.6.28)"
1657[To be documented.]
1658.TP
1659.IR Unevictable " %lu (since Linux 2.6.28)"
1660(From Linux 2.6.28 to 2.6.30,
1661\fBCONFIG_UNEVICTABLE_LRU\fP was required.)
1662[To be documented.]
1663.TP
46fbfc07 1664.IR Mlocked " %lu (since Linux 2.6.28)"
3ba3d5b1
MK
1665(From Linux 2.6.28 to 2.6.30,
1666\fBCONFIG_UNEVICTABLE_LRU\fP was required.)
1667[To be documented.]
1668.TP
1669.IR HighTotal " %lu"
1670(Starting with Linux 2.6.19, \fBCONFIG_HIGHMEM\fP is required.)
1671Total amount of highmem.
99e91586 1672Highmem is all memory above ~860MB of physical memory.
3ba3d5b1
MK
1673Highmem areas are for use by user-space programs,
1674or for the page cache.
1675The kernel must use tricks to access
1676this memory, making it slower to access than lowmem.
1677.TP
1678.IR HighFree " %lu
1679(Starting with Linux 2.6.19, \fBCONFIG_HIGHMEM\fP is required.)
1680Amount of free highmem.
1681.TP
1682.IR LowTotal " %lu
1683(Starting with Linux 2.6.19, \fBCONFIG_HIGHMEM\fP is required.)
1684Total amount of lowmem.
1685Lowmem is memory which can be used for everything that
1686highmem can be used for, but it is also available for the
1687kernel's use for its own data structures.
1688Among many other things,
99e91586 1689it is where everything from
7bccb7d4
DP
1690.I Slab
1691is allocated.
3ba3d5b1
MK
1692Bad things happen when you're out of lowmem.
1693.TP
1694.IR LowFree " %lu
1695(Starting with Linux 2.6.19, \fBCONFIG_HIGHMEM\fP is required.)
1696Amount of free lowmem.
1697.TP
1698.IR MmapCopy " %lu (since Linux 2.6.29)"
99e91586
DP
1699.RB ( CONFIG_MMU
1700is required.)
3ba3d5b1
MK
1701[To be documented.]
1702.TP
1703.IR SwapTotal " %lu"
1704Total amount of swap space available.
1705.TP
1706.IR SwapFree " %lu"
c16d4f25 1707Amount of swap space that is currently unused.
3ba3d5b1
MK
1708.TP
1709.IR Dirty " %lu"
1710Memory which is waiting to get written back to the disk.
1711.TP
1712.IR Writeback " %lu"
1713Memory which is actively being written back to the disk.
1714.TP
1715.IR AnonPages " %lu (since Linux 2.6.18)"
1716Non-file backed pages mapped into user-space page tables.
1717.TP
1718.IR Mapped " %lu"
1719Files which have been mmaped, such as libraries.
1720.TP
1721.IR Shmem " %lu (since Linux 2.6.32)"
1722[To be documented.]
1723.TP
1724.IR Slab " %lu"
1725In-kernel data structures cache.
1726.TP
1727.IR SReclaimable " %lu (since Linux 2.6.19)"
7bccb7d4
DP
1728Part of
1729.IR Slab ,
1730that might be reclaimed, such as caches.
3ba3d5b1
MK
1731.TP
1732.IR SUnreclaim " %lu (since Linux 2.6.19)"
7bccb7d4
DP
1733Part of
1734.IR Slab ,
1735that cannot be reclaimed on memory pressure.
3ba3d5b1
MK
1736.TP
1737.IR KernelStack " %lu (since Linux 2.6.32)"
1738Amount of memory allocated to kernel stacks.
1739.TP
1740.IR PageTables " %lu (since Linux 2.6.18)"
1741Amount of memory dedicated to the lowest level of page tables.
1742.TP
1743.IR Quicklists " %lu (since Linux 2.6.27)"
1744(\fBCONFIG_QUICKLIST\fP is required.)
1745[To be documented.]
1746.TP
1747.IR NFS_Unstable " %lu (since Linux 2.6.18)"
1748NFS pages sent to the server, but not yet committed to stable storage.
1749.TP
1750.IR Bounce " %lu (since Linux 2.6.18)"
1751Memory used for block device "bounce buffers".
1752.TP
1753.IR WritebackTmp " %lu (since Linux 2.6.26)"
1754Memory used by FUSE for temporary writeback buffers.
1755.TP
1756.IR CommitLimit " %lu (since Linux 2.6.10)"
1757Based on the overcommit ratio ('vm.overcommit_ratio'),
1758this is the total amount of memory currently available to
90878f7c
MK
1759be allocated on the system.
1760This limit is adhered to
1761only if strict overcommit accounting is enabled (mode 2 in
3ba3d5b1
MK
1762.IR /proc/sys/vm/overcommit_ratio ).
1763The
1764.I CommitLimit
1765is calculated using the following formula:
1766
1767 CommitLimit = (overcommit_ratio * Physical RAM) + Swap
1768
1769For example, on a system with 1GB of physical RAM and 7GB
1770of swap with a
1771.I overcommit_ratio
1772of 30, this formula yields a
1773.I CommitLimit
99e91586 1774of 7.3GB.
3ba3d5b1 1775For more details, see the memory overcommit documentation
99e91586 1776in the kernel source file
3ba3d5b1
MK
1777.IR Documentation/vm/overcommit-accounting .
1778.TP
1779.IR Committed_AS " %lu"
1780The amount of memory presently allocated on the system.
1781The committed memory is a sum of all of the memory which
1782has been allocated by processes, even if it has not been
1783"used" by them as of yet.
1784A process which allocates 1GB of memory (using
1785.BR malloc (3)
33a0ccb2 1786or similar), but touches only 300MB of that memory will show up
90878f7c 1787as using only 300MB of memory even if it has the address space
3ba3d5b1
MK
1788allocated for the entire 1GB.
1789This 1GB is memory which has been "committed" to by the VM
1790and can be used at any time by the allocating application.
1791With strict overcommit enabled on the system (mode 2
99e91586 1792.IR /proc/sys/vm/overcommit_memory ),
3ba3d5b1
MK
1793allocations which would exceed the
1794.I CommitLimit
1795(detailed above) will not be permitted.
1796This is useful if one needs to guarantee that processes will not
1797fail due to lack of memory once that memory has been successfully allocated.
1798.TP
1799.IR VmallocTotal " %lu"
1800Total size of vmalloc memory area.
1801.TP
1802.IR VmallocUsed " %lu"
1803Amount of vmalloc area which is used.
1804.TP
1805.IR VmallocChunk " %lu"
1806Largest contiguous block of vmalloc area which is free.
1807.TP
1808.IR HardwareCorrupted " %lu (since Linux 2.6.32)"
1809(\fBCONFIG_MEMORY_FAILURE\fP is required.)
1810[To be documented.]
1811.TP
1812.IR AnonHugePages " %lu (since Linux 2.6.38)"
1813(\fBCONFIG_TRANSPARENT_HUGEPAGE\fP is required.)
7fac88a9 1814Non-file backed huge pages mapped into user-space page tables.
3ba3d5b1
MK
1815.TP
1816.IR HugePages_Total " %lu"
1817(\fBCONFIG_HUGETLB_PAGE\fP is required.)
1818The size of the pool of huge pages.
1819.TP
1820.IR HugePages_Free " %lu"
1821(\fBCONFIG_HUGETLB_PAGE\fP is required.)
1822The number of huge pages in the pool that are not yet allocated.
1823.TP
1824.IR HugePages_Rsvd " %lu (since Linux 2.6.17)"
1825(\fBCONFIG_HUGETLB_PAGE\fP is required.)
1826This is the number of huge pages for
1827which a commitment to allocate from the pool has been made,
1828but no allocation has yet been made.
1829These reserved huge pages
1830guarantee that an application will be able to allocate a
1831huge page from the pool of huge pages at fault time.
1832.TP
aa8a6b4f 1833.IR HugePages_Surp " %lu (since Linux 2.6.24)"
3ba3d5b1
MK
1834(\fBCONFIG_HUGETLB_PAGE\fP is required.)
1835This is the number of huge pages in
1836the pool above the value in
1837.IR /proc/sys/vm/nr_hugepages .
1838The maximum number of surplus huge pages is controlled by
1839.IR /proc/sys/vm/nr_overcommit_hugepages .
1840.TP
1841.IR Hugepagesize " %lu"
1842(\fBCONFIG_HUGETLB_PAGE\fP is required.)
1843The size of huge pages.
1844.RE
fea681da 1845.TP
aa341984
MK
1846.I /proc/modules
1847A text list of the modules that have been loaded by the system.
1848See also
1849.BR lsmod (8).
1850.TP
fea681da 1851.I /proc/mounts
c1eea65a
MK
1852Before kernel 2.4.19, this file was a list
1853of all the file systems currently mounted on the system.
732e54dd 1854With the introduction of per-process mount namespaces in
c1eea65a
MK
1855Linux 2.4.19, this file became a link to
1856.IR /proc/self/mounts ,
732e54dd 1857which lists the mount points of the process's own mount namespace.
fea681da 1858The format of this file is documented in
31e9a9ec 1859.BR fstab (5).
fea681da 1860.TP
fea681da 1861.I /proc/mtrr
c13182ef 1862Memory Type Range Registers.
66a9882e 1863See the Linux kernel source file
cfe70b66 1864.I Documentation/mtrr.txt
fea681da
MK
1865for details.
1866.TP
1867.I /proc/net
1868various net pseudo-files, all of which give the status of some part of
c13182ef
MK
1869the networking layer.
1870These files contain ASCII structures and are,
59a40ed7
MK
1871therefore, readable with
1872.BR cat (1).
c13182ef 1873However, the standard
fea681da
MK
1874.BR netstat (8)
1875suite provides much cleaner access to these files.
1876.TP
1877.I /proc/net/arp
1878This holds an ASCII readable dump of the kernel ARP table used for
c13182ef 1879address resolutions.
01d0a447 1880It will show both dynamically learned and preprogrammed ARP entries.
c13182ef 1881The format is:
fea681da
MK
1882
1883.nf
1884.ft CW
1885.in 8n
1886IP address HW type Flags HW address Mask Device
1887192.168.0.50 0x1 0x2 00:50:BF:25:68:F3 * eth0
1888192.168.0.250 0x1 0xc 00:00:00:00:00:00 * eth0
1889.ft
1890.fi
1891.in
1892
6c04f928 1893Here "IP address" is the IPv4 address of the machine and the "HW type"
c13182ef
MK
1894is the hardware type of the address from RFC\ 826.
1895The flags are the internal
9a67332e
MK
1896flags of the ARP structure (as defined in
1897.IR /usr/include/linux/if_arp.h )
1898and
6c04f928 1899the "HW address" is the data link layer mapping for that IP address if
fea681da
MK
1900it is known.
1901.TP
1902.I /proc/net/dev
c13182ef
MK
1903The dev pseudo-file contains network device status information.
1904This gives
1905the number of received and sent packets, the number of errors and
fea681da 1906collisions
c13182ef
MK
1907and other basic statistics.
1908These are used by the
fea681da 1909.BR ifconfig (8)
c13182ef
MK
1910program to report device status.
1911The format is:
fea681da
MK
1912
1913.nf
1914.ft CW
1915.in 1n
1916Inter-| Receive | Transmit
1917 face |bytes packets errs drop fifo frame compressed multicast|bytes packets errs drop fifo colls carrier compressed
1918 lo: 2776770 11307 0 0 0 0 0 0 2776770 11307 0 0 0 0 0 0
1919 eth0: 1215645 2751 0 0 0 0 0 0 1782404 4324 0 0 0 427 0 0
1920 ppp0: 1622270 5552 1 0 0 0 0 0 354130 5669 0 0 0 0 0 0
1921 tap0: 7714 81 0 0 0 0 0 0 7714 81 0 0 0 0 0 0
1922.in
1923.ft
1924.fi
1925.\" .TP
1926.\" .I /proc/net/ipx
1927.\" No information.
1928.\" .TP
1929.\" .I /proc/net/ipx_route
1930.\" No information.
1931.TP
1932.I /proc/net/dev_mcast
1933Defined in
1934.IR /usr/src/linux/net/core/dev_mcast.c :
1935.nf
1936.in +5
9fdfa163 1937indx interface_name dmi_u dmi_g dmi_address
fea681da
MK
19382 eth0 1 0 01005e000001
19393 eth1 1 0 01005e000001
19404 eth2 1 0 01005e000001
1941.in
1942.fi
1943.TP
1944.I /proc/net/igmp
c13182ef
MK
1945Internet Group Management Protocol.
1946Defined in
fea681da
MK
1947.IR /usr/src/linux/net/core/igmp.c .
1948.TP
1949.I /proc/net/rarp
1950This file uses the same format as the
1951.I arp
1952file and contains the current reverse mapping database used to provide
1953.BR rarp (8)
c13182ef
MK
1954reverse address lookup services.
1955If RARP is not configured into the
fea681da
MK
1956kernel,
1957this file will not be present.
1958.TP
1959.I /proc/net/raw
c13182ef
MK
1960Holds a dump of the RAW socket table.
1961Much of the information is not of
fea681da 1962use
c13182ef 1963apart from debugging.
6c04f928 1964The "sl" value is the kernel hash slot for the
fea681da 1965socket,
6c04f928
MK
1966the "local_address" is the local address and protocol number pair.
1967\&"St" is
c13182ef
MK
1968the internal status of the socket.
1969The "tx_queue" and "rx_queue" are the
fea681da 1970outgoing and incoming data queue in terms of kernel memory usage.
94e9d9fe 1971The "tr", "tm\->when", and "rexmits" fields are not used by RAW.
fdc196f5
MK
1972The "uid"
1973field holds the effective UID of the creator of the socket.
fea681da
MK
1974.\" .TP
1975.\" .I /proc/net/route
1976.\" No information, but looks similar to
1977.\" .BR route (8).
1978.TP
1979.I /proc/net/snmp
c13182ef 1980This file holds the ASCII data needed for the IP, ICMP, TCP, and UDP
fea681da 1981management
763f0e47 1982information bases for an SNMP agent.
fea681da
MK
1983.TP
1984.I /proc/net/tcp
c13182ef
MK
1985Holds a dump of the TCP socket table.
1986Much of the information is not
1987of use apart from debugging.
1988The "sl" value is the kernel hash slot
6beb1671
MK
1989for the socket, the "local_address" is the local address and port number pair.
1990The "rem_address" is the remote address and port number pair
6c04f928
MK
1991(if connected).
1992\&"St" is the internal status of the socket.
1993The "tx_queue" and "rx_queue" are the
fea681da 1994outgoing and incoming data queue in terms of kernel memory usage.
94e9d9fe 1995The "tr", "tm\->when", and "rexmits" fields hold internal information of
fdc196f5
MK
1996the kernel socket state and are only useful for debugging.
1997The "uid"
1998field holds the effective UID of the creator of the socket.
fea681da
MK
1999.TP
2000.I /proc/net/udp
c13182ef
MK
2001Holds a dump of the UDP socket table.
2002Much of the information is not of
2003use apart from debugging.
2004The "sl" value is the kernel hash slot for the
6beb1671
MK
2005socket, the "local_address" is the local address and port number pair.
2006The "rem_address" is the remote address and port number pair
fea681da
MK
2007(if connected). "St" is the internal status of the socket.
2008The "tx_queue" and "rx_queue" are the outgoing and incoming data queue
c13182ef 2009in terms of kernel memory usage.
94e9d9fe 2010The "tr", "tm\->when", and "rexmits" fields
c13182ef 2011are not used by UDP.
fdc196f5
MK
2012The "uid"
2013field holds the effective UID of the creator of the socket.
fea681da
MK
2014The format is:
2015
2016.nf
2017.ft CW
2018.in 1n
94e9d9fe 2019sl local_address rem_address st tx_queue rx_queue tr rexmits tm\->when uid
fea681da
MK
2020 1: 01642C89:0201 0C642C89:03FF 01 00000000:00000001 01:000071BA 00000000 0
2021 1: 00000000:0801 00000000:0000 0A 00000000:00000000 00:00000000 6F000100 0
2022 1: 00000000:0201 00000000:0000 0A 00000000:00000000 00:00000000 00000000 0
2023.in
2024.ft
2025.fi
2026.TP
2027.I /proc/net/unix
008f1ecc 2028Lists the UNIX domain sockets present within the system and their
c13182ef
MK
2029status.
2030The format is:
fea681da
MK
2031.nf
2032.sp .5
2033.ft CW
2034Num RefCount Protocol Flags Type St Path
2035 0: 00000002 00000000 00000000 0001 03
2036 1: 00000001 00000000 00010000 0001 01 /dev/printer
2037.ft
2038.sp .5
2039.fi
2040
6c04f928
MK
2041Here "Num" is the kernel table slot number, "RefCount" is the number
2042of users of the socket, "Protocol" is currently always 0, "Flags"
fea681da 2043represent the internal kernel flags holding the status of the
c13182ef 2044socket.
008f1ecc 2045Currently, type is always "1" (UNIX domain datagram sockets are
6c04f928
MK
2046not yet supported in the kernel).
2047\&"St" is the internal state of the
fea681da
MK
2048socket and Path is the bound path (if any) of the socket.
2049.TP
2050.I /proc/partitions
2051Contains major and minor numbers of each partition as well as number
2052of blocks and partition name.
2053.TP
2054.I /proc/pci
2055This is a listing of all PCI devices found during kernel initialization
2056and their configuration.
2990d781 2057
59a40ed7
MK
2058This file has been deprecated in favor of a new
2059.I /proc
2990d781
MK
2060interface for PCI
2061.RI ( /proc/bus/pci ).
2062It became optional in Linux 2.2 (available with
2063.B CONFIG_PCI_OLD_PROC
2064set at kernel compilation).
24b74457 2065It became once more nonoptionally enabled in Linux 2.4.
2990d781
MK
2066Next, it was deprecated in Linux 2.6 (still available with
2067.B CONFIG_PCI_LEGACY_PROC
2068set), and finally removed altogether since Linux 2.6.17.
b4e9ee8f
MK
2069.\" FIXME /proc/sched_debug
2070.\" .TP
2071.\" .IR /proc/sched_debug " (since Linux 2.6.23)"
69119dc7 2072.\" See also /proc/[pid]/sched
caea7868
MK
2073.TP
2074.IR /proc/profile " (since Linux 2.4)"
2075This file is present only if the kernel was booted with the
2076.I profile=1
2077command-line option.
2078It exposes kernel profiling information in a binary format for use by
2079.BR readprofile (1).
2080Writing (e.g., an empty string) to this file resets the profiling counters;
2081on some architectures,
2082writing a binary integer "profiling multiplier" of size
2083.IR sizeof(int)
8a3ac89a 2084sets the profiling interrupt frequency.
fea681da
MK
2085.TP
2086.I /proc/scsi
59a40ed7
MK
2087A directory with the
2088.I scsi
2089mid-level pseudo-file and various SCSI low-level
2990d781
MK
2090driver directories,
2091which contain a file for each SCSI host in this system, all of
c13182ef
MK
2092which give the status of some part of the SCSI IO subsystem.
2093These files contain ASCII structures and are, therefore, readable with
2990d781 2094.BR cat (1).
fea681da 2095
c13182ef 2096You can also write to some of the files to reconfigure the subsystem or
59a40ed7 2097switch certain features on or off.
fea681da
MK
2098.TP
2099.I /proc/scsi/scsi
c13182ef 2100This is a listing of all SCSI devices known to the kernel.
59a40ed7 2101The listing is similar to the one seen during bootup.
c13182ef 2102scsi currently supports only the \fIadd-single-device\fP command which
59a40ed7
MK
2103allows root to add a hotplugged device to the list of known devices.
2104
2105The command
2106.in +4n
2107.nf
2108
2109echo \(aqscsi add-single-device 1 0 5 0\(aq > /proc/scsi/scsi
fea681da 2110
59a40ed7
MK
2111.fi
2112.in
c13182ef
MK
2113will cause
2114host scsi1 to scan on SCSI channel 0 for a device on ID 5 LUN 0.
2115If there
fea681da
MK
2116is already a device known on this address or the address is invalid, an
2117error will be returned.
2118.TP
2119.I /proc/scsi/[drivername]
c13182ef
MK
2120\fI[drivername]\fP can currently be NCR53c7xx, aha152x, aha1542, aha1740,
2121aic7xxx, buslogic, eata_dma, eata_pio, fdomain, in2000, pas16, qlogic,
2122scsi_debug, seagate, t128, u15-24f, ultrastore, or wd7000.
2123These directories show up for all drivers that registered at least one
59a40ed7 2124SCSI HBA.
c13182ef 2125Every directory contains one file per registered host.
59a40ed7 2126Every host-file is named after the number the host was assigned during
c13182ef 2127initialization.
fea681da 2128
c13182ef 2129Reading these files will usually show driver and host configuration,
59a40ed7 2130statistics, etc.
fea681da
MK
2131
2132Writing to these files allows different things on different hosts.
2133For example, with the \fIlatency\fP and \fInolatency\fP commands,
2134root can switch on and off command latency measurement code in the
c13182ef
MK
2135eata_dma driver.
2136With the \fIlockup\fP and \fIunlock\fP commands,
2137root can control bus lockups simulated by the scsi_debug driver.
fea681da
MK
2138.TP
2139.I /proc/self
59a40ed7
MK
2140This directory refers to the process accessing the
2141.I /proc
2142file system,
2143and is identical to the
2144.I /proc
2145directory named by the process ID of the same process.
fea681da
MK
2146.TP
2147.I /proc/slabinfo
c13182ef 2148Information about kernel caches.
90878f7c 2149Since Linux 2.6.16 this file is present only if the
821643a8
MK
2150.B CONFIG_SLAB
2151kernel configuration option is enabled.
350038ff 2152The columns in
38f76cd2 2153.I /proc/slabinfo
350038ff 2154are:
a08ea57c 2155.in +4n
fea681da 2156.nf
a08ea57c 2157
fea681da
MK
2158cache-name
2159num-active-objs
2160total-objs
2161object-size
2162num-active-slabs
2163total-slabs
2164num-pages-per-slab
2165.fi
a08ea57c
MK
2166.in
2167
c13182ef 2168See
fea681da
MK
2169.BR slabinfo (5)
2170for details.
2171.TP
2172.I /proc/stat
c13182ef
MK
2173kernel/system statistics.
2174Varies with architecture.
2175Common
fea681da
MK
2176entries include:
2177.RS
2178.TP
2179\fIcpu 3357 0 4313 1362393\fP
bfbfcd18 2180The amount of time, measured in units of
268f000b
MK
2181USER_HZ (1/100ths of a second on most architectures, use
2182.IR sysconf(_SC_CLK_TCK)
2183to obtain the right value),
b81087ab 2184.\" 1024 on Alpha and ia64
ae3b8047
MK
2185that the system spent in various states:
2186.RS
2187.TP
2188.I user
ea0841f6 2189(1) Time spent in user mode.
ae3b8047
MK
2190.TP
2191.I nice
0633f951 2192(2) Time spent in user mode with low priority (nice).
9f1b9726 2193.TP
ae3b8047 2194.I system
0633f951 2195(3) Time spent in system mode.
ae3b8047
MK
2196.TP
2197.I idle
ea0841f6 2198(4) Time spent in the idle task.
b09b8526 2199.\" FIXME Actually, the following info about the /proc/stat 'cpu' field
e04a1f93
MK
2200.\" does not seem to be quite right (at least in 2.6.12 or 3.6):
2201.\" the idle time in /proc/uptime does not quite match this value
2202This value should be USER_HZ times the
4cb1deb7
MK
2203second entry in the
2204.I /proc/uptime
2205pseudo-file.
ae3b8047
MK
2206.TP
2207.IR iowait " (since Linux 2.5.41)"
ea0841f6 2208(5) Time waiting for I/O to complete.
ae3b8047
MK
2209.TP
2210.IR irq " (since Linux 2.6.0-test4)"
ea0841f6 2211(6) Time servicing interrupts.
ae3b8047 2212.TP
0633f951 2213.IR softirq " (since Linux 2.6.0-test4)"
ea0841f6 2214(7) Time servicing softirqs.
ae3b8047
MK
2215.TP
2216.IR steal " (since Linux 2.6.11)"
ea0841f6 2217(8) Stolen time, which is the time spent in other operating systems when
9de1f6cc 2218running in a virtualized environment
ae3b8047
MK
2219.TP
2220.IR guest " (since Linux 2.6.24)"
0633f951 2221(9) Time spent running a virtual CPU for guest
afef1764 2222operating systems under the control of the Linux kernel.
14c06953 2223.\" See Changelog entry for 5e84cfde51cf303d368fcb48f22059f37b3872de
d4fd4120
MK
2224.TP
2225.IR guest_nice " (since Linux 2.6.33)"
2226.\" commit ce0e7b28fb75cb003cfc8d0238613aaf1c55e797
2227(10) Time spent running a niced guest (virtual CPU for guest
2228operating systems under the control of the Linux kernel).
ae3b8047 2229.RE
fea681da
MK
2230.TP
2231\fIpage 5741 1808\fP
2232The number of pages the system paged in and the number that were paged
2233out (from disk).
2234.TP
2235\fIswap 1 0\fP
2236The number of swap pages that have been brought in and out.
2237.TP
c13182ef 2238.\" FIXME The following is not the full picture for the 'intr' of
777f5a9e 2239.\" /proc/stat on 2.6:
fea681da 2240\fIintr 1462898\fP
bfbfcd18
MK
2241This line shows counts of interrupts serviced since boot time,
2242for each of the possible system interrupts.
2243The first column is the total of all interrupts serviced;
2244each subsequent column is the total for a particular interrupt.
fea681da
MK
2245.TP
2246\fIdisk_io: (2,0):(31,30,5764,1,2) (3,0):\fP...
636297e9 2247(major,disk_idx):(noinfo, read_io_ops, blks_read, write_io_ops, blks_written)
bfbfcd18
MK
2248.br
2249(Linux 2.4 only)
fea681da
MK
2250.TP
2251\fIctxt 115315\fP
2252The number of context switches that the system underwent.
2253.TP
2254\fIbtime 769041601\fP
f49c451a 2255boot time, in seconds since the Epoch, 1970-01-01 00:00:00 +0000 (UTC).
fea681da
MK
2256.TP
2257\fIprocesses 86031\fP
2258Number of forks since boot.
bfbfcd18
MK
2259.TP
2260\fIprocs_running 6\fP
2261Number of processes in runnable state.
5fab2e7c 2262(Linux 2.5.45 onward.)
bfbfcd18
MK
2263.TP
2264\fIprocs_blocked 2\fP
2265Number of processes blocked waiting for I/O to complete.
5fab2e7c 2266(Linux 2.5.45 onward.)
fea681da
MK
2267.RE
2268.TP
2269.I /proc/swaps
c13182ef
MK
2270Swap areas in use.
2271See also
fea681da
MK
2272.BR swapon (8).
2273.TP
2274.I /proc/sys
2275This directory (present since 1.3.57) contains a number of files
2276and subdirectories corresponding to kernel variables.
2277These variables can be read and sometimes modified using
5a2ff571 2278the \fI/proc\fP file system, and the (deprecated)
fea681da 2279.BR sysctl (2)
c13182ef 2280system call.
fea681da 2281.TP
6ab7c0aa 2282.IR /proc/sys/abi " (since Linux 2.4.10)"
fea681da 2283This directory may contain files with application binary information.
6ab7c0aa 2284.\" On some systems, it is not present.
66a9882e 2285See the Linux kernel source file
6ab7c0aa
MK
2286.I Documentation/sysctl/abi.txt
2287for more information.
fea681da
MK
2288.TP
2289.I /proc/sys/debug
2290This directory may be empty.
2291.TP
2292.I /proc/sys/dev
e2badfdf 2293This directory contains device-specific information (e.g.,
9a67332e 2294.IR dev/cdrom/info ).
fea681da
MK
2295On
2296some systems, it may be empty.
2297.TP
2298.I /proc/sys/fs
49236d3c
MK
2299This directory contains the files and subdirectories for kernel variables
2300related to file systems.
fea681da
MK
2301.TP
2302.I /proc/sys/fs/binfmt_misc
c13182ef 2303Documentation for files in this directory can be found
66a9882e 2304in the Linux kernel sources in
fea681da
MK
2305.IR Documentation/binfmt_misc.txt .
2306.TP
59a40ed7
MK
2307.IR /proc/sys/fs/dentry-state " (since Linux 2.2)"
2308This file contains information about the status of the
2309directory cache (dcache).
2310The file contains six numbers,
c13182ef 2311.IR nr_dentry ", " nr_unused ", " age_limit " (age in seconds), "
59a40ed7 2312.I want_pages
fea681da 2313(pages requested by system) and two dummy values.
59a40ed7
MK
2314.RS
2315.IP * 2
2316.I nr_dentry
2317is the number of allocated dentries (dcache entries).
2318This field is unused in Linux 2.2.
2319.IP *
2320.I nr_unused
2321is the number of unused dentries.
2322.IP *
2323.I age_limit
2324.\" looks like this is unused in kernels 2.2 to 2.6
2325is the age in seconds after which dcache entries
2326can be reclaimed when memory is short.
2327.IP *
2328.I want_pages
2329.\" looks like this is unused in kernels 2.2 to 2.6
c7094399 2330is nonzero when the kernel has called shrink_dcache_pages() and the
fea681da 2331dcache isn't pruned yet.
59a40ed7 2332.RE
fea681da
MK
2333.TP
2334.I /proc/sys/fs/dir-notify-enable
2335This file can be used to disable or enable the
2336.I dnotify
2337interface described in
2338.BR fcntl (2)
2339on a system-wide basis.
2340A value of 0 in this file disables the interface,
2341and a value of 1 enables it.
2342.TP
2343.I /proc/sys/fs/dquot-max
2344This file shows the maximum number of cached disk quota entries.
2345On some (2.4) systems, it is not present.
2346If the number of free cached disk quota entries is very low and
2347you have some awesome number of simultaneous system users,
2348you might want to raise the limit.
2349.TP
2350.I /proc/sys/fs/dquot-nr
2351This file shows the number of allocated disk quota
2352entries and the number of free disk quota entries.
2353.TP
24cb4a4b 2354.IR /proc/sys/fs/epoll " (since Linux 2.6.28)"
242b46af
MK
2355This directory contains the file
2356.IR max_user_watches ,
24cb4a4b
MK
2357which can be used to limit the amount of kernel memory consumed by the
2358.I epoll
2359interface.
2360For further details, see