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