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