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