]>
Commit | Line | Data |
---|---|---|
fea681da | 1 | .\" Copyright (C) 1994, 1995 by Daniel Quinlan (quinlan@yggdrasil.com) |
f352b560 | 2 | .\" and Copyright (C) 2002-2008,2017 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 | .\" |
43d42cc0 | 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 | .\" |
4b8c67d9 | 55 | .TH PROC 5 2017-09-15 "Linux" "Linux Programmer's Manual" |
fea681da | 56 | .SH NAME |
9ee4a2b6 | 57 | proc \- process information pseudo-filesystem |
fea681da MK |
58 | .SH DESCRIPTION |
59 | The | |
31fa1fd2 | 60 | .B 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 . |
b574c52d MK |
65 | Typically, it is mounted automatically by the system, |
66 | but it can also be mounted manually using a command such as: | |
67 | .PP | |
68 | .in +4n | |
69 | .EX | |
70 | mount \-t proc proc /proc | |
71 | .EE | |
72 | .in | |
73 | .PP | |
7e174651 | 74 | Most of the files in the |
31fa1fd2 | 75 | .B proc |
7e174651 | 76 | filesystem are read-only, |
64165e01 | 77 | but some files are writable, allowing kernel variables to be changed. |
7e174651 | 78 | .\" |
fee59977 MK |
79 | .SS Mount options |
80 | The | |
31fa1fd2 | 81 | .B proc |
fee59977 MK |
82 | filesystem supports the following mount options: |
83 | .TP | |
84 | .BR hidepid "=\fIn\fP (since Linux 3.3)" | |
85 | .\" commit 0499680a42141d86417a8fbaa8c8db806bea1201 | |
86 | This option controls who can access the information in | |
87 | .IR /proc/[pid] | |
88 | directories. | |
89 | The argument, | |
90 | .IR n , | |
91 | is one of the following values: | |
92 | .RS | |
93 | .TP 4 | |
94 | 0 | |
95 | Everybody may access all | |
96 | .IR /proc/[pid] | |
97 | directories. | |
98 | This is the traditional behavior, | |
99 | and the default if this mount option is not specified. | |
100 | .TP | |
101 | 1 | |
102 | Users may not access files and subdirectories inside any | |
103 | .IR /proc/[pid] | |
104 | directories but their own (the | |
105 | .IR /proc/[pid] | |
106 | directories themselves remain visible). | |
107 | Sensitive files such as | |
97949440 | 108 | .IR /proc/[pid]/cmdline |
fee59977 | 109 | and |
97949440 | 110 | .IR /proc/[pid]/status |
fee59977 MK |
111 | are now protected against other users. |
112 | This makes it impossible to learn whether any user is running a | |
113 | specific program | |
114 | (so long as the program doesn't otherwise reveal itself by its behavior). | |
115 | .\" As an additional bonus, since | |
97949440 | 116 | .\" .IR /proc/[pid]/cmdline |
fee59977 MK |
117 | .\" is unaccessible for other users, |
118 | .\" poorly written programs passing sensitive information via | |
119 | .\" program arguments are now protected against local eavesdroppers. | |
120 | .TP | |
121 | 2 | |
122 | As for mode 1, but in addition the | |
123 | .IR /proc/[pid] | |
124 | directories belonging to other users become invisible. | |
125 | This means that | |
126 | .IR /proc/[pid] | |
127 | entries can no longer be used to discover the PIDs on the system. | |
128 | This doesn't hide the fact that a process with a specific PID value exists | |
9bc87ed0 | 129 | (it can be learned by other means, for example, by "kill \-0 $PID"), |
fee59977 MK |
130 | but it hides a process's UID and GID, |
131 | which could otherwise be learned by employing | |
132 | .BR stat (2) | |
133 | on a | |
134 | .IR /proc/[pid] | |
135 | directory. | |
136 | This greatly complicates an attacker's task of gathering | |
137 | information about running processes (e.g., discovering whether | |
138 | some daemon is running with elevated privileges, | |
139 | whether another user is running some sensitive program, | |
140 | whether other users are running any program at all, and so on). | |
141 | .RE | |
142 | .TP | |
143 | .BR gid "=\fIgid\fP (since Linux 3.3)" | |
144 | .\" commit 0499680a42141d86417a8fbaa8c8db806bea1201 | |
145 | Specifies the ID of a group whose members are authorized to | |
146 | learn process information otherwise prohibited by | |
147 | .BR hidepid | |
95b1c1d1 | 148 | (i.e., users in this group behave as though |
fee59977 MK |
149 | .I /proc |
150 | was mounted with | |
95b1c1d1 | 151 | .IR hidepid=0 ). |
fee59977 MK |
152 | This group should be used instead of approaches such as putting |
153 | nonroot users into the | |
154 | .BR sudoers (5) | |
155 | file. | |
156 | .SS Files and directories | |
ac8727b6 | 157 | The following list describes many of the files and directories under the |
743638fd MK |
158 | .I /proc |
159 | hierarchy. | |
fea681da | 160 | .TP |
69119dc7 | 161 | .I /proc/[pid] |
fea681da MK |
162 | There is a numerical subdirectory for each running process; the |
163 | subdirectory is named by the process ID. | |
2dad4c59 | 164 | .IP |
1e6a8e2f MK |
165 | Each |
166 | .I /proc/[pid] | |
167 | subdirectory contains the | |
168 | pseudo-files and directories described below. | |
3bdb8ec5 MK |
169 | These files are normally owned by the effective user and |
170 | effective group ID of the process. | |
171 | However, as a security measure, the ownership is made | |
172 | .IR root:root | |
173 | if the process's "dumpable" attribute is set to a value other than 1. | |
174 | This attribute may change for the following reasons: | |
175 | .RS | |
176 | .IP * 3 | |
177 | The attribute was explicitly set via the | |
178 | .BR prctl (2) | |
179 | .B PR_SET_DUMPABLE | |
180 | operation. | |
181 | .IP * | |
182 | The attribute was reset to the value in the file | |
183 | .IR /proc/sys/fs/suid_dumpable | |
184 | (described below), for the reasons described in | |
185 | .BR prctl (2). | |
186 | .RE | |
187 | .IP | |
188 | Resetting the "dumpable" attribute to 1 reverts the ownership of the | |
189 | .IR /proc/[pid]/* | |
190 | files to the process's real UID and real GID. | |
b7a42567 MK |
191 | .TP |
192 | .I /proc/[pid]/attr | |
193 | .\" https://lwn.net/Articles/28222/ | |
194 | .\" From: Stephen Smalley <sds@epoch.ncsc.mil> | |
195 | .\" To: LKML and others | |
196 | .\" Subject: [RFC][PATCH] Process Attribute API for Security Modules | |
197 | .\" Date: 08 Apr 2003 16:17:52 -0400 | |
198 | .\" | |
b3fb99e8 MK |
199 | .\" http://www.nsa.gov/research/_files/selinux/papers/module/x362.shtml |
200 | .\" | |
b7a42567 MK |
201 | The files in this directory provide an API for security modules. |
202 | The contents of this directory are files that can be read and written | |
203 | in order to set security-related attributes. | |
204 | This directory was added to support SELinux, | |
205 | but the intention was that the API be general enough to support | |
206 | other security modules. | |
207 | For the purpose of explanation, | |
208 | examples of how SELinux uses these files are provided below. | |
2dad4c59 | 209 | .IP |
b7a42567 MK |
210 | This directory is present only if the kernel was configured with |
211 | .BR CONFIG_SECURITY . | |
212 | .TP | |
213 | .IR /proc/[pid]/attr/current " (since Linux 2.6.0)" | |
214 | The contents of this file represent the current | |
215 | security attributes of the process. | |
2dad4c59 | 216 | .IP |
fd44bdc7 TY |
217 | In SELinux, this file is used to get the security context of a process. |
218 | Prior to Linux 2.6.11, this file could not be used to set the security | |
219 | context (a write was always denied), since SELinux limited process security | |
220 | transitions to | |
b7a42567 MK |
221 | .BR execve (2) |
222 | (see the description of | |
223 | .IR /proc/[pid]/attr/exec , | |
224 | below). | |
fd44bdc7 TY |
225 | Since Linux 2.6.11, SELinux lifted this restriction and began supporting |
226 | "set" operations via writes to this node if authorized by policy, | |
227 | although use of this operation is only suitable for applications that are | |
228 | trusted to maintain any desired separation between the old and new security | |
b6620a25 MK |
229 | contexts. |
230 | Prior to Linux 2.6.28, SELinux did not allow threads within a | |
fd44bdc7 TY |
231 | multi-threaded process to set their security context via this node |
232 | as it would yield an inconsistency among the security contexts of the | |
b6620a25 MK |
233 | threads sharing the same memory space. |
234 | Since Linux 2.6.28, SELinux lifted | |
fd44bdc7 | 235 | this restriction and began supporting "set" operations for threads within |
b6620a25 | 236 | a multithreaded process if the new security context is bounded by the old |
fd44bdc7 TY |
237 | security context, where the bounded relation is defined in policy and |
238 | guarantees that the new security context has a subset of the permissions | |
239 | of the old security context. | |
b7a42567 MK |
240 | Other security modules may choose to support "set" operations via |
241 | writes to this node. | |
242 | .TP | |
243 | .IR /proc/[pid]/attr/exec " (since Linux 2.6.0)" | |
244 | This file represents the attributes to assign to the | |
245 | process upon a subsequent | |
246 | .BR execve (2). | |
2dad4c59 | 247 | .IP |
b7a42567 MK |
248 | In SELinux, |
249 | this is needed to support role/domain transitions, and | |
250 | .BR execve (2) | |
251 | is the preferred point to make such transitions because it offers better | |
252 | control over the initialization of the process in the new security label | |
253 | and the inheritance of state. | |
254 | In SELinux, this attribute is reset on | |
255 | .BR execve (2) | |
256 | so that the new program reverts to the default behavior for any | |
257 | .BR execve (2) | |
258 | calls that it may make. | |
259 | In SELinux, a process can set | |
260 | only its own | |
261 | .I /proc/[pid]/attr/exec | |
262 | attribute. | |
263 | .TP | |
264 | .IR /proc/[pid]/attr/fscreate " (since Linux 2.6.0)" | |
265 | This file represents the attributes to assign to files | |
266 | created by subsequent calls to | |
267 | .BR open (2), | |
268 | .BR mkdir (2), | |
269 | .BR symlink (2), | |
270 | and | |
271 | .BR mknod (2) | |
2dad4c59 | 272 | .IP |
b7a42567 MK |
273 | SELinux employs this file to support creation of a file |
274 | (using the aforementioned system calls) | |
275 | in a secure state, | |
276 | so that there is no risk of inappropriate access being obtained | |
277 | between the time of creation and the time that attributes are set. | |
278 | In SELinux, this attribute is reset on | |
279 | .BR execve (2), | |
280 | so that the new program reverts to the default behavior for | |
281 | any file creation calls it may make, but the attribute will persist | |
282 | across multiple file creation calls within a program unless it is | |
283 | explicitly reset. | |
284 | In SELinux, a process can set only its own | |
285 | .IR /proc/[pid]/attr/fscreate | |
286 | attribute. | |
287 | .TP | |
666db07e MK |
288 | .IR /proc/[pid]/attr/keycreate " (since Linux 2.6.18)" |
289 | .\" commit 4eb582cf1fbd7b9e5f466e3718a59c957e75254e | |
666db07e MK |
290 | If a process writes a security context into this file, |
291 | all subsequently created keys | |
292 | .RB ( add_key (2)) | |
293 | will be labeled with this context. | |
294 | For further information, see the kernel source file | |
6b3ead8f ES |
295 | .I Documentation/security/keys/core.rst |
296 | (or file | |
297 | .\" commit b68101a1e8f0263dbc7b8375d2a7c57c6216fb76 | |
298 | .I Documentation/security/keys.txt | |
299 | on Linux between 3.0 and 4.13, or | |
300 | .\" commit d410fa4ef99112386de5f218dd7df7b4fca910b4 | |
301 | .I Documentation/keys.txt | |
302 | before Linux 3.0). | |
2702dc21 | 303 | .TP |
93401860 MK |
304 | .IR /proc/[pid]/attr/prev " (since Linux 2.6.0)" |
305 | This file contains the security context of the process before the last | |
306 | .BR execve (2); | |
307 | that is, the previous value of | |
308 | .IR /proc/[pid]/attr/current . | |
309 | .TP | |
2702dc21 MK |
310 | .IR /proc/[pid]/attr/socketcreate " (since Linux 2.6.18)" |
311 | .\" commit 42c3e03ef6b298813557cdb997bd6db619cd65a2 | |
312 | If a process writes a security context into this file, | |
313 | all subsequently created sockets will be labeled with this context. | |
39b35179 MK |
314 | .TP |
315 | .IR /proc/[pid]/autogroup " (since Linux 2.6.38)" | |
316 | .\" commit 5091faa449ee0b7d73bc296a93bca9540fc51d0a | |
317 | See | |
318 | .BR sched (7). | |
fea681da | 319 | .TP |
69119dc7 | 320 | .IR /proc/[pid]/auxv " (since 2.6.0-test7)" |
857f1942 | 321 | This contains the contents of the ELF interpreter information passed |
c13182ef | 322 | to the process at exec time. |
857f1942 | 323 | The format is one \fIunsigned long\fP ID |
c13182ef | 324 | plus one \fIunsigned long\fP value for each entry. |
857f1942 | 325 | The last entry contains two zeros. |
4c69c692 MK |
326 | See also |
327 | .BR getauxval (3). | |
2dad4c59 | 328 | .IP |
82664739 MK |
329 | Permission to access this file is governed by a ptrace access mode |
330 | .B PTRACE_MODE_READ_FSCREDS | |
331 | check; see | |
332 | .BR ptrace (2). | |
b5d204d0 | 333 | .TP |
8d708d6b | 334 | .IR /proc/[pid]/cgroup " (since Linux 2.6.24)" |
5c2181ad MK |
335 | See |
336 | .BR cgroups (7). | |
76e0451c MK |
337 | .TP |
338 | .IR /proc/[pid]/clear_refs " (since Linux 2.6.22)" | |
339 | .\" commit b813e931b4c8235bb42e301096ea97dbdee3e8fe (2.6.22) | |
340 | .\" commit 398499d5f3613c47f2143b8c54a04efb5d7a6da9 (2.6.32) | |
341 | .\" commit 040fa02077de01c7e08fa75be6125e4ca5636011 (3.11) | |
b4e9ee8f | 342 | .\" |
b4e9ee8f | 343 | .\" "Clears page referenced bits shown in smaps output" |
76e0451c | 344 | .\" write-only, writable only by the owner of the process |
2dad4c59 | 345 | .IP |
76e0451c | 346 | This is a write-only file, writable only by owner of the process. |
2dad4c59 | 347 | .IP |
76e0451c MK |
348 | The following values may be written to the file: |
349 | .RS | |
350 | .TP | |
351 | 1 (since Linux 2.6.22) | |
352 | .\" Internally: CLEAR_REFS_ALL | |
353 | Reset the PG_Referenced and ACCESSED/YOUNG | |
354 | bits for all the pages associated with the process. | |
355 | (Before kernel 2.6.32, writing any nonzero value to this file | |
356 | had this effect.) | |
357 | .TP | |
358 | 2 (since Linux 2.6.32) | |
359 | .\" Internally: CLEAR_REFS_ANON | |
360 | Reset the PG_Referenced and ACCESSED/YOUNG | |
361 | bits for all anonymous pages associated with the process. | |
362 | .TP | |
363 | 3 (since Linux 2.6.32) | |
364 | .\" Internally: CLEAR_REFS_MAPPED | |
365 | Reset the PG_Referenced and ACCESSED/YOUNG | |
366 | bits for all file-mapped pages associated with the process. | |
367 | .RE | |
368 | .IP | |
369 | Clearing the PG_Referenced and ACCESSED/YOUNG bits provides a method | |
370 | to measure approximately how much memory a process is using. | |
322d49fb | 371 | One first inspects the values in the "Referenced" fields |
76e0451c MK |
372 | for the VMAs shown in |
373 | .IR /proc/[pid]/smaps | |
374 | to get an idea of the memory footprint of the | |
375 | process. | |
376 | One then clears the PG_Referenced and ACCESSED/YOUNG bits | |
377 | and, after some measured time interval, | |
322d49fb | 378 | once again inspects the values in the "Referenced" fields |
76e0451c MK |
379 | to get an idea of the change in memory footprint of the |
380 | process during the measured interval. | |
381 | If one is interested only in inspecting the selected mapping types, | |
382 | then the value 2 or 3 can be used instead of 1. | |
2dad4c59 | 383 | .IP |
dfdf642e | 384 | Further values can be written to affect different properties: |
76e0451c MK |
385 | .RS |
386 | .TP | |
387 | 4 (since Linux 3.11) | |
388 | Clear the soft-dirty bit for all the pages associated with the process. | |
389 | .\" Internally: CLEAR_REFS_SOFT_DIRTY | |
390 | This is used (in conjunction with | |
391 | .IR /proc/[pid]/pagemap ) | |
392 | by the check-point restore system to discover which pages of a process | |
393 | have been dirtied since the file | |
394 | .IR /proc/[pid]/clear_refs | |
395 | was written to. | |
dfdf642e NK |
396 | .TP |
397 | 5 (since Linux 4.0) | |
398 | .\" Internally: CLEAR_REFS_MM_HIWATER_RSS | |
0989246e MK |
399 | Reset the peak resident set size ("high water mark") to the process's |
400 | current resident set size value. | |
76e0451c MK |
401 | .RE |
402 | .IP | |
403 | Writing any value to | |
404 | .IR /proc/[pid]/clear_refs | |
405 | other than those listed above has no effect. | |
2dad4c59 | 406 | .IP |
76e0451c MK |
407 | The |
408 | .IR /proc/[pid]/clear_refs | |
409 | file is present only if the | |
410 | .B CONFIG_PROC_PAGE_MONITOR | |
411 | kernel configuration option is enabled. | |
857f1942 | 412 | .TP |
69119dc7 | 413 | .I /proc/[pid]/cmdline |
6975c16e | 414 | This read-only file holds the complete command line for the process, |
b447cd58 MK |
415 | unless the process is a zombie. |
416 | .\" In 2.3.26, this also used to be true if the process was swapped out. | |
417 | In the latter case, there is nothing in this file: | |
75b94dc3 | 418 | that is, a read on this file will return 0 characters. |
b447cd58 | 419 | The command-line arguments appear in this file as a set of |
6596d270 MK |
420 | strings separated by null bytes (\(aq\\0\(aq), |
421 | with a further null byte after the last string. | |
32d7ef00 MK |
422 | .TP |
423 | .IR /proc/[pid]/comm " (since Linux 2.6.33)" | |
424 | .\" commit 4614a696bd1c3a9af3a08f0e5874830a85b889d4 | |
425 | This file exposes the process's | |
426 | .I comm | |
427 | value\(emthat is, the command name associated with the process. | |
428 | Different threads in the same process may have different | |
429 | .I comm | |
430 | values, accessible via | |
431 | .IR /proc/[pid]/task/[tid]/comm . | |
432 | A thread may modify its | |
433 | .I comm | |
434 | value, or that of any of other thread in the same thread group (see | |
435 | the discussion of | |
436 | .B CLONE_THREAD | |
437 | in | |
438 | .BR clone (2)), | |
439 | by writing to the file | |
440 | .IR /proc/self/task/[tid]/comm . | |
441 | Strings longer than | |
442 | .B TASK_COMM_LEN | |
443 | (16) characters are silently truncated. | |
2dad4c59 | 444 | .IP |
ef4f4031 | 445 | This file provides a superset of the |
32d7ef00 MK |
446 | .BR prctl (2) |
447 | .B PR_SET_NAME | |
448 | and | |
449 | .B PR_GET_NAME | |
450 | operations, and is employed by | |
451 | .BR pthread_setname_np (3) | |
452 | when used to rename threads other than the caller. | |
fea681da | 453 | .TP |
7e07d950 | 454 | .IR /proc/[pid]/coredump_filter " (since Linux 2.6.23)" |
b4e9ee8f MK |
455 | See |
456 | .BR core (5). | |
5c411b17 | 457 | .TP |
7e07d950 MK |
458 | .IR /proc/[pid]/cpuset " (since Linux 2.6.12)" |
459 | .\" and/proc/[pid]/task/[tid]/cpuset | |
5c411b17 MK |
460 | See |
461 | .BR cpuset (7). | |
b4e9ee8f | 462 | .TP |
69119dc7 | 463 | .I /proc/[pid]/cwd |
c13182ef | 464 | This is a symbolic link to the current working directory of the process. |
59a40ed7 MK |
465 | To find out the current working directory of process 20, |
466 | for instance, you can do this: | |
2dad4c59 | 467 | .IP |
59a40ed7 | 468 | .in +4n |
37d5e699 | 469 | .EX |
b43a3b30 | 470 | .RB "$" " cd /proc/20/cwd; /bin/pwd" |
37d5e699 | 471 | .EE |
59a40ed7 | 472 | .in |
2dad4c59 | 473 | .IP |
c13182ef MK |
474 | Note that the |
475 | .I pwd | |
e7b489f0 | 476 | command is often a shell built-in, and might |
c13182ef | 477 | not work properly. |
743638fd MK |
478 | In |
479 | .BR bash (1), | |
480 | you may use | |
481 | .IR "pwd\ \-P" . | |
2dad4c59 | 482 | .IP |
afcaf646 | 483 | .\" The following was still true as at kernel 2.6.13 |
c13182ef MK |
484 | In a multithreaded process, the contents of this symbolic link |
485 | are not available if the main thread has already terminated | |
afcaf646 | 486 | (typically by calling |
59a40ed7 | 487 | .BR pthread_exit (3)). |
2dad4c59 | 488 | .IP |
b902fe18 MK |
489 | Permission to dereference or read |
490 | .RB ( readlink (2)) | |
491 | this symbolic link is governed by a ptrace access mode | |
492 | .B PTRACE_MODE_READ_FSCREDS | |
493 | check; see | |
494 | .BR ptrace (2). | |
fea681da | 495 | .TP |
69119dc7 | 496 | .I /proc/[pid]/environ |
09651080 MK |
497 | This file contains the initial environment that was set |
498 | when the currently executing program was started via | |
499 | .BR execve (2). | |
f81fb444 | 500 | The entries are separated by null bytes (\(aq\\0\(aq), |
b4e9ee8f | 501 | and there may be a null byte at the end. |
fea681da | 502 | Thus, to print out the environment of process 1, you would do: |
37d5e699 | 503 | .IP |
a08ea57c | 504 | .in +4n |
37d5e699 | 505 | .EX |
13912780 | 506 | .RB "$" " strings /proc/1/environ" |
37d5e699 | 507 | .EE |
a08ea57c | 508 | .in |
2dad4c59 | 509 | .IP |
09651080 MK |
510 | If, after an |
511 | .BR execve (2), | |
512 | the process modifies its environment | |
c187d2a1 | 513 | (e.g., by calling functions such as |
387e2438 MF |
514 | .BR putenv (3) |
515 | or modifying the | |
516 | .BR environ (7) | |
517 | variable directly), | |
09651080 MK |
518 | this file will |
519 | .I not | |
520 | reflect those changes. | |
2dad4c59 | 521 | .IP |
c187d2a1 | 522 | Furthermore, a process may change the memory location that this file refers via |
387e2438 | 523 | .BR prctl (2) |
c187d2a1 | 524 | operations such as |
387e2438 | 525 | .BR PR_SET_MM_ENV_START . |
2dad4c59 | 526 | .IP |
82664739 MK |
527 | Permission to access this file is governed by a ptrace access mode |
528 | .B PTRACE_MODE_READ_FSCREDS | |
529 | check; see | |
530 | .BR ptrace (2). | |
fea681da | 531 | .TP |
69119dc7 | 532 | .I /proc/[pid]/exe |
fea681da | 533 | Under Linux 2.2 and later, this file is a symbolic link |
2d7195b8 | 534 | containing the actual pathname of the executed command. |
c13182ef MK |
535 | This symbolic link can be dereferenced normally; attempting to open |
536 | it will open the executable. | |
537 | You can even type | |
69119dc7 | 538 | .I /proc/[pid]/exe |
06dd061c | 539 | to run another copy of the same executable that is being run by |
69119dc7 | 540 | process [pid]. |
7e3c767a GJ |
541 | If the pathname has been unlinked, the symbolic link will contain the |
542 | string \(aq(deleted)\(aq appended to the original pathname. | |
afcaf646 | 543 | .\" The following was still true as at kernel 2.6.13 |
c13182ef MK |
544 | In a multithreaded process, the contents of this symbolic link |
545 | are not available if the main thread has already terminated | |
afcaf646 MK |
546 | (typically by calling |
547 | .BR pthread_exit (3)). | |
2dad4c59 | 548 | .IP |
b902fe18 MK |
549 | Permission to dereference or read |
550 | .RB ( readlink (2)) | |
551 | this symbolic link is governed by a ptrace access mode | |
552 | .B PTRACE_MODE_READ_FSCREDS | |
553 | check; see | |
554 | .BR ptrace (2). | |
2dad4c59 | 555 | .IP |
eb9a0b2f | 556 | Under Linux 2.0 and earlier, |
69119dc7 | 557 | .I /proc/[pid]/exe |
c13182ef MK |
558 | is a pointer to the binary which was executed, |
559 | and appears as a symbolic link. | |
560 | A | |
fea681da MK |
561 | .BR readlink (2) |
562 | call on this file under Linux 2.0 returns a string in the format: | |
2dad4c59 | 563 | .IP |
59a40ed7 | 564 | [device]:inode |
2dad4c59 | 565 | .IP |
fea681da MK |
566 | For example, [0301]:1502 would be inode 1502 on device major 03 (IDE, |
567 | MFM, etc. drives) minor 01 (first partition on the first drive). | |
2dad4c59 | 568 | .IP |
fea681da | 569 | .BR find (1) |
59a40ed7 MK |
570 | with the |
571 | .I \-inum | |
572 | option can be used to locate the file. | |
fea681da | 573 | .TP |
d4529654 | 574 | .I /proc/[pid]/fd/ |
fea681da MK |
575 | This is a subdirectory containing one entry for each file which the |
576 | process has open, named by its file descriptor, and which is a | |
c13182ef | 577 | symbolic link to the actual file. |
f78ed33a | 578 | Thus, 0 is standard input, 1 standard output, 2 standard error, and so on. |
2dad4c59 | 579 | .IP |
f75715e0 MK |
580 | For file descriptors for pipes and sockets, |
581 | the entries will be symbolic links whose content is the | |
582 | file type with the inode. | |
d4529654 MF |
583 | A |
584 | .BR readlink (2) | |
585 | call on this file returns a string in the format: | |
2dad4c59 | 586 | .IP |
d4529654 | 587 | type:[inode] |
2dad4c59 | 588 | .IP |
f75715e0 MK |
589 | For example, |
590 | .I socket:[2248868] | |
591 | will be a socket and its inode is 2248868. | |
592 | For sockets, that inode can be used to find more information | |
593 | in one of the files under | |
d4529654 | 594 | .IR /proc/net/ . |
2dad4c59 | 595 | .IP |
2b7a2ac5 MK |
596 | For file descriptors that have no corresponding inode |
597 | (e.g., file descriptors produced by | |
89e284a2 | 598 | .BR bpf (2), |
2b7a2ac5 MK |
599 | .BR epoll_create (2), |
600 | .BR eventfd (2), | |
601 | .BR inotify_init (2), | |
89e284a2 | 602 | .BR perf_event_open (2), |
2b7a2ac5 | 603 | .BR signalfd (2), |
89e284a2 | 604 | .BR timerfd_create (2), |
2b7a2ac5 | 605 | and |
e8675558 | 606 | .BR userfaultfd (2)), |
2b7a2ac5 | 607 | the entry will be a symbolic link with contents of the form |
2dad4c59 | 608 | .IP |
2b7a2ac5 | 609 | anon_inode:<file-type> |
2dad4c59 | 610 | .IP |
e2a5929d | 611 | In many cases (but not all), the |
2b7a2ac5 MK |
612 | .I file-type |
613 | is surrounded by square brackets. | |
2dad4c59 | 614 | .IP |
2b7a2ac5 MK |
615 | For example, an epoll file descriptor will have a symbolic link |
616 | whose content is the string | |
617 | .IR "anon_inode:[eventpoll]" . | |
2dad4c59 | 618 | .IP |
d4529654 | 619 | .\"The following was still true as at kernel 2.6.13 |
afcaf646 | 620 | In a multithreaded process, the contents of this directory |
c13182ef | 621 | are not available if the main thread has already terminated |
afcaf646 MK |
622 | (typically by calling |
623 | .BR pthread_exit (3)). | |
2dad4c59 | 624 | .IP |
20c1a631 MK |
625 | Programs that take a filename as a command-line argument, |
626 | but don't take input from standard input if no argument is supplied, | |
627 | and programs that write to a file named as a command-line argument, | |
628 | but don't send their output to standard output | |
59a40ed7 | 629 | if no argument is supplied, can nevertheless be made to use |
20c1a631 MK |
630 | standard input or standard output by using |
631 | .IR /proc/[pid]/fd | |
632 | files as command-line arguments. | |
59a40ed7 MK |
633 | For example, assuming that |
634 | .I \-i | |
635 | is the flag designating an input file and | |
636 | .I \-o | |
637 | is the flag designating an output file: | |
37d5e699 | 638 | .IP |
a08ea57c | 639 | .in +4n |
37d5e699 | 640 | .EX |
b43a3b30 | 641 | .RB "$" " foobar \-i /proc/self/fd/0 \-o /proc/self/fd/1 ..." |
37d5e699 | 642 | .EE |
a08ea57c | 643 | .in |
2dad4c59 | 644 | .IP |
fea681da MK |
645 | and you have a working filter. |
646 | .\" The following is not true in my tests (MTK): | |
647 | .\" Note that this will not work for | |
648 | .\" programs that seek on their files, as the files in the fd directory | |
649 | .\" are not seekable. | |
2dad4c59 | 650 | .IP |
59a40ed7 MK |
651 | .I /proc/self/fd/N |
652 | is approximately the same as | |
653 | .I /dev/fd/N | |
008f1ecc | 654 | in some UNIX and UNIX-like systems. |
c13182ef | 655 | Most Linux MAKEDEV scripts symbolically link |
59a40ed7 MK |
656 | .I /dev/fd |
657 | to | |
658 | .IR /proc/self/fd , | |
659 | in fact. | |
2dad4c59 | 660 | .IP |
59a40ed7 MK |
661 | Most systems provide symbolic links |
662 | .IR /dev/stdin , | |
663 | .IR /dev/stdout , | |
664 | and | |
665 | .IR /dev/stderr , | |
666 | which respectively link to the files | |
667 | .IR 0 , | |
668 | .IR 1 , | |
669 | and | |
670 | .IR 2 | |
671 | in | |
672 | .IR /proc/self/fd . | |
673 | Thus the example command above could be written as: | |
d6bd89f3 | 674 | .IP |
59a40ed7 | 675 | .in +4n |
37d5e699 | 676 | .EX |
b43a3b30 | 677 | .RB "$" " foobar \-i /dev/stdin \-o /dev/stdout ..." |
37d5e699 | 678 | .EE |
59a40ed7 | 679 | .in |
138a191e MK |
680 | .IP |
681 | Permission to dereference or read | |
682 | .RB ( readlink (2)) | |
683 | the symbolic links in this directory is governed by a ptrace access mode | |
684 | .B PTRACE_MODE_READ_FSCREDS | |
685 | check; see | |
686 | .BR ptrace (2). | |
81c8aeb6 LW |
687 | .IP |
688 | Note that for file descriptors referring to inodes (pipes and sockets, see above), | |
689 | those inodes still have permission bits and ownership information | |
690 | distinct from those of the | |
691 | .I /proc/[pid]/fd | |
692 | entry, | |
693 | and that the owner may differ from the user and group IDs of the process. | |
694 | An unprivileged process may lack permissions to open them, as in this example: | |
695 | .IP | |
696 | .in +4n | |
697 | .EX | |
698 | .RB "$" " echo test | sudo -u nobody cat" | |
699 | test | |
700 | .RB "$" " echo test | sudo -u nobody cat /proc/self/fd/0" | |
701 | cat: /proc/self/fd/0: Permission denied | |
702 | .EE | |
703 | .in | |
704 | .IP | |
705 | File descriptor 0 refers to the pipe created by the shell | |
706 | and owned by that shell's user, which is not | |
707 | .IR nobody , | |
708 | so | |
709 | .B cat | |
710 | does not have permission to create a new file descriptor to read from that inode, | |
711 | even though it can still read from its existing file descriptor 0. | |
69ab425e | 712 | .TP |
7e07d950 | 713 | .IR /proc/[pid]/fdinfo/ " (since Linux 2.6.22)" |
69ab425e MK |
714 | This is a subdirectory containing one entry for each file which the |
715 | process has open, named by its file descriptor. | |
0275956d | 716 | The files in this directory are readable only by the owner of the process. |
69ab425e | 717 | The contents of each file can be read to obtain information |
0275956d MK |
718 | about the corresponding file descriptor. |
719 | The content depends on the type of file referred to by the | |
d9cb0d7d | 720 | corresponding file descriptor. |
2dad4c59 | 721 | .IP |
0275956d | 722 | For regular files and directories, we see something like: |
37d5e699 | 723 | .IP |
69ab425e | 724 | .in +4n |
37d5e699 | 725 | .EX |
69ab425e MK |
726 | .RB "$" " cat /proc/12015/fdinfo/4" |
727 | pos: 1000 | |
728 | flags: 01002002 | |
0275956d | 729 | mnt_id: 21 |
37d5e699 | 730 | .EE |
69ab425e | 731 | .in |
2dad4c59 | 732 | .IP |
9599cbb3 MK |
733 | The fields are as follows: |
734 | .RS | |
735 | .TP | |
69ab425e | 736 | .I pos |
9599cbb3 MK |
737 | This is a decimal number showing the file offset. |
738 | .TP | |
69ab425e | 739 | .I flags |
9599cbb3 | 740 | This is an octal number that displays the |
69ab425e MK |
741 | file access mode and file status flags (see |
742 | .BR open (2)). | |
d7e537ce MK |
743 | If the close-on-exec file descriptor flag is set, then |
744 | .I flags | |
745 | will also include the value | |
746 | .BR O_CLOEXEC . | |
2dad4c59 | 747 | .IP |
d7e537ce MK |
748 | Before Linux 3.1, |
749 | .\" commit 1117f72ea0217ba0cc19f05adbbd8b9a397f5ab7 | |
750 | this field incorrectly displayed the setting of | |
751 | .B O_CLOEXEC | |
752 | at the time the file was opened, | |
753 | rather than the current setting of the close-on-exec flag. | |
9599cbb3 MK |
754 | .TP |
755 | .I | |
0275956d | 756 | .I mnt_id |
9599cbb3 | 757 | This field, present since Linux 3.15, |
0275956d MK |
758 | .\" commit 49d063cb353265c3af701bab215ac438ca7df36d |
759 | is the ID of the mount point containing this file. | |
760 | See the description of | |
761 | .IR /proc/[pid]/mountinfo . | |
9599cbb3 MK |
762 | .RE |
763 | .IP | |
6e7622ee MK |
764 | For eventfd file descriptors (see |
765 | .BR eventfd (2)), | |
b6a7fd50 MK |
766 | we see (since Linux 3.8) |
767 | .\" commit cbac5542d48127b546a23d816380a7926eee1c25 | |
768 | the following fields: | |
2dad4c59 | 769 | .IP |
6e7622ee | 770 | .in +4n |
37d5e699 | 771 | .EX |
6e7622ee MK |
772 | pos: 0 |
773 | flags: 02 | |
774 | mnt_id: 10 | |
775 | eventfd-count: 40 | |
37d5e699 | 776 | .EE |
6e7622ee | 777 | .in |
2dad4c59 | 778 | .IP |
6e7622ee MK |
779 | .I eventfd-count |
780 | is the current value of the eventfd counter, in hexadecimal. | |
2dad4c59 | 781 | .IP |
58d375dd MK |
782 | For epoll file descriptors (see |
783 | .BR epoll (7)), | |
b6a7fd50 MK |
784 | we see (since Linux 3.8) |
785 | .\" commit 138d22b58696c506799f8de759804083ff9effae | |
786 | the following fields: | |
2dad4c59 | 787 | .IP |
58d375dd | 788 | .in +4n |
37d5e699 | 789 | .EX |
58d375dd MK |
790 | pos: 0 |
791 | flags: 02 | |
792 | mnt_id: 10 | |
793 | tfd: 9 events: 19 data: 74253d2500000009 | |
794 | tfd: 7 events: 19 data: 74253d2500000007 | |
37d5e699 | 795 | .EE |
58d375dd | 796 | .in |
2dad4c59 | 797 | .IP |
58d375dd MK |
798 | Each of the lines beginning |
799 | .I tfd | |
800 | describes one of the file descriptors being monitored via | |
801 | the epoll file descriptor (see | |
802 | .BR epoll_ctl (2) | |
803 | for some details). | |
804 | The | |
805 | .IR tfd | |
806 | field is the number of the file descriptor. | |
807 | The | |
808 | .I events | |
809 | field is a hexadecimal mask of the events being monitored for this file | |
810 | descriptor. | |
811 | The | |
812 | .I data | |
813 | field is the data value associated with this file descriptor. | |
2dad4c59 | 814 | .IP |
f8a14cac MK |
815 | For signalfd file descriptors (see |
816 | .BR signalfd (2)), | |
b6a7fd50 MK |
817 | we see (since Linux 3.8) |
818 | .\" commit 138d22b58696c506799f8de759804083ff9effae | |
819 | the following fields: | |
2dad4c59 | 820 | .IP |
f8a14cac | 821 | .in +4n |
37d5e699 | 822 | .EX |
f8a14cac MK |
823 | pos: 0 |
824 | flags: 02 | |
825 | mnt_id: 10 | |
826 | sigmask: 0000000000000006 | |
37d5e699 | 827 | .EE |
f8a14cac | 828 | .in |
2dad4c59 | 829 | .IP |
f8a14cac MK |
830 | .I sigmask |
831 | is the hexadecimal mask of signals that are accepted via this | |
832 | signalfd file descriptor. | |
833 | (In this example, bits 2 and 3 are set, corresponding to the signals | |
834 | .B SIGINT | |
835 | and | |
836 | .BR SIGQUIT ; | |
837 | see | |
838 | .BR signal (7).) | |
2dad4c59 | 839 | .IP |
4e77145c MK |
840 | For inotify file descriptors (see |
841 | .BR inotify (7)), | |
842 | we see (since Linux 3.8) | |
843 | the following fields: | |
2dad4c59 | 844 | .IP |
4e77145c | 845 | .in +4n |
37d5e699 | 846 | .EX |
4e77145c MK |
847 | pos: 0 |
848 | flags: 00 | |
849 | mnt_id: 11 | |
850 | inotify wd:2 ino:7ef82a sdev:800001 mask:800afff ignored_mask:0 fhandle-bytes:8 fhandle-type:1 f_handle:2af87e00220ffd73 | |
851 | inotify wd:1 ino:192627 sdev:800001 mask:800afff ignored_mask:0 fhandle-bytes:8 fhandle-type:1 f_handle:27261900802dfd73 | |
37d5e699 | 852 | .EE |
4e77145c | 853 | .in |
2dad4c59 | 854 | .IP |
4e77145c MK |
855 | Each of the lines beginning with "inotify" displays information about |
856 | one file or directory that is being monitored. | |
857 | The fields in this line are as follows: | |
858 | .RS | |
859 | .TP | |
860 | .I wd | |
861 | A watch descriptor number (in decimal). | |
862 | .TP | |
863 | .I ino | |
864 | The inode number of the target file (in hexadecimal). | |
865 | .TP | |
866 | .I sdev | |
867 | The ID of the device where the target file resides (in hexadecimal). | |
868 | .TP | |
869 | .I mask | |
870 | The mask of events being monitored for the target file (in hexadecimal). | |
871 | .RE | |
872 | .IP | |
873 | If the kernel was built with exportfs support, the path to the target | |
874 | file is exposed as a file handle, via three hexadecimal fields: | |
875 | .IR fhandle-bytes , | |
876 | .IR fhandle-type , | |
877 | and | |
878 | .IR f_handle . | |
2dad4c59 | 879 | .IP |
e2444bcb MK |
880 | For fanotify file descriptors (see |
881 | .BR fanotify (7)), | |
882 | we see (since Linux 3.8) | |
883 | the following fields: | |
2dad4c59 | 884 | .IP |
e2444bcb | 885 | .in +4n |
37d5e699 | 886 | .EX |
e2444bcb MK |
887 | pos: 0 |
888 | flags: 02 | |
889 | mnt_id: 11 | |
890 | fanotify flags:0 event-flags:88002 | |
891 | fanotify ino:19264f sdev:800001 mflags:0 mask:1 ignored_mask:0 fhandle-bytes:8 fhandle-type:1 f_handle:4f261900a82dfd73 | |
37d5e699 | 892 | .EE |
e2444bcb | 893 | .in |
2dad4c59 | 894 | .IP |
e2444bcb MK |
895 | The fourth line displays information defined when the fanotify group |
896 | was created via | |
897 | .BR fanotify_init (2): | |
898 | .RS | |
899 | .TP | |
900 | .I flags | |
901 | The | |
902 | .I flags | |
903 | argument given to | |
904 | .BR fanotify_init (2) | |
905 | (expressed in hexadecimal). | |
906 | .TP | |
907 | .I event-flags | |
908 | The | |
909 | .I event_f_flags | |
910 | argument given to | |
911 | .BR fanotify_init (2) | |
912 | (expressed in hexadecimal). | |
913 | .RE | |
914 | .IP | |
915 | Each additional line shown in the file contains information | |
916 | about one of the marks in the fanotify group. | |
917 | Most of these fields are as for inotify, except: | |
918 | .RS | |
919 | .TP | |
920 | .I mflags | |
921 | The flags associated with the mark | |
922 | (expressed in hexadecimal). | |
923 | .TP | |
924 | .I mask | |
925 | The events mask for this mark | |
926 | (expressed in hexadecimal). | |
927 | .TP | |
928 | .I ignored_mask | |
929 | The mask of events that are ignored for this mark | |
930 | (expressed in hexadecimal). | |
931 | .RE | |
932 | .IP | |
933 | For details on these fields, see | |
934 | .BR fanotify_mark (2). | |
0ca2fc4d | 935 | .TP |
93401860 MK |
936 | .IR /proc/[pid]/gid_map " (since Linux 3.5)" |
937 | See | |
938 | .BR user_namespaces (7). | |
939 | .TP | |
0ca2fc4d | 940 | .IR /proc/[pid]/io " (since kernel 2.6.20)" |
68f11066 MK |
941 | .\" commit 7c3ab7381e79dfc7db14a67c6f4f3285664e1ec2 |
942 | This file contains I/O statistics for the process, for example: | |
37d5e699 | 943 | .IP |
0ca2fc4d | 944 | .in +4n |
37d5e699 | 945 | .EX |
0ca2fc4d PS |
946 | .RB "#" " cat /proc/3828/io" |
947 | rchar: 323934931 | |
948 | wchar: 323929600 | |
949 | syscr: 632687 | |
950 | syscw: 632675 | |
951 | read_bytes: 0 | |
952 | write_bytes: 323932160 | |
953 | cancelled_write_bytes: 0 | |
37d5e699 | 954 | .EE |
0ca2fc4d | 955 | .in |
2dad4c59 | 956 | .IP |
0ca2fc4d PS |
957 | The fields are as follows: |
958 | .RS | |
68f11066 MK |
959 | .TP |
960 | .IR rchar ": characters read" | |
0ca2fc4d PS |
961 | The number of bytes which this task has caused to be read from storage. |
962 | This is simply the sum of bytes which this process passed to | |
963 | .BR read (2) | |
68f11066 | 964 | and similar system calls. |
11256884 | 965 | It includes things such as terminal I/O and |
68f11066 MK |
966 | is unaffected by whether or not actual |
967 | physical disk I/O was required (the read might have been satisfied from | |
0ca2fc4d | 968 | pagecache). |
68f11066 MK |
969 | .TP |
970 | .IR wchar ": characters written" | |
0ca2fc4d PS |
971 | The number of bytes which this task has caused, or shall cause to be written |
972 | to disk. | |
973 | Similar caveats apply here as with | |
974 | .IR rchar . | |
68f11066 MK |
975 | .TP |
976 | .IR syscr ": read syscalls" | |
977 | Attempt to count the number of read I/O operations\(emthat is, | |
978 | system calls such as | |
0ca2fc4d PS |
979 | .BR read (2) |
980 | and | |
981 | .BR pread (2). | |
68f11066 MK |
982 | .TP |
983 | .IR syscw ": write syscalls" | |
984 | Attempt to count the number of write I/O operations\(emthat is, | |
985 | system calls such as | |
0ca2fc4d PS |
986 | .BR write (2) |
987 | and | |
988 | .BR pwrite (2). | |
68f11066 MK |
989 | .TP |
990 | .IR read_bytes ": bytes read" | |
0ca2fc4d PS |
991 | Attempt to count the number of bytes which this process really did cause to |
992 | be fetched from the storage layer. | |
993 | This is accurate for block-backed filesystems. | |
68f11066 MK |
994 | .TP |
995 | .IR write_bytes ": bytes written" | |
0ca2fc4d PS |
996 | Attempt to count the number of bytes which this process caused to be sent to |
997 | the storage layer. | |
68f11066 | 998 | .TP |
0ca2fc4d | 999 | .IR cancelled_write_bytes : |
0ca2fc4d PS |
1000 | The big inaccuracy here is truncate. |
1001 | If a process writes 1MB to a file and then deletes the file, | |
1002 | it will in fact perform no writeout. | |
1003 | But it will have been accounted as having caused 1MB of write. | |
68f11066 | 1004 | In other words: this field represents the number of bytes which this process |
0ca2fc4d | 1005 | caused to not happen, by truncating pagecache. |
68f11066 | 1006 | A task can cause "negative" I/O too. |
0ca2fc4d | 1007 | If this task truncates some dirty pagecache, |
68f11066 MK |
1008 | some I/O which another task has been accounted for |
1009 | (in its | |
1010 | .IR write_bytes ) | |
1011 | will not be happening. | |
1012 | .RE | |
0ca2fc4d PS |
1013 | .IP |
1014 | .IR Note : | |
68f11066 | 1015 | In the current implementation, things are a bit racy on 32-bit systems: |
0ca2fc4d PS |
1016 | if process A reads process B's |
1017 | .I /proc/[pid]/io | |
68f11066 | 1018 | while process B is updating one of these 64-bit counters, |
0ca2fc4d | 1019 | process A could see an intermediate result. |
2dad4c59 | 1020 | .IP |
d8e2972a MK |
1021 | Permission to access this file is governed by a ptrace access mode |
1022 | .B PTRACE_MODE_READ_FSCREDS | |
1023 | check; see | |
1024 | .BR ptrace (2). | |
f6e17121 | 1025 | .TP |
7e07d950 | 1026 | .IR /proc/[pid]/limits " (since Linux 2.6.24)" |
69ab425e MK |
1027 | This file displays the soft limit, hard limit, and units of measurement |
1028 | for each of the process's resource limits (see | |
1029 | .BR getrlimit (2)). | |
1030 | Up to and including Linux 2.6.35, | |
1031 | this file is protected to allow reading only by the real UID of the process. | |
1032 | Since Linux 2.6.36, | |
1033 | .\" commit 3036e7b490bf7878c6dae952eec5fb87b1106589 | |
1034 | this file is readable by all users on the system. | |
df2a8576 MK |
1035 | .\" FIXME Describe /proc/[pid]/loginuid |
1036 | .\" Added in 2.6.11; updating requires CAP_AUDIT_CONTROL | |
1037 | .\" CONFIG_AUDITSYSCALL | |
b4f89985 PE |
1038 | .TP |
1039 | .IR /proc/[pid]/map_files/ " (since kernel 3.3) | |
18cdd0ac MK |
1040 | .\" commit 640708a2cff7f81e246243b0073c66e6ece7e53e |
1041 | This subdirectory contains entries corresponding to memory-mapped | |
b4f89985 PE |
1042 | files (see |
1043 | .BR mmap (2)). | |
18cdd0ac MK |
1044 | Entries are named by memory region start and end |
1045 | address pair (expressed as hexadecimal numbers), | |
1046 | and are symbolic links to the mapped files themselves. | |
1047 | Here is an example, with the output wrapped and reformatted to fit on an 80-column display: | |
37d5e699 | 1048 | .IP |
b4f89985 | 1049 | .in +4n |
37d5e699 | 1050 | .EX |
f2aa4dcc | 1051 | .RB "#" " ls -l /proc/self/map_files/" |
18cdd0ac | 1052 | lr\-\-\-\-\-\-\-\-. 1 root root 64 Apr 16 21:31 |
9bc87ed0 | 1053 | 3252e00000\-3252e20000 \-> /usr/lib64/ld\-2.15.so |
b4f89985 | 1054 | \&... |
37d5e699 | 1055 | .EE |
b4f89985 | 1056 | .in |
2dad4c59 | 1057 | .IP |
b4f89985 | 1058 | Although these entries are present for memory regions that were |
d6a56978 | 1059 | mapped with the |
b4f89985 | 1060 | .BR MAP_FILE |
18cdd0ac | 1061 | flag, the way anonymous shared memory (regions created with the |
b4f89985 PE |
1062 | .B MAP_ANON | MAP_SHARED |
1063 | flags) | |
1064 | is implemented in Linux | |
18cdd0ac MK |
1065 | means that such regions also appear on this directory. |
1066 | Here is an example where the target file is the deleted | |
1067 | .I /dev/zero | |
1068 | one: | |
37d5e699 | 1069 | .IP |
b4f89985 | 1070 | .in +4n |
37d5e699 | 1071 | .EX |
18cdd0ac MK |
1072 | lrw\-\-\-\-\-\-\-. 1 root root 64 Apr 16 21:33 |
1073 | 7fc075d2f000\-7fc075e6f000 \-> /dev/zero (deleted) | |
37d5e699 | 1074 | .EE |
b4f89985 | 1075 | .in |
2dad4c59 | 1076 | .IP |
b4f89985 PE |
1077 | This directory appears only if the |
1078 | .B CONFIG_CHECKPOINT_RESTORE | |
1079 | kernel configuration option is enabled. | |
f2aa4dcc MK |
1080 | Privilege |
1081 | .RB ( CAP_SYS_ADMIN ) | |
1082 | .\" FIXME | |
1083 | .\" This may change. See the mail thread | |
43d42cc0 | 1084 | .\" "[RFC][PATCH v2] procfs: Always expose /proc/<pid>/map_files/ and make it readable" |
f2aa4dcc MK |
1085 | .\" from Jan 2015 |
1086 | is required to view the contents of this directory. | |
fea681da | 1087 | .TP |
69119dc7 | 1088 | .I /proc/[pid]/maps |
fea681da MK |
1089 | A file containing the currently mapped memory regions and their access |
1090 | permissions. | |
bbf9f397 MK |
1091 | See |
1092 | .BR mmap (2) | |
1093 | for some further information about memory mappings. | |
2dad4c59 | 1094 | .IP |
aee2f0bf MK |
1095 | Permission to access this file is governed by a ptrace access mode |
1096 | .B PTRACE_MODE_READ_FSCREDS | |
1097 | check; see | |
1098 | .BR ptrace (2). | |
2dad4c59 | 1099 | .IP |
dd0c3b96 | 1100 | The format of the file is: |
c1a022dc MK |
1101 | .IP |
1102 | .in 4n | |
1103 | .EX | |
21781757 | 1104 | .I "address perms offset dev inode pathname" |
9bc87ed0 MK |
1105 | 00400000\-00452000 r-xp 00000000 08:02 173521 /usr/bin/dbus-daemon |
1106 | 00651000\-00652000 r--p 00051000 08:02 173521 /usr/bin/dbus-daemon | |
1107 | 00652000\-00655000 rw-p 00052000 08:02 173521 /usr/bin/dbus-daemon | |
1108 | 00e03000\-00e24000 rw-p 00000000 00:00 0 [heap] | |
1109 | 00e24000\-011f7000 rw-p 00000000 00:00 0 [heap] | |
182090db | 1110 | \&... |
9bc87ed0 MK |
1111 | 35b1800000\-35b1820000 r-xp 00000000 08:02 135522 /usr/lib64/ld\-2.15.so |
1112 | 35b1a1f000\-35b1a20000 r--p 0001f000 08:02 135522 /usr/lib64/ld\-2.15.so | |
1113 | 35b1a20000\-35b1a21000 rw-p 00020000 08:02 135522 /usr/lib64/ld\-2.15.so | |
1114 | 35b1a21000\-35b1a22000 rw-p 00000000 00:00 0 | |
1115 | 35b1c00000\-35b1dac000 r-xp 00000000 08:02 135870 /usr/lib64/libc\-2.15.so | |
1116 | 35b1dac000\-35b1fac000 ---p 001ac000 08:02 135870 /usr/lib64/libc\-2.15.so | |
1117 | 35b1fac000\-35b1fb0000 r--p 001ac000 08:02 135870 /usr/lib64/libc\-2.15.so | |
1118 | 35b1fb0000\-35b1fb2000 rw-p 001b0000 08:02 135870 /usr/lib64/libc\-2.15.so | |
182090db | 1119 | \&... |
9bc87ed0 | 1120 | f2c6ff8c000\-7f2c7078c000 rw-p 00000000 00:00 0 [stack:986] |
182090db | 1121 | \&... |
9bc87ed0 MK |
1122 | 7fffb2c0d000\-7fffb2c2e000 rw-p 00000000 00:00 0 [stack] |
1123 | 7fffb2d48000\-7fffb2d49000 r-xp 00000000 00:00 0 [vdso] | |
c1a022dc | 1124 | .EE |
21781757 | 1125 | .in |
c1a022dc | 1126 | .IP |
7d2e6d74 | 1127 | The |
3eb8c588 MK |
1128 | .I address |
1129 | field is the address space in the process that the mapping occupies. | |
1130 | The | |
1131 | .I perms | |
1132 | field is a set of permissions: | |
2dad4c59 | 1133 | .IP |
37d5e699 MK |
1134 | .in +4 |
1135 | .EX | |
fea681da MK |
1136 | r = read |
1137 | w = write | |
1138 | x = execute | |
1139 | s = shared | |
1140 | p = private (copy on write) | |
37d5e699 | 1141 | .EE |
fea681da | 1142 | .in |
2dad4c59 | 1143 | .IP |
3eb8c588 MK |
1144 | The |
1145 | .I offset | |
b844cf04 | 1146 | field is the offset into the file/whatever; |
3eb8c588 MK |
1147 | .I dev |
1148 | is the device | |
dd0c3b96 | 1149 | (major:minor); |
3eb8c588 MK |
1150 | .I inode |
1151 | is the inode on that device. | |
59a40ed7 | 1152 | 0 indicates that no inode is associated with the memory region, |
16e64bae | 1153 | as would be the case with BSS (uninitialized data). |
2dad4c59 | 1154 | .IP |
3eb8c588 MK |
1155 | The |
1156 | .I pathname | |
1157 | field will usually be the file that is backing the mapping. | |
491ea6f1 | 1158 | For ELF files, |
3eb8c588 MK |
1159 | you can easily coordinate with the |
1160 | .I offset | |
1161 | field by looking at the | |
491ea6f1 MK |
1162 | Offset field in the ELF program headers |
1163 | .RI ( "readelf\ \-l" ). | |
2dad4c59 | 1164 | .IP |
491ea6f1 | 1165 | There are additional helpful pseudo-paths: |
61b0b1f4 MK |
1166 | .RS 12 |
1167 | .TP | |
1168 | .IR [stack] | |
16e64bae | 1169 | The initial process's (also known as the main thread's) stack. |
61b0b1f4 | 1170 | .TP |
3eb8c588 | 1171 | .IR [stack:<tid>] " (since Linux 3.4)" |
a60894c5 | 1172 | .\" commit b76437579d1344b612cf1851ae610c636cec7db0 |
61b0b1f4 | 1173 | A thread's stack (where the |
3eb8c588 | 1174 | .IR <tid> |
61b0b1f4 | 1175 | is a thread ID). |
491ea6f1 | 1176 | It corresponds to the |
3eb8c588 | 1177 | .IR /proc/[pid]/task/[tid]/ |
37d32c38 | 1178 | path. |
61b0b1f4 | 1179 | .TP |
7d2e6d74 | 1180 | .IR [vdso] |
61b0b1f4 | 1181 | The virtual dynamically linked shared object. |
c56a0185 MK |
1182 | See |
1183 | .BR vdso (7). | |
61b0b1f4 | 1184 | .TP |
7d2e6d74 | 1185 | .IR [heap] |
61b0b1f4 MK |
1186 | The process's heap. |
1187 | .in | |
61b0b1f4 MK |
1188 | .RE |
1189 | .IP | |
3eb8c588 MK |
1190 | If the |
1191 | .I pathname | |
1192 | field is blank, | |
40382e5e MK |
1193 | this is an anonymous mapping as obtained via |
1194 | .BR mmap (2). | |
61b0b1f4 MK |
1195 | There is no easy way to coordinate this back to a process's source, |
1196 | short of running it through | |
491ea6f1 MK |
1197 | .BR gdb (1), |
1198 | .BR strace (1), | |
1199 | or similar. | |
2dad4c59 | 1200 | .IP |
eb9a0b2f | 1201 | Under Linux 2.0, there is no field giving pathname. |
fea681da | 1202 | .TP |
69119dc7 | 1203 | .I /proc/[pid]/mem |
fea681da MK |
1204 | This file can be used to access the pages of a process's memory through |
1205 | .BR open (2), | |
1206 | .BR read (2), | |
1207 | and | |
ccb2bb0d | 1208 | .BR lseek (2). |
2dad4c59 | 1209 | .IP |
aee2f0bf MK |
1210 | Permission to access this file is governed by a ptrace access mode |
1211 | .B PTRACE_MODE_ATTACH_FSCREDS | |
1212 | check; see | |
1213 | .BR ptrace (2). | |
b4e9ee8f | 1214 | .TP |
69119dc7 | 1215 | .IR /proc/[pid]/mountinfo " (since Linux 2.6.26)" |
b4e9ee8f | 1216 | .\" This info adapted from Documentation/filesystems/proc.txt |
fb4bdaa1 | 1217 | .\" commit 2d4d4864ac08caff5c204a752bd004eed4f08760 |
ef5b47f6 MK |
1218 | This file contains information about mount points |
1219 | in the process's mount namespace (see | |
1220 | .BR mount_namespaces (7)). | |
fb4bdaa1 MK |
1221 | It supplies various information |
1222 | (e.g., propagation state, root of mount for bind mounts, | |
1223 | identifier for each mount and its parent) that is missing from the (older) | |
1224 | .IR /proc/[pid]/mounts | |
1225 | file, and fixes various other problems with that file | |
1226 | (e.g., nonextensibility, | |
1227 | failure to distinguish per-mount versus per-superblock options). | |
2dad4c59 | 1228 | .IP |
fb4bdaa1 | 1229 | The file contains lines of the form: |
c1a022dc MK |
1230 | .IP |
1231 | .in 0n | |
1232 | .EX | |
0f619d1f | 1233 | 36 35 98:0 /mnt1 /mnt2 rw,noatime master:1 \- ext3 /dev/root rw,errors=continue |
b4e9ee8f | 1234 | (1)(2)(3) (4) (5) (6) (7) (8) (9) (10) (11) |
c1a022dc MK |
1235 | .in |
1236 | .EE | |
b4e9ee8f MK |
1237 | .IP |
1238 | The numbers in parentheses are labels for the descriptions below: | |
3bc960c2 | 1239 | .RS 7 |
b4e9ee8f MK |
1240 | .TP 5 |
1241 | (1) | |
0f619d1f | 1242 | mount ID: a unique ID for the mount (may be reused after |
b4e9ee8f MK |
1243 | .BR umount (2)). |
1244 | .TP | |
1245 | (2) | |
35cf1b93 MK |
1246 | parent ID: the ID of the parent mount. |
1247 | For the root mount point, | |
1248 | the ID shown here is a hidden mount ID associated with the mount namespace. | |
1249 | That ID is distinct from any of the IDs shown in | |
1250 | field (1) of the records shown in the | |
1251 | .I mountinfo | |
1252 | file, and does not appear in field (1) in the | |
1253 | .I mountinfo | |
1254 | file in any other mount namespace. | |
1255 | (In the initial mount namespace, this hidden ID has the value 0.) | |
b4e9ee8f MK |
1256 | .TP |
1257 | (3) | |
0f619d1f | 1258 | major:minor: the value of |
b4e9ee8f | 1259 | .I st_dev |
0f619d1f | 1260 | for files on this filesystem (see |
b4e9ee8f MK |
1261 | .BR stat (2)). |
1262 | .TP | |
1263 | (4) | |
0f619d1f | 1264 | root: the pathname of the directory in the filesystem |
8d857fcb | 1265 | which forms the root of this mount. |
b4e9ee8f MK |
1266 | .TP |
1267 | (5) | |
ebdc66e2 | 1268 | mount point: the pathname of the mount point relative |
0f619d1f | 1269 | to the process's root directory. |
b4e9ee8f MK |
1270 | .TP |
1271 | (6) | |
1272 | mount options: per-mount options. | |
1273 | .TP | |
1274 | (7) | |
0f619d1f | 1275 | optional fields: zero or more fields of the form "tag[:value]"; see below. |
b4e9ee8f MK |
1276 | .TP |
1277 | (8) | |
0f619d1f | 1278 | separator: the end of the optional fields is marked by a single hyphen. |
b4e9ee8f MK |
1279 | .TP |
1280 | (9) | |
0f619d1f | 1281 | filesystem type: the filesystem type in the form "type[.subtype]". |
b4e9ee8f MK |
1282 | .TP |
1283 | (10) | |
9ee4a2b6 | 1284 | mount source: filesystem-specific information or "none". |
b4e9ee8f MK |
1285 | .TP |
1286 | (11) | |
68d86eac | 1287 | super options: per-superblock options. |
b4e9ee8f MK |
1288 | .RE |
1289 | .IP | |
966b5839 MK |
1290 | Currently, the possible optional fields are |
1291 | .IR shared , | |
1292 | .IR master , | |
1293 | .IR propagate_from , | |
1294 | and | |
1295 | .IR unbindable . | |
1296 | See | |
1297 | .BR mount_namespaces (7) | |
1298 | for a description of these fields. | |
0f619d1f MK |
1299 | Parsers should ignore all unrecognized optional fields. |
1300 | .IP | |
b4e9ee8f MK |
1301 | For more information on mount propagation see: |
1302 | .I Documentation/filesystems/sharedsubtree.txt | |
66a9882e | 1303 | in the Linux kernel source tree. |
b4e9ee8f | 1304 | .TP |
cea61382 | 1305 | .IR /proc/[pid]/mounts " (since Linux 2.4.19)" |
226cb3a8 | 1306 | This file lists all the filesystems currently mounted in the |
ef5b47f6 MK |
1307 | process's mount namespace (see |
1308 | .BR mount_namespaces (7)). | |
cea61382 MK |
1309 | The format of this file is documented in |
1310 | .BR fstab (5). | |
2dad4c59 | 1311 | .IP |
cea61382 MK |
1312 | Since kernel version 2.6.15, this file is pollable: |
1313 | after opening the file for reading, a change in this file | |
9ee4a2b6 | 1314 | (i.e., a filesystem mount or unmount) causes |
cea61382 | 1315 | .BR select (2) |
226cb3a8 | 1316 | to mark the file descriptor as having an exceptional condition, and |
cea61382 MK |
1317 | .BR poll (2) |
1318 | and | |
1319 | .BR epoll_wait (2) | |
226cb3a8 MK |
1320 | mark the file as having a priority event |
1321 | .RB ( POLLPRI ). | |
1322 | (Before Linux 2.6.30, | |
1323 | a change in this file was indicated by the file descriptor | |
1324 | being marked as readable for | |
1325 | .BR select (2), | |
1326 | and being marked as having an error condition for | |
1327 | .BR poll (2) | |
1328 | and | |
1329 | .BR epoll_wait (2).) | |
cea61382 | 1330 | .TP |
69119dc7 | 1331 | .IR /proc/[pid]/mountstats " (since Linux 2.6.17)" |
783a6233 | 1332 | This file exports information (statistics, configuration information) |
ef5b47f6 MK |
1333 | about the mount points in the process's mount namespace (see |
1334 | .BR mount_namespaces (7)). | |
b4e9ee8f | 1335 | Lines in this file have the form: |
37d5e699 MK |
1336 | .IP |
1337 | .in +4n | |
1338 | .EX | |
b4e9ee8f MK |
1339 | device /dev/sda7 mounted on /home with fstype ext3 [statistics] |
1340 | ( 1 ) ( 2 ) (3 ) (4) | |
37d5e699 MK |
1341 | .EE |
1342 | .in | |
b4e9ee8f MK |
1343 | .IP |
1344 | The fields in each line are: | |
3bc960c2 | 1345 | .RS 7 |
b4e9ee8f MK |
1346 | .TP 5 |
1347 | (1) | |
1348 | The name of the mounted device | |
1349 | (or "nodevice" if there is no corresponding device). | |
1350 | .TP | |
1351 | (2) | |
9ee4a2b6 | 1352 | The mount point within the filesystem tree. |
b4e9ee8f MK |
1353 | .TP |
1354 | (3) | |
9ee4a2b6 | 1355 | The filesystem type. |
b4e9ee8f MK |
1356 | .TP |
1357 | (4) | |
1358 | Optional statistics and configuration information. | |
9ee4a2b6 | 1359 | Currently (as at Linux 2.6.26), only NFS filesystems export |
b4e9ee8f MK |
1360 | information via this field. |
1361 | .RE | |
1362 | .IP | |
90878f7c | 1363 | This file is readable only by the owner of the process. |
b4e9ee8f | 1364 | .TP |
2d3fb75b | 1365 | .IR /proc/[pid]/net " (since Linux 2.6.25)" |
9fb88bc8 MK |
1366 | See the description of |
1367 | .IR /proc/net . | |
1368 | .TP | |
b4a185e5 | 1369 | .IR /proc/[pid]/ns/ " (since Linux 3.0)" |
2c4201f0 | 1370 | .\" See commit 6b4e306aa3dc94a0545eb9279475b1ab6209a31f |
b4a185e5 EB |
1371 | This is a subdirectory containing one entry for each namespace that |
1372 | supports being manipulated by | |
80e63655 | 1373 | .BR setns (2). |
cf8bfe6d MK |
1374 | For more information, see |
1375 | .BR namespaces (7). | |
b4a185e5 | 1376 | .TP |
69119dc7 | 1377 | .IR /proc/[pid]/numa_maps " (since Linux 2.6.14)" |
610f75cc MK |
1378 | See |
1379 | .BR numa (7). | |
7388733a | 1380 | .TP |
69119dc7 | 1381 | .IR /proc/[pid]/oom_adj " (since Linux 2.6.11)" |
b4e9ee8f | 1382 | This file can be used to adjust the score used to select which process |
0425de01 | 1383 | should be killed in an out-of-memory (OOM) situation. |
b4e9ee8f MK |
1384 | The kernel uses this value for a bit-shift operation of the process's |
1385 | .IR oom_score | |
1386 | value: | |
5b8dbfd4 MK |
1387 | valid values are in the range \-16 to +15, |
1388 | plus the special value \-17, | |
b4e9ee8f MK |
1389 | which disables OOM-killing altogether for this process. |
1390 | A positive score increases the likelihood of this | |
1391 | process being killed by the OOM-killer; | |
1392 | a negative score decreases the likelihood. | |
de8e9cc1 | 1393 | .IP |
b4e9ee8f MK |
1394 | The default value for this file is 0; |
1395 | a new process inherits its parent's | |
1396 | .I oom_adj | |
1397 | setting. | |
1398 | A process must be privileged | |
1399 | .RB ( CAP_SYS_RESOURCE ) | |
1400 | to update this file. | |
f2c8b197 MK |
1401 | .IP |
1402 | Since Linux 2.6.36, use of this file is deprecated in favor of | |
1403 | .IR /proc/[pid]/oom_score_adj . | |
b4e9ee8f | 1404 | .TP |
69119dc7 | 1405 | .IR /proc/[pid]/oom_score " (since Linux 2.6.11)" |
5753354a MF |
1406 | .\" See mm/oom_kill.c::badness() in pre 2.6.36 sources |
1407 | .\" See mm/oom_kill.c::oom_badness() after 2.6.36 | |
1408 | .\" commit a63d83f427fbce97a6cea0db2e64b0eb8435cd10 | |
b4e9ee8f MK |
1409 | This file displays the current score that the kernel gives to |
1410 | this process for the purpose of selecting a process | |
1411 | for the OOM-killer. | |
1412 | A higher score means that the process is more likely to be | |
1413 | selected by the OOM-killer. | |
1414 | The basis for this score is the amount of memory used by the process, | |
1415 | with increases (+) or decreases (\-) for factors including: | |
5753354a MF |
1416 | .\" See mm/oom_kill.c::badness() in pre 2.6.36 sources |
1417 | .\" See mm/oom_kill.c::oom_badness() after 2.6.36 | |
1418 | .\" commit a63d83f427fbce97a6cea0db2e64b0eb8435cd10 | |
1419 | .RS | |
1420 | .IP * 2 | |
9b0e3937 | 1421 | whether the process is privileged (\-). |
5753354a MF |
1422 | .\" More precisely, if it has CAP_SYS_ADMIN or (pre 2.6.36) CAP_SYS_RESOURCE |
1423 | .RE | |
1424 | .IP | |
1425 | Before kernel 2.6.36 the following factors were also used in the calculation of oom_score: | |
b4e9ee8f MK |
1426 | .RS |
1427 | .IP * 2 | |
1428 | whether the process creates a lot of children using | |
1429 | .BR fork (2) | |
1430 | (+); | |
1431 | .IP * | |
1432 | whether the process has been running a long time, | |
1433 | or has used a lot of CPU time (\-); | |
1434 | .IP * | |
5753354a | 1435 | whether the process has a low nice value (i.e., > 0) (+); and |
b4e9ee8f MK |
1436 | .IP * |
1437 | whether the process is making direct hardware access (\-). | |
1438 | .\" More precisely, if it has CAP_SYS_RAWIO | |
1439 | .RE | |
1440 | .IP | |
1441 | The | |
1442 | .I oom_score | |
f2c8b197 MK |
1443 | also reflects the adjustment specified by the |
1444 | .I oom_score_adj | |
1445 | or | |
b4e9ee8f MK |
1446 | .I oom_adj |
1447 | setting for the process. | |
f2c8b197 MK |
1448 | .TP |
1449 | .IR /proc/[pid]/oom_score_adj " (since Linux 2.6.36)" | |
1450 | .\" Text taken from 3.7 Documentation/filesystems/proc.txt | |
1451 | This file can be used to adjust the badness heuristic used to select which | |
1452 | process gets killed in out-of-memory conditions. | |
2dad4c59 | 1453 | .IP |
f2c8b197 MK |
1454 | The badness heuristic assigns a value to each candidate task ranging from 0 |
1455 | (never kill) to 1000 (always kill) to determine which process is targeted. | |
1456 | The units are roughly a proportion along that range of | |
1457 | allowed memory the process may allocate from, | |
1458 | based on an estimation of its current memory and swap use. | |
1459 | For example, if a task is using all allowed memory, | |
1460 | its badness score will be 1000. | |
1461 | If it is using half of its allowed memory, its score will be 500. | |
2dad4c59 | 1462 | .IP |
f2c8b197 MK |
1463 | There is an additional factor included in the badness score: root |
1464 | processes are given 3% extra memory over other tasks. | |
2dad4c59 | 1465 | .IP |
f2c8b197 | 1466 | The amount of "allowed" memory depends on the context |
0633f951 | 1467 | in which the OOM-killer was called. |
f2c8b197 MK |
1468 | If it is due to the memory assigned to the allocating task's cpuset |
1469 | being exhausted, | |
1470 | the allowed memory represents the set of mems assigned to that | |
1471 | cpuset (see | |
1472 | .BR cpuset (7)). | |
1473 | If it is due to a mempolicy's node(s) being exhausted, | |
1474 | the allowed memory represents the set of mempolicy nodes. | |
1475 | If it is due to a memory limit (or swap limit) being reached, | |
1476 | the allowed memory is that configured limit. | |
1477 | Finally, if it is due to the entire system being out of memory, the | |
1478 | allowed memory represents all allocatable resources. | |
2dad4c59 | 1479 | .IP |
f2c8b197 | 1480 | The value of |
0633f951 | 1481 | .I oom_score_adj |
f2c8b197 MK |
1482 | is added to the badness score before it |
1483 | is used to determine which task to kill. | |
1484 | Acceptable values range from \-1000 | |
1485 | (OOM_SCORE_ADJ_MIN) to +1000 (OOM_SCORE_ADJ_MAX). | |
0633f951 | 1486 | This allows user space to control the preference for OOM-killing, |
f2c8b197 | 1487 | ranging from always preferring a certain |
f082ada4 | 1488 | task or completely disabling it from OOM killing. |
f2c8b197 | 1489 | The lowest possible value, \-1000, is |
0633f951 | 1490 | equivalent to disabling OOM-killing entirely for that task, |
f2c8b197 | 1491 | since it will always report a badness score of 0. |
2dad4c59 | 1492 | .IP |
f2c8b197 MK |
1493 | Consequently, it is very simple for user space to define |
1494 | the amount of memory to consider for each task. | |
48ac01a7 | 1495 | Setting an |
f2c8b197 MK |
1496 | .I oom_score_adj |
1497 | value of +500, for example, | |
1498 | is roughly equivalent to allowing the remainder of tasks sharing the | |
1499 | same system, cpuset, mempolicy, or memory controller resources | |
1500 | to use at least 50% more memory. | |
1501 | A value of \-500, on the other hand, would be roughly | |
1502 | equivalent to discounting 50% of the task's | |
1503 | allowed memory from being considered as scoring against the task. | |
2dad4c59 | 1504 | .IP |
0633f951 | 1505 | For backward compatibility with previous kernels, |
f2c8b197 MK |
1506 | .I /proc/[pid]/oom_adj |
1507 | can still be used to tune the badness score. | |
1508 | Its value is | |
9f1b9726 | 1509 | scaled linearly with |
f2c8b197 | 1510 | .IR oom_score_adj . |
2dad4c59 | 1511 | .IP |
f2c8b197 MK |
1512 | Writing to |
1513 | .IR /proc/[pid]/oom_score_adj | |
1514 | or | |
1515 | .IR /proc/[pid]/oom_adj | |
1516 | will change the other with its scaled value. | |
b0aa1e51 MK |
1517 | .TP |
1518 | .IR /proc/[pid]/pagemap " (since Linux 2.6.25)" | |
1519 | This file shows the mapping of each of the process's virtual pages | |
1520 | into physical page frames or swap area. | |
1521 | It contains one 64-bit value for each virtual page, | |
1522 | with the bits set as follows: | |
1523 | .RS 12 | |
1524 | .TP | |
1525 | 63 | |
1526 | If set, the page is present in RAM. | |
1527 | .TP | |
1528 | 62 | |
1529 | If set, the page is in swap space | |
1530 | .TP | |
1531 | 61 (since Linux 3.5) | |
1532 | The page is a file-mapped page or a shared anonymous page. | |
1533 | .TP | |
2e84528d | 1534 | 60\(en57 (since Linux 3.11) |
b0aa1e51 MK |
1535 | Zero |
1536 | .\" Not quite true; see commit 541c237c0923f567c9c4cabb8a81635baadc713f | |
1537 | .TP | |
2e84528d | 1538 | 56 (since Linux 4.2) |
abfbcb56 MK |
1539 | .\" commit 77bb499bb60f4b79cca7d139c8041662860fcf87 |
1540 | .\" commit 83b4b0bb635eee2b8e075062e4e008d1bc110ed7 | |
2e84528d OE |
1541 | The page is exclusively mapped. |
1542 | .TP | |
b5301584 | 1543 | 55 (since Linux 3.11) |
b0aa1e51 MK |
1544 | PTE is soft-dirty |
1545 | (see the kernel source file | |
1546 | .IR Documentation/vm/soft-dirty.txt ). | |
1547 | .TP | |
9bc87ed0 | 1548 | 54\(en0 |
b0aa1e51 MK |
1549 | If the page is present in RAM (bit 63), then these bits |
1550 | provide the page frame number, which can be used to index | |
1551 | .IR /proc/kpageflags | |
1552 | and | |
1553 | .IR /proc/kpagecount . | |
1554 | If the page is present in swap (bit 62), | |
9bc87ed0 | 1555 | then bits 4\(en0 give the swap type, and bits 54\(en5 encode the swap offset. |
b0aa1e51 MK |
1556 | .RE |
1557 | .IP | |
9bc87ed0 | 1558 | Before Linux 3.11, bits 60\(en55 were |
b0aa1e51 MK |
1559 | used to encode the base-2 log of the page size. |
1560 | .IP | |
1561 | To employ | |
1562 | .IR /proc/[pid]/pagemap | |
1563 | efficiently, use | |
1564 | .IR /proc/[pid]/maps | |
1565 | to determine which areas of memory are actually mapped and seek | |
1566 | to skip over unmapped regions. | |
1567 | .IP | |
1568 | The | |
1569 | .IR /proc/[pid]/pagemap | |
1570 | file is present only if the | |
1571 | .B CONFIG_PROC_PAGE_MONITOR | |
1572 | kernel configuration option is enabled. | |
2dad4c59 | 1573 | .IP |
aee2f0bf MK |
1574 | Permission to access this file is governed by a ptrace access mode |
1575 | .B PTRACE_MODE_READ_FSCREDS | |
1576 | check; see | |
1577 | .BR ptrace (2). | |
7c2905d1 MK |
1578 | .TP |
1579 | .IR /proc/[pid]/personality " (since Linux 2.6.28)" | |
1580 | .\" commit 478307230810d7e2a753ed220db9066dfdf88718 | |
1581 | This read-only file exposes the process's execution domain, as set by | |
1582 | .BR personality (2). | |
1583 | The value is displayed in hexadecimal notation. | |
2dad4c59 | 1584 | .IP |
4834ae91 MK |
1585 | Permission to access this file is governed by a ptrace access mode |
1586 | .B PTRACE_MODE_ATTACH_FSCREDS | |
1587 | check; see | |
1588 | .BR ptrace (2). | |
fea681da | 1589 | .TP |
69119dc7 | 1590 | .I /proc/[pid]/root |
008f1ecc | 1591 | UNIX and Linux support the idea of a per-process root of the |
9ee4a2b6 | 1592 | filesystem, set by the |
fea681da | 1593 | .BR chroot (2) |
c13182ef MK |
1594 | system call. |
1595 | This file is a symbolic link that points to the process's | |
14d70713 MK |
1596 | root directory, and behaves in the same way as |
1597 | .IR exe , | |
1598 | and | |
1599 | .IR fd/* . | |
2dad4c59 | 1600 | .IP |
948f0ff4 | 1601 | Note however that this file is not merely a symbolic link. |
2b312241 MF |
1602 | It provides the same view of the filesystem (including namespaces and the |
1603 | set of per-process mounts) as the process itself. | |
a77efd58 MK |
1604 | An example illustrates this point. |
1605 | In one terminal, we start a shell in new user and mount namespaces, | |
1606 | and in that shell we create some new mount points: | |
2dad4c59 | 1607 | .IP |
a77efd58 | 1608 | .in +4n |
37d5e699 | 1609 | .EX |
a77efd58 MK |
1610 | $ \fBPS1='sh1# ' unshare \-Urnm\fP |
1611 | sh1# \fBmount \-t tmpfs tmpfs /etc\fP # Mount empty tmpfs at /etc | |
1612 | sh1# \fBmount \-\-bind /usr /dev\fP # Mount /usr at /dev | |
89f92905 | 1613 | sh1# \fBecho $$\fP |
a77efd58 | 1614 | 27123 |
37d5e699 | 1615 | .EE |
a77efd58 | 1616 | .in |
2dad4c59 | 1617 | .IP |
a77efd58 MK |
1618 | In a second terminal window, in the initial mount namespace, |
1619 | we look at the contents of the corresponding mounts in | |
1620 | the initial and new namespaces: | |
2dad4c59 | 1621 | .IP |
a77efd58 | 1622 | .in +4n |
37d5e699 | 1623 | .EX |
89f92905 | 1624 | $ \fBPS1='sh2# ' sudo sh\fP |
a77efd58 MK |
1625 | sh2# \fBls /etc | wc \-l\fP # In initial NS |
1626 | 309 | |
1627 | sh2# \fBls /proc/27123/root/etc | wc \-l\fP # /etc in other NS | |
1628 | 0 # The empty tmpfs dir | |
1629 | sh2# \fBls /dev | wc \-l\fP # In initial NS | |
1630 | 205 | |
1631 | sh2# \fBls /proc/27123/root/dev | wc \-l\fP # /dev in other NS | |
1632 | 11 # Actually bind | |
1633 | # mounted to /usr | |
1634 | sh2# \fBls /usr | wc \-l\fP # /usr in initial NS | |
1635 | 11 | |
37d5e699 | 1636 | .EE |
a77efd58 | 1637 | .in |
2dad4c59 | 1638 | .IP |
afcaf646 | 1639 | .\" The following was still true as at kernel 2.6.13 |
3ed7270e MK |
1640 | In a multithreaded process, the contents of the |
1641 | .I /proc/[pid]/root | |
1642 | symbolic link are not available if the main thread has already terminated | |
afcaf646 MK |
1643 | (typically by calling |
1644 | .BR pthread_exit (3)). | |
2dad4c59 | 1645 | .IP |
b902fe18 MK |
1646 | Permission to dereference or read |
1647 | .RB ( readlink (2)) | |
1648 | this symbolic link is governed by a ptrace access mode | |
1649 | .B PTRACE_MODE_READ_FSCREDS | |
1650 | check; see | |
1651 | .BR ptrace (2). | |
f34f0182 | 1652 | .\" FIXME Describe /proc/[pid]/projid_map |
43d42cc0 MK |
1653 | .\" Added in 3.7 |
1654 | .\" commit f76d207a66c3a53defea67e7d36c3eb1b7d6d61d | |
15869389 MK |
1655 | .TP |
1656 | .IR /proc/[pid]/seccomp " (Linux 2.6.12 to 2.6.22)" | |
1657 | This file can be used to read and change the process's | |
1658 | secure computing (seccomp) mode setting. | |
1659 | It contains the value 0 if the process is not in seccomp mode, | |
1660 | and 1 if the process is in strict seccomp mode (see | |
1661 | .BR seccomp (2)). | |
1662 | Writing 1 to this file places the process irreversibly in strict seccomp mode. | |
1663 | (Further attempts to write to the file fail with the | |
1664 | .B EPERM | |
1665 | error.) | |
2dad4c59 | 1666 | .IP |
15869389 MK |
1667 | In Linux 2.6.23, |
1668 | this file went away, to be replaced by the | |
1669 | .BR prctl (2) | |
1670 | .BR PR_GET_SECCOMP | |
1671 | and | |
1672 | .BR PR_SET_SECCOMP | |
1673 | operations (and later by | |
1674 | .BR seccomp (2) | |
1675 | and the | |
1676 | .I Seccomp | |
1677 | field in | |
1678 | .IR /proc/[pid]/status ). | |
69119dc7 | 1679 | .\" FIXME Describe /proc/[pid]/sessionid |
b3fb99e8 | 1680 | .\" commit 1e0bd7550ea9cf474b1ad4c6ff5729a507f75fdc |
b4e9ee8f | 1681 | .\" CONFIG_AUDITSYSCALL |
43d42cc0 | 1682 | .\" Added in 2.6.25; read-only; only readable by real UID |
bea08fec | 1683 | .\" |
69119dc7 | 1684 | .\" FIXME Describe /proc/[pid]/sched |
b4e9ee8f MK |
1685 | .\" Added in 2.6.23 |
1686 | .\" CONFIG_SCHED_DEBUG, and additional fields if CONFIG_SCHEDSTATS | |
1687 | .\" Displays various scheduling parameters | |
1688 | .\" This file can be written, to reset stats | |
ef4f4031 | 1689 | .\" The set of fields exposed by this file have changed |
b3fb99e8 MK |
1690 | .\" significantly over time. |
1691 | .\" commit 43ae34cb4cd650d1eb4460a8253a8e747ba052ac | |
1692 | .\" | |
69119dc7 MK |
1693 | .\" FIXME Describe /proc/[pid]/schedstats and |
1694 | .\" /proc/[pid]/task/[tid]/schedstats | |
b4e9ee8f MK |
1695 | .\" Added in 2.6.9 |
1696 | .\" CONFIG_SCHEDSTATS | |
fea681da | 1697 | .TP |
5c92b1b7 | 1698 | .IR /proc/[pid]/setgroups " (since Linux 3.19)" |
ab28dba9 MK |
1699 | See |
1700 | .BR user_namespaces (7). | |
d520465b | 1701 | .TP |
69119dc7 | 1702 | .IR /proc/[pid]/smaps " (since Linux 2.6.14)" |
b07b19c4 | 1703 | This file shows memory consumption for each of the process's mappings. |
859503c3 MK |
1704 | (The |
1705 | .BR pmap (1) | |
1706 | command displays similar information, | |
1707 | in a form that may be easier for parsing.) | |
1f0add28 | 1708 | For each mapping there is a series of lines such as the following: |
37d5e699 | 1709 | .IP |
a08ea57c | 1710 | .in +4n |
37d5e699 | 1711 | .EX |
9bc87ed0 | 1712 | 00400000\-0048a000 r\-xp 00000000 fd:03 960637 /bin/bash |
95fe794d PG |
1713 | Size: 552 kB |
1714 | Rss: 460 kB | |
1715 | Pss: 100 kB | |
1716 | Shared_Clean: 452 kB | |
1717 | Shared_Dirty: 0 kB | |
1718 | Private_Clean: 8 kB | |
1719 | Private_Dirty: 0 kB | |
1720 | Referenced: 460 kB | |
1721 | Anonymous: 0 kB | |
1722 | AnonHugePages: 0 kB | |
4ad958e1 MK |
1723 | ShmemHugePages: 0 kB |
1724 | ShmemPmdMapped: 0 kB | |
95fe794d PG |
1725 | Swap: 0 kB |
1726 | KernelPageSize: 4 kB | |
1727 | MMUPageSize: 4 kB | |
6861f8f0 MK |
1728 | KernelPageSize: 4 kB |
1729 | MMUPageSize: 4 kB | |
95fe794d | 1730 | Locked: 0 kB |
2f057281 | 1731 | ProtectionKey: 0 |
eb848708 | 1732 | VmFlags: rd ex mr mw me dw |
37d5e699 | 1733 | .EE |
a08ea57c | 1734 | .in |
2d3fb75b | 1735 | .IP |
b07b19c4 MK |
1736 | The first of these lines shows the same information as is displayed |
1737 | for the mapping in | |
69119dc7 | 1738 | .IR /proc/[pid]/maps . |
c3d59262 | 1739 | The following lines show the size of the mapping, |
95fe794d | 1740 | the amount of the mapping that is currently resident in RAM ("Rss"), |
a5a3e91b | 1741 | the process's proportional share of this mapping ("Pss"), |
1f0add28 | 1742 | the number of clean and dirty shared pages in the mapping, |
c7ce200d | 1743 | and the number of clean and dirty private pages in the mapping. |
95fe794d | 1744 | "Referenced" indicates the amount of memory currently marked as |
1f0add28 MK |
1745 | referenced or accessed. |
1746 | "Anonymous" shows the amount of memory | |
1747 | that does not belong to any file. | |
1748 | "Swap" shows how much | |
95fe794d | 1749 | would-be-anonymous memory is also used, but out on swap. |
2dad4c59 | 1750 | .IP |
6861f8f0 MK |
1751 | The "KernelPageSize" line (available since Linux 2.6.29) |
1752 | is the page size used by the kernel to back the virtual memory area. | |
1f0add28 MK |
1753 | This matches the size used by the MMU in the majority of cases. |
1754 | However, one counter-example occurs on PPC64 kernels | |
6861f8f0 | 1755 | whereby a kernel using 64kB as a base page size may still use 4kB |
1f0add28 | 1756 | pages for the MMU on older processors. |
6861f8f0 MK |
1757 | To distinguish the two attributes, the "MMUPageSize" line |
1758 | (also available since Linux 2.6.29) | |
1759 | reports the page size used by the MMU. | |
2dad4c59 | 1760 | .IP |
95fe794d PG |
1761 | The "Locked" indicates whether the mapping is locked in memory |
1762 | or not. | |
2dad4c59 | 1763 | .IP |
9b780b06 MK |
1764 | The "ProtectionKey" line (available since Linux 4.9, on x86 only) |
1765 | contains the memory protection key (see | |
1766 | .BR pkeys (7)) | |
1767 | associated with the virtual memory area. | |
1768 | This entry is present only if the kernel was built with the | |
1769 | .B CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS | |
1770 | configuration option. | |
2dad4c59 | 1771 | .IP |
eb848708 MK |
1772 | The "VmFlags" line (available since Linux 3.8) |
1773 | represents the kernel flags associated with the virtual memory area, | |
1774 | encoded using the following two-letter codes: | |
2dad4c59 | 1775 | .IP |
95fe794d | 1776 | rd - readable |
1f0add28 | 1777 | wr - writable |
95fe794d PG |
1778 | ex - executable |
1779 | sh - shared | |
1780 | mr - may read | |
1781 | mw - may write | |
1782 | me - may execute | |
1783 | ms - may share | |
723e333c | 1784 | gd - stack segment grows down |
95fe794d PG |
1785 | pf - pure PFN range |
1786 | dw - disabled write to the mapped file | |
1787 | lo - pages are locked in memory | |
1788 | io - memory mapped I/O area | |
1789 | sr - sequential read advise provided | |
1790 | rr - random read advise provided | |
1791 | dc - do not copy area on fork | |
1792 | de - do not expand area on remapping | |
1793 | ac - area is accountable | |
1794 | nr - swap space is not reserved for the area | |
1795 | ht - area uses huge tlb pages | |
1796 | nl - non-linear mapping | |
1797 | ar - architecture specific flag | |
1798 | dd - do not include area into core dump | |
1799 | sd - soft-dirty flag | |
1800 | mm - mixed map area | |
1801 | hg - huge page advise flag | |
1802 | nh - no-huge page advise flag | |
b5408a0f | 1803 | mg - mergeable advise flag |
2dad4c59 | 1804 | .IP |
be729d66 DH |
1805 | "ProtectionKey" field contains the memory protection key (see |
1806 | .BR pkeys (5)) | |
1807 | associated with the virtual memory area. | |
f12f1b9b | 1808 | Present only if the kernel was built with the |
be729d66 DH |
1809 | .B CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS |
1810 | configuration option. (since Linux 4.6) | |
2dad4c59 | 1811 | .IP |
e618d945 MK |
1812 | The |
1813 | .IR /proc/[pid]/smaps | |
1814 | file is present only if the | |
1815 | .B CONFIG_PROC_PAGE_MONITOR | |
1816 | kernel configuration option is enabled. | |
b07b19c4 | 1817 | .TP |
67aac6fb MK |
1818 | .IR /proc/[pid]/stack " (since Linux 2.6.29)" |
1819 | .\" 2ec220e27f5040aec1e88901c1b6ea3d135787ad | |
1820 | This file provides a symbolic trace of the function calls in this | |
1821 | process's kernel stack. | |
1822 | This file is provided only if the kernel was built with the | |
1823 | .B CONFIG_STACKTRACE | |
1824 | configuration option. | |
2dad4c59 | 1825 | .IP |
4834ae91 MK |
1826 | Permission to access this file is governed by a ptrace access mode |
1827 | .B PTRACE_MODE_ATTACH_FSCREDS | |
1828 | check; see | |
1829 | .BR ptrace (2). | |
67aac6fb | 1830 | .TP |
69119dc7 | 1831 | .I /proc/[pid]/stat |
c13182ef MK |
1832 | Status information about the process. |
1833 | This is used by | |
1834 | .BR ps (1). | |
082bf5b8 MK |
1835 | It is defined in the kernel source file |
1836 | .IR fs/proc/array.c "." | |
2dad4c59 | 1837 | .IP |
fea681da MK |
1838 | The fields, in order, with their proper |
1839 | .BR scanf (3) | |
b02b4b74 MK |
1840 | format specifiers, are listed below. |
1841 | Whether or not certain of these fields display valid information is governed by | |
1842 | a ptrace access mode | |
1843 | .BR PTRACE_MODE_READ_FSCREDS "\ |\ " PTRACE_MODE_NOAUDIT | |
1844 | check (refer to | |
1845 | .BR ptrace (2)). | |
1846 | If the check denies access, then the field value is displayed as 0. | |
1847 | The affected fields are indicated with the marking [PT]. | |
2dad4c59 | 1848 | .IP |
fea681da | 1849 | .RS |
62e4a418 MK |
1850 | .TP 10 |
1851 | (1) \fIpid\fP \ %d | |
1852 | .br | |
1853 | The process ID. | |
fea681da | 1854 | .TP |
62e4a418 MK |
1855 | (2) \fIcomm\fP \ %s |
1856 | The filename of the executable, in parentheses. | |
c13182ef | 1857 | This is visible whether or not the executable is swapped out. |
fea681da | 1858 | .TP |
62e4a418 | 1859 | (3) \fIstate\fP \ %c |
31293f37 MK |
1860 | One of the following characters, indicating process state: |
1861 | .RS | |
1862 | .IP R 3 | |
1863 | Running | |
1864 | .IP S | |
1865 | Sleeping in an interruptible wait | |
1866 | .IP D | |
1867 | Waiting in uninterruptible | |
1868 | disk sleep | |
1869 | .IP Z | |
1870 | Zombie | |
1871 | .IP T | |
1872 | Stopped (on a signal) or (before Linux 2.6.33) trace stopped | |
1873 | .IP t | |
1874 | .\" commit 44d90df6b757c59651ddd55f1a84f28132b50d29 | |
1875 | Tracing stop (Linux 2.6.33 onward) | |
1876 | .IP W | |
1877 | Paging (only before Linux 2.6.0) | |
1878 | .IP X | |
ef4f4031 | 1879 | Dead (from Linux 2.6.0 onward) |
31293f37 MK |
1880 | .IP x |
1881 | .\" commit 44d90df6b757c59651ddd55f1a84f28132b50d29 | |
1882 | Dead (Linux 2.6.33 to | |
1883 | .\" commit 74e37200de8e9c4e09b70c21c3f13c2071e77457 | |
1884 | 3.13 only) | |
1885 | .IP K | |
1886 | .\" commit 44d90df6b757c59651ddd55f1a84f28132b50d29 | |
1887 | Wakekill (Linux 2.6.33 to | |
1888 | .\" commit 74e37200de8e9c4e09b70c21c3f13c2071e77457 | |
1889 | 3.13 only) | |
1890 | .IP W | |
1891 | .\" commit 44d90df6b757c59651ddd55f1a84f28132b50d29 | |
1892 | Waking (Linux 2.6.33 to | |
1893 | .\" commit 74e37200de8e9c4e09b70c21c3f13c2071e77457 | |
1894 | 3.13 only) | |
1895 | .IP P | |
1896 | .\" commit f2530dc71cf0822f90bb63ea4600caaef33a66bb | |
1897 | Parked (Linux 3.9 to | |
1898 | .\" commit 74e37200de8e9c4e09b70c21c3f13c2071e77457 | |
1899 | 3.13 only) | |
1900 | .RE | |
fea681da | 1901 | .TP |
62e4a418 | 1902 | (4) \fIppid\fP \ %d |
e0fdc57c | 1903 | The PID of the parent of this process. |
fea681da | 1904 | .TP |
62e4a418 MK |
1905 | (5) \fIpgrp\fP \ %d |
1906 | The process group ID of the process. | |
fea681da | 1907 | .TP |
62e4a418 MK |
1908 | (6) \fIsession\fP \ %d |
1909 | The session ID of the process. | |
fea681da | 1910 | .TP |
62e4a418 MK |
1911 | (7) \fItty_nr\fP \ %d |
1912 | The controlling terminal of the process. | |
59a40ed7 MK |
1913 | (The minor device number is contained in the combination of bits |
1914 | 31 to 20 and 7 to 0; | |
b97deb97 | 1915 | the major device number is in bits 15 to 8.) |
fea681da | 1916 | .TP |
62e4a418 | 1917 | (8) \fItpgid\fP \ %d |
fea681da | 1918 | .\" This field and following, up to and including wchan added 0.99.1 |
62e4a418 | 1919 | The ID of the foreground process group of the controlling |
59a40ed7 | 1920 | terminal of the process. |
fea681da | 1921 | .TP |
62e4a418 MK |
1922 | (9) \fIflags\fP \ %u |
1923 | The kernel flags word of the process. | |
c13182ef | 1924 | For bit meanings, |
66a9882e | 1925 | see the PF_* defines in the Linux kernel source file |
00702acc | 1926 | .IR include/linux/sched.h . |
fea681da | 1927 | Details depend on the kernel version. |
2dad4c59 | 1928 | .IP |
62e4a418 | 1929 | The format for this field was %lu before Linux 2.6. |
fea681da | 1930 | .TP |
ee566744 | 1931 | (10) \fIminflt\fP \ %lu |
62e4a418 | 1932 | The number of minor faults the process has made which have not |
fea681da MK |
1933 | required loading a memory page from disk. |
1934 | .TP | |
62e4a418 MK |
1935 | (11) \fIcminflt\fP \ %lu |
1936 | The number of minor faults that the process's | |
fea681da MK |
1937 | waited-for children have made. |
1938 | .TP | |
62e4a418 MK |
1939 | (12) \fImajflt\fP \ %lu |
1940 | The number of major faults the process has made which have | |
fea681da MK |
1941 | required loading a memory page from disk. |
1942 | .TP | |
62e4a418 MK |
1943 | (13) \fIcmajflt\fP \ %lu |
1944 | The number of major faults that the process's | |
fea681da MK |
1945 | waited-for children have made. |
1946 | .TP | |
62e4a418 MK |
1947 | (14) \fIutime\fP \ %lu |
1948 | Amount of time that this process has been scheduled in user mode, | |
7a017e24 | 1949 | measured in clock ticks (divide by |
67914165 | 1950 | .IR sysconf(_SC_CLK_TCK) ). |
a1c9dc59 MK |
1951 | This includes guest time, \fIguest_time\fP |
1952 | (time spent running a virtual CPU, see below), | |
1953 | so that applications that are not aware of the guest time field | |
1954 | do not lose that time from their calculations. | |
fea681da | 1955 | .TP |
62e4a418 MK |
1956 | (15) \fIstime\fP \ %lu |
1957 | Amount of time that this process has been scheduled in kernel mode, | |
7a017e24 | 1958 | measured in clock ticks (divide by |
67914165 | 1959 | .IR sysconf(_SC_CLK_TCK) ). |
fea681da | 1960 | .TP |
62e4a418 MK |
1961 | (16) \fIcutime\fP \ %ld |
1962 | Amount of time that this process's | |
7a017e24 MK |
1963 | waited-for children have been scheduled in user mode, |
1964 | measured in clock ticks (divide by | |
67914165 | 1965 | .IR sysconf(_SC_CLK_TCK) ). |
c13182ef | 1966 | (See also |
fea681da | 1967 | .BR times (2).) |
a1c9dc59 MK |
1968 | This includes guest time, \fIcguest_time\fP |
1969 | (time spent running a virtual CPU, see below). | |
fea681da | 1970 | .TP |
62e4a418 MK |
1971 | (17) \fIcstime\fP \ %ld |
1972 | Amount of time that this process's | |
7a017e24 MK |
1973 | waited-for children have been scheduled in kernel mode, |
1974 | measured in clock ticks (divide by | |
67914165 | 1975 | .IR sysconf(_SC_CLK_TCK) ). |
fea681da | 1976 | .TP |
62e4a418 MK |
1977 | (18) \fIpriority\fP \ %ld |
1978 | (Explanation for Linux 2.6) | |
59a40ed7 MK |
1979 | For processes running a real-time scheduling policy |
1980 | .RI ( policy | |
1981 | below; see | |
1982 | .BR sched_setscheduler (2)), | |
1983 | this is the negated scheduling priority, minus one; | |
1984 | that is, a number in the range \-2 to \-100, | |
1985 | corresponding to real-time priorities 1 to 99. | |
1986 | For processes running under a non-real-time scheduling policy, | |
1987 | this is the raw nice value | |
1988 | .RB ( setpriority (2)) | |
1989 | as represented in the kernel. | |
1990 | The kernel stores nice values as numbers | |
1991 | in the range 0 (high) to 39 (low), | |
1992 | corresponding to the user-visible nice range of \-20 to 19. | |
2dad4c59 | 1993 | .IP |
59a40ed7 MK |
1994 | Before Linux 2.6, this was a scaled value based on |
1995 | the scheduler weighting given to this process. | |
1996 | .\" And back in kernel 1.2 days things were different again. | |
fea681da | 1997 | .TP |
62e4a418 MK |
1998 | (19) \fInice\fP \ %ld |
1999 | The nice value (see | |
59a40ed7 MK |
2000 | .BR setpriority (2)), |
2001 | a value in the range 19 (low priority) to \-20 (high priority). | |
2002 | .\" Back in kernel 1.2 days things were different. | |
fea681da MK |
2003 | .\" .TP |
2004 | .\" \fIcounter\fP %ld | |
2005 | .\" The current maximum size in jiffies of the process's next timeslice, | |
2006 | .\" or what is currently left of its current timeslice, if it is the | |
2007 | .\" currently running process. | |
2008 | .\" .TP | |
2009 | .\" \fItimeout\fP %u | |
2010 | .\" The time in jiffies of the process's next timeout. | |
0e94f77b | 2011 | .\" timeout was removed sometime around 2.1/2.2 |
aa610245 | 2012 | .TP |
62e4a418 MK |
2013 | (20) \fInum_threads\fP \ %ld |
2014 | Number of threads in this process (since Linux 2.6). | |
bb83d1b9 | 2015 | Before kernel 2.6, this field was hard coded to 0 as a placeholder |
0e94f77b | 2016 | for an earlier removed field. |
fea681da | 2017 | .TP |
62e4a418 MK |
2018 | (21) \fIitrealvalue\fP \ %ld |
2019 | The time in jiffies before the next | |
8bd58774 MK |
2020 | .B SIGALRM |
2021 | is sent to the process due to an interval timer. | |
0e94f77b MK |
2022 | Since kernel 2.6.17, this field is no longer maintained, |
2023 | and is hard coded as 0. | |
fea681da | 2024 | .TP |
62e4a418 MK |
2025 | (22) \fIstarttime\fP \ %llu |
2026 | The time the process started after system boot. | |
055024ed MK |
2027 | In kernels before Linux 2.6, this value was expressed in jiffies. |
2028 | Since Linux 2.6, the value is expressed in clock ticks (divide by | |
2029 | .IR sysconf(_SC_CLK_TCK) ). | |
2dad4c59 | 2030 | .IP |
62e4a418 | 2031 | The format for this field was %lu before Linux 2.6. |
fea681da | 2032 | .TP |
62e4a418 MK |
2033 | (23) \fIvsize\fP \ %lu |
2034 | Virtual memory size in bytes. | |
fea681da | 2035 | .TP |
62e4a418 MK |
2036 | (24) \fIrss\fP \ %ld |
2037 | Resident Set Size: number of pages the process has in real memory. | |
c13182ef | 2038 | This is just the pages which |
5fab2e7c | 2039 | count toward text, data, or stack space. |
c13182ef | 2040 | This does not include pages |
fea681da MK |
2041 | which have not been demand-loaded in, or which are swapped out. |
2042 | .TP | |
62e4a418 MK |
2043 | (25) \fIrsslim\fP \ %lu |
2044 | Current soft limit in bytes on the rss of the process; | |
59a40ed7 MK |
2045 | see the description of |
2046 | .B RLIMIT_RSS | |
2047 | in | |
2b5407af | 2048 | .BR getrlimit (2). |
fea681da | 2049 | .TP |
b02b4b74 | 2050 | (26) \fIstartcode\fP \ %lu \ [PT] |
62e4a418 | 2051 | The address above which program text can run. |
fea681da | 2052 | .TP |
b02b4b74 | 2053 | (27) \fIendcode\fP \ %lu \ [PT] |
62e4a418 | 2054 | The address below which program text can run. |
fea681da | 2055 | .TP |
b02b4b74 | 2056 | (28) \fIstartstack\fP \ %lu \ [PT] |
62e4a418 | 2057 | The address of the start (i.e., bottom) of the stack. |
fea681da | 2058 | .TP |
b02b4b74 | 2059 | (29) \fIkstkesp\fP \ %lu \ [PT] |
62e4a418 | 2060 | The current value of ESP (stack pointer), as found in the |
fea681da MK |
2061 | kernel stack page for the process. |
2062 | .TP | |
b02b4b74 | 2063 | (30) \fIkstkeip\fP \ %lu \ [PT] |
62e4a418 | 2064 | The current EIP (instruction pointer). |
fea681da | 2065 | .TP |
62e4a418 MK |
2066 | (31) \fIsignal\fP \ %lu |
2067 | The bitmap of pending signals, displayed as a decimal number. | |
59a40ed7 | 2068 | Obsolete, because it does not provide information on real-time signals; use |
69119dc7 | 2069 | .I /proc/[pid]/status |
59a40ed7 | 2070 | instead. |
fea681da | 2071 | .TP |
62e4a418 MK |
2072 | (32) \fIblocked\fP \ %lu |
2073 | The bitmap of blocked signals, displayed as a decimal number. | |
59a40ed7 | 2074 | Obsolete, because it does not provide information on real-time signals; use |
69119dc7 | 2075 | .I /proc/[pid]/status |
59a40ed7 | 2076 | instead. |
fea681da | 2077 | .TP |
62e4a418 MK |
2078 | (33) \fIsigignore\fP \ %lu |
2079 | The bitmap of ignored signals, displayed as a decimal number. | |
59a40ed7 | 2080 | Obsolete, because it does not provide information on real-time signals; use |
69119dc7 | 2081 | .I /proc/[pid]/status |
59a40ed7 | 2082 | instead. |
fea681da | 2083 | .TP |
62e4a418 MK |
2084 | (34) \fIsigcatch\fP \ %lu |
2085 | The bitmap of caught signals, displayed as a decimal number. | |
59a40ed7 | 2086 | Obsolete, because it does not provide information on real-time signals; use |
69119dc7 | 2087 | .I /proc/[pid]/status |
59a40ed7 | 2088 | instead. |
fea681da | 2089 | .TP |
b02b4b74 | 2090 | (35) \fIwchan\fP \ %lu \ [PT] |
62e4a418 | 2091 | This is the "channel" in which the process is waiting. |
2054f761 MK |
2092 | It is the address of a location in the kernel where the process is sleeping. |
2093 | The corresponding symbolic name can be found in | |
2094 | .IR /proc/[pid]/wchan . | |
fea681da | 2095 | .TP |
62e4a418 | 2096 | (36) \fInswap\fP \ %lu |
0633f951 | 2097 | .\" nswap was added in 2.0 |
4d9b6984 | 2098 | Number of pages swapped (not maintained). |
fea681da | 2099 | .TP |
62e4a418 | 2100 | (37) \fIcnswap\fP \ %lu |
0633f951 | 2101 | .\" cnswap was added in 2.0 |
4d9b6984 | 2102 | Cumulative \fInswap\fP for child processes (not maintained). |
fea681da | 2103 | .TP |
62e4a418 MK |
2104 | (38) \fIexit_signal\fP \ %d \ (since Linux 2.1.22) |
2105 | Signal to be sent to parent when we die. | |
fea681da | 2106 | .TP |
62e4a418 MK |
2107 | (39) \fIprocessor\fP \ %d \ (since Linux 2.2.8) |
2108 | CPU number last executed on. | |
568105c6 | 2109 | .TP |
62e4a418 MK |
2110 | (40) \fIrt_priority\fP \ %u \ (since Linux 2.5.19) |
2111 | Real-time scheduling priority, a number in the range 1 to 99 for | |
59a40ed7 MK |
2112 | processes scheduled under a real-time policy, |
2113 | or 0, for non-real-time processes (see | |
568105c6 MK |
2114 | .BR sched_setscheduler (2)). |
2115 | .TP | |
62e4a418 MK |
2116 | (41) \fIpolicy\fP \ %u \ (since Linux 2.5.19) |
2117 | Scheduling policy (see | |
568105c6 | 2118 | .BR sched_setscheduler (2)). |
cd60dedd | 2119 | Decode using the SCHED_* constants in |
59a40ed7 | 2120 | .IR linux/sched.h . |
2dad4c59 | 2121 | .IP |
62e4a418 | 2122 | The format for this field was %lu before Linux 2.6.22. |
167450d6 | 2123 | .TP |
62e4a418 MK |
2124 | (42) \fIdelayacct_blkio_ticks\fP \ %llu \ (since Linux 2.6.18) |
2125 | Aggregated block I/O delays, measured in clock ticks (centiseconds). | |
14c06953 | 2126 | .TP |
62e4a418 MK |
2127 | (43) \fIguest_time\fP \ %lu \ (since Linux 2.6.24) |
2128 | Guest time of the process (time spent running a virtual CPU | |
7a017e24 | 2129 | for a guest operating system), measured in clock ticks (divide by |
67914165 | 2130 | .IR sysconf(_SC_CLK_TCK) ). |
14c06953 | 2131 | .TP |
62e4a418 MK |
2132 | (44) \fIcguest_time\fP \ %ld \ (since Linux 2.6.24) |
2133 | Guest time of the process's children, measured in clock ticks (divide by | |
67914165 | 2134 | .IR sysconf(_SC_CLK_TCK) ). |
fea681da | 2135 | .TP |
b02b4b74 | 2136 | (45) \fIstart_data\fP \ %lu \ (since Linux 3.3) \ [PT] |
0be30a54 | 2137 | .\" commit b3f7f573a20081910e34e99cbc91831f4f02f1ff |
62e4a418 | 2138 | Address above which program initialized and |
426bc8d7 | 2139 | uninitialized (BSS) data are placed. |
12449ae3 | 2140 | .TP |
b02b4b74 | 2141 | (46) \fIend_data\fP \ %lu \ (since Linux 3.3) \ [PT] |
0be30a54 | 2142 | .\" commit b3f7f573a20081910e34e99cbc91831f4f02f1ff |
62e4a418 | 2143 | Address below which program initialized and |
426bc8d7 | 2144 | uninitialized (BSS) data are placed. |
12449ae3 | 2145 | .TP |
b02b4b74 | 2146 | (47) \fIstart_brk\fP \ %lu \ (since Linux 3.3) \ [PT] |
0be30a54 | 2147 | .\" commit b3f7f573a20081910e34e99cbc91831f4f02f1ff |
62e4a418 | 2148 | Address above which program heap can be expanded with |
426bc8d7 | 2149 | .BR brk (2). |
12449ae3 | 2150 | .TP |
b02b4b74 | 2151 | (48) \fIarg_start\fP \ %lu \ (since Linux 3.5) \ [PT] |
0be30a54 | 2152 | .\" commit 5b172087f99189416d5f47fd7ab5e6fb762a9ba3 |
62e4a418 | 2153 | Address above which program command-line arguments |
426bc8d7 MK |
2154 | .RI ( argv ) |
2155 | are placed. | |
12449ae3 | 2156 | .TP |
b02b4b74 | 2157 | (49) \fIarg_end\fP \ %lu \ (since Linux 3.5) \ [PT] |
0be30a54 | 2158 | .\" commit 5b172087f99189416d5f47fd7ab5e6fb762a9ba3 |
62e4a418 | 2159 | Address below program command-line arguments |
426bc8d7 MK |
2160 | .RI ( argv ) |
2161 | are placed. | |
12449ae3 | 2162 | .TP |
b02b4b74 | 2163 | (50) \fIenv_start\fP \ %lu \ (since Linux 3.5) \ [PT] |
0be30a54 | 2164 | .\" commit 5b172087f99189416d5f47fd7ab5e6fb762a9ba3 |
62e4a418 | 2165 | Address above which program environment is placed. |
12449ae3 | 2166 | .TP |
b02b4b74 | 2167 | (51) \fIenv_end\fP \ %lu \ (since Linux 3.5) \ [PT] |
0be30a54 | 2168 | .\" commit 5b172087f99189416d5f47fd7ab5e6fb762a9ba3 |
62e4a418 | 2169 | Address below which program environment is placed. |
12449ae3 | 2170 | .TP |
b02b4b74 | 2171 | (52) \fIexit_code\fP \ %d \ (since Linux 3.5) \ [PT] |
0be30a54 | 2172 | .\" commit 5b172087f99189416d5f47fd7ab5e6fb762a9ba3 |
62e4a418 | 2173 | The thread's exit status in the form reported by |
426bc8d7 | 2174 | .BR waitpid (2). |
12449ae3 | 2175 | .RE |
2176 | .TP | |
69119dc7 | 2177 | .I /proc/[pid]/statm |
59a40ed7 | 2178 | Provides information about memory usage, measured in pages. |
c13182ef | 2179 | The columns are: |
37d5e699 | 2180 | .IP |
a08ea57c | 2181 | .in +4n |
37d5e699 | 2182 | .EX |
cb42fb56 | 2183 | size (1) total program size |
69119dc7 | 2184 | (same as VmSize in \fI/proc/[pid]/status\fP) |
cb42fb56 | 2185 | resident (2) resident set size |
69119dc7 | 2186 | (same as VmRSS in \fI/proc/[pid]/status\fP) |
4e6fa352 MK |
2187 | shared (3) number of resident shared pages (i.e., backed by a file) |
2188 | (same as RssFile+RssShmem in \fI/proc/[pid]/status\fP) | |
cb42fb56 | 2189 | text (4) text (code) |
59a40ed7 | 2190 | .\" (not including libs; broken, includes data segment) |
d133b9b3 | 2191 | lib (5) library (unused since Linux 2.6; always 0) |
cb42fb56 | 2192 | data (6) data + stack |
59a40ed7 | 2193 | .\" (including libs; broken, includes library text) |
d133b9b3 | 2194 | dt (7) dirty pages (unused since Linux 2.6; always 0) |
37d5e699 | 2195 | .EE |
a08ea57c | 2196 | .in |
fea681da | 2197 | .TP |
69119dc7 | 2198 | .I /proc/[pid]/status |
fea681da | 2199 | Provides much of the information in |
69119dc7 | 2200 | .I /proc/[pid]/stat |
fea681da | 2201 | and |
69119dc7 | 2202 | .I /proc/[pid]/statm |
fea681da | 2203 | in a format that's easier for humans to parse. |
16b5f7ba | 2204 | Here's an example: |
37d5e699 | 2205 | .IP |
16b5f7ba | 2206 | .in +4n |
37d5e699 | 2207 | .EX |
b43a3b30 | 2208 | .RB "$" " cat /proc/$$/status" |
16b5f7ba | 2209 | Name: bash |
a79343e9 | 2210 | Umask: 0022 |
16b5f7ba | 2211 | State: S (sleeping) |
aac0b30f | 2212 | Tgid: 17248 |
2d2dfb69 | 2213 | Ngid: 0 |
aac0b30f MK |
2214 | Pid: 17248 |
2215 | PPid: 17200 | |
16b5f7ba MK |
2216 | TracerPid: 0 |
2217 | Uid: 1000 1000 1000 1000 | |
2218 | Gid: 100 100 100 100 | |
2219 | FDSize: 256 | |
2220 | Groups: 16 33 100 | |
aac0b30f MK |
2221 | NStgid: 17248 |
2222 | NSpid: 17248 | |
2223 | NSpgid: 17248 | |
2224 | NSsid: 17200 | |
06b7cee0 MK |
2225 | VmPeak: 131168 kB |
2226 | VmSize: 131168 kB | |
2227 | VmLck: 0 kB | |
2228 | VmPin: 0 kB | |
2229 | VmHWM: 13484 kB | |
2230 | VmRSS: 13484 kB | |
e546617e MK |
2231 | RssAnon: 10264 kB |
2232 | RssFile: 3220 kB | |
2233 | RssShmem: 0 kB | |
06b7cee0 MK |
2234 | VmData: 10332 kB |
2235 | VmStk: 136 kB | |
2236 | VmExe: 992 kB | |
2237 | VmLib: 2104 kB | |
2238 | VmPTE: 76 kB | |
2239 | VmPMD: 12 kB | |
2240 | VmSwap: 0 kB | |
4084d612 | 2241 | HugetlbPages: 0 kB # 4.4 |
16b5f7ba MK |
2242 | Threads: 1 |
2243 | SigQ: 0/3067 | |
2244 | SigPnd: 0000000000000000 | |
2245 | ShdPnd: 0000000000000000 | |
2246 | SigBlk: 0000000000010000 | |
2247 | SigIgn: 0000000000384004 | |
2248 | SigCgt: 000000004b813efb | |
2249 | CapInh: 0000000000000000 | |
2250 | CapPrm: 0000000000000000 | |
2251 | CapEff: 0000000000000000 | |
2252 | CapBnd: ffffffffffffffff | |
6112ea97 | 2253 | CapAmb: 0000000000000000 |
6c0ed873 | 2254 | NoNewPrivs: 0 |
039b6546 | 2255 | Seccomp: 0 |
16b5f7ba MK |
2256 | Cpus_allowed: 00000001 |
2257 | Cpus_allowed_list: 0 | |
2258 | Mems_allowed: 1 | |
2259 | Mems_allowed_list: 0 | |
2260 | voluntary_ctxt_switches: 150 | |
2261 | nonvoluntary_ctxt_switches: 545 | |
37d5e699 | 2262 | .EE |
16b5f7ba MK |
2263 | .in |
2264 | .IP | |
2265 | The fields are as follows: | |
2266 | .RS | |
2267 | .IP * 2 | |
2268 | .IR Name : | |
2269 | Command run by this process. | |
2270 | .IP * | |
a79343e9 | 2271 | .IR Umask : |
53473996 MK |
2272 | Process umask, expressed in octal with a leading zero; see |
2273 | .BR umask (2). | |
a79343e9 MK |
2274 | (Since Linux 4.7.) |
2275 | .IP * | |
16b5f7ba | 2276 | .IR State : |
4175f999 MK |
2277 | Current state of the process. |
2278 | One of | |
16b5f7ba MK |
2279 | "R (running)", |
2280 | "S (sleeping)", | |
2281 | "D (disk sleep)", | |
2282 | "T (stopped)", | |
2283 | "T (tracing stop)", | |
2284 | "Z (zombie)", | |
2285 | or | |
2286 | "X (dead)". | |
2287 | .IP * | |
2288 | .IR Tgid : | |
2289 | Thread group ID (i.e., Process ID). | |
2290 | .IP * | |
2d2dfb69 MK |
2291 | .IR Ngid : |
2292 | NUMA group ID (0 if none; since Linux 3.13). | |
2293 | .IP * | |
16b5f7ba MK |
2294 | .IR Pid : |
2295 | Thread ID (see | |
2296 | .BR gettid (2)). | |
2297 | .IP * | |
a1bc91d5 MK |
2298 | .IR PPid : |
2299 | PID of parent process. | |
2300 | .IP * | |
16b5f7ba MK |
2301 | .IR TracerPid : |
2302 | PID of process tracing this process (0 if not being traced). | |
2303 | .IP * | |
2304 | .IR Uid ", " Gid : | |
9ee4a2b6 | 2305 | Real, effective, saved set, and filesystem UIDs (GIDs). |
16b5f7ba MK |
2306 | .IP * |
2307 | .IR FDSize : | |
2308 | Number of file descriptor slots currently allocated. | |
2309 | .IP * | |
2310 | .IR Groups : | |
2311 | Supplementary group list. | |
2312 | .IP * | |
ecc9535d | 2313 | .I NStgid : |
aac0b30f MK |
2314 | Thread group ID (i.e., PID) in each of the PID namespaces of which |
2315 | .I [pid] | |
2316 | is a member. | |
2317 | The leftmost entry shows the value with respect to the PID namespace | |
2318 | of the reading process, | |
2319 | followed by the value in successively nested inner namespaces. | |
2320 | .\" commit e4bc33245124db69b74a6d853ac76c2976f472d5 | |
2321 | (Since Linux 4.1.) | |
2322 | .IP * | |
ecc9535d | 2323 | .IR NSpid: |
aac0b30f MK |
2324 | Thread ID in each of the PID namespaces of which |
2325 | .I [pid] | |
2326 | is a member. | |
2327 | The fields are ordered as for | |
2328 | .IR NStgid . | |
2329 | (Since Linux 4.1.) | |
2330 | .IP * | |
ecc9535d | 2331 | .IR NSpgid : |
aac0b30f MK |
2332 | Process group ID in each of the PID namespaces of which |
2333 | .I [pid] | |
2334 | is a member. | |
2335 | The fields are ordered as for | |
2336 | .IR NStgid . | |
2337 | (Since Linux 4.1.) | |
2338 | .IP * | |
ecc9535d | 2339 | .IR NSsid : |
aac0b30f MK |
2340 | descendant namespace session ID hierarchy |
2341 | Session ID in each of the PID namespaces of which | |
2342 | .I [pid] | |
2343 | is a member. | |
2344 | The fields are ordered as for | |
2345 | .IR NStgid . | |
2346 | (Since Linux 4.1.) | |
2347 | .IP * | |
16b5f7ba MK |
2348 | .IR VmPeak : |
2349 | Peak virtual memory size. | |
2350 | .IP * | |
2351 | .IR VmSize : | |
2352 | Virtual memory size. | |
2353 | .IP * | |
2354 | .IR VmLck : | |
fde39195 MK |
2355 | Locked memory size (see |
2356 | .BR mlock (3)). | |
16b5f7ba | 2357 | .IP * |
15789039 TY |
2358 | .IR VmPin : |
2359 | Pinned memory size | |
2360 | .\" commit bc3e53f682d93df677dbd5006a404722b3adfe18 | |
2361 | (since Linux 3.2). | |
2362 | These are pages that can't be moved because something needs to | |
2363 | directly access physical memory. | |
2364 | .IP * | |
16b5f7ba MK |
2365 | .IR VmHWM : |
2366 | Peak resident set size ("high water mark"). | |
2367 | .IP * | |
2368 | .IR VmRSS : | |
2369 | Resident set size. | |
e546617e MK |
2370 | Note that the value here is the sum of |
2371 | .IR RssAnon , | |
2372 | .IR RssFile , | |
2373 | and | |
2374 | .IR RssShmem . | |
2375 | .IP * | |
2376 | .IR RssAnon : | |
2377 | Size of resident anonymous memory. | |
2378 | .\" commit bf9683d6990589390b5178dafe8fd06808869293 | |
2379 | (since Linux 4.5). | |
2380 | .IP * | |
2381 | .IR RssFile : | |
2382 | Size of resident file mappings. | |
2383 | .\" commit bf9683d6990589390b5178dafe8fd06808869293 | |
2384 | (since Linux 4.5). | |
2385 | .IP * | |
2386 | .IR RssShmem : | |
78230722 | 2387 | Size of resident shared memory (includes System V shared memory, |
4e07c70f MK |
2388 | mappings from |
2389 | .BR tmpfs (5), | |
2390 | and shared anonymous mappings). | |
e546617e MK |
2391 | .\" commit bf9683d6990589390b5178dafe8fd06808869293 |
2392 | (since Linux 4.5). | |
16b5f7ba MK |
2393 | .IP * |
2394 | .IR VmData ", " VmStk ", " VmExe : | |
2395 | Size of data, stack, and text segments. | |
2396 | .IP * | |
2397 | .IR VmLib : | |
2398 | Shared library code size. | |
2399 | .IP * | |
2400 | .IR VmPTE : | |
2401 | Page table entries size (since Linux 2.6.10). | |
2402 | .IP * | |
e28af9cd MK |
2403 | .IR VmPMD : |
2404 | .\" commit dc6c9a35b66b520cf67e05d8ca60ebecad3b0479 | |
73b9cbe1 | 2405 | Size of second-level page tables (since Linux 4.0). |
e28af9cd | 2406 | .IP * |
ac4b0eb3 | 2407 | .IR VmSwap : |
1ddc1665 | 2408 | .\" commit b084d4353ff99d824d3bc5a5c2c22c70b1fba722 |
fce21149 MK |
2409 | Swapped-out virtual memory size by anonymous private pages; |
2410 | shmem swap usage is not included (since Linux 2.6.34). | |
49f6dda7 | 2411 | .IP * |
4084d612 MK |
2412 | .IR HugetlbPages : |
2413 | Size of hugetlb memory portions. | |
2414 | .\" commit 5d317b2b6536592a9b51fe65faed43d65ca9158e | |
2415 | (since Linux 4.4). | |
2416 | .IP * | |
16b5f7ba MK |
2417 | .IR Threads : |
2418 | Number of threads in process containing this thread. | |
2419 | .IP * | |
6ee625eb MK |
2420 | .IR SigQ : |
2421 | This field contains two slash-separated numbers that relate to | |
2422 | queued signals for the real user ID of this process. | |
2423 | The first of these is the number of currently queued | |
2424 | signals for this real user ID, and the second is the | |
2425 | resource limit on the number of queued signals for this process | |
2426 | (see the description of | |
2427 | .BR RLIMIT_SIGPENDING | |
2428 | in | |
2429 | .BR getrlimit (2)). | |
2430 | .IP * | |
16b5f7ba MK |
2431 | .IR SigPnd ", " ShdPnd : |
2432 | Number of signals pending for thread and for process as a whole (see | |
2433 | .BR pthreads (7) | |
2434 | and | |
2435 | .BR signal (7)). | |
2436 | .IP * | |
2437 | .IR SigBlk ", " SigIgn ", " SigCgt : | |
2438 | Masks indicating signals being blocked, ignored, and caught (see | |
2439 | .BR signal (7)). | |
2440 | .IP * | |
2441 | .IR CapInh ", " CapPrm ", " CapEff : | |
2442 | Masks of capabilities enabled in inheritable, permitted, and effective sets | |
2443 | (see | |
2444 | .BR capabilities (7)). | |
2445 | .IP * | |
2446 | .IR CapBnd : | |
2447 | Capability Bounding set | |
7e07d950 | 2448 | (since Linux 2.6.26, see |
16b5f7ba MK |
2449 | .BR capabilities (7)). |
2450 | .IP * | |
6112ea97 MK |
2451 | .IR CapAmb : |
2452 | Ambient capability set | |
2453 | (since Linux 4.3, see | |
2454 | .BR capabilities (7)). | |
2455 | .IP * | |
6c0ed873 MK |
2456 | .IR NoNewPrivs : |
2457 | .\" commit af884cd4a5ae62fcf5e321fecf0ec1014730353d | |
2458 | Value of the | |
2459 | .I no_new_privs | |
2460 | bit | |
2461 | (since Linux 4.10, see | |
2462 | .BR prctl (2)). | |
2463 | .IP * | |
039b6546 MK |
2464 | .IR Seccomp : |
2465 | .\" commit 2f4b3bf6b2318cfaa177ec5a802f4d8d6afbd816 | |
2466 | Seccomp mode of the process | |
2467 | (since Linux 3.8, see | |
2468 | .BR seccomp (2)). | |
2469 | 0 means | |
2470 | .BR SECCOMP_MODE_DISABLED ; | |
2471 | 1 means | |
2472 | .BR SECCOMP_MODE_STRICT ; | |
2473 | 2 means | |
2474 | .BR SECCOMP_MODE_FILTER . | |
2475 | This field is provided only if the kernel was built with the | |
2476 | .BR CONFIG_SECCOMP | |
2477 | kernel configuration option enabled. | |
2478 | .IP * | |
16b5f7ba MK |
2479 | .IR Cpus_allowed : |
2480 | Mask of CPUs on which this process may run | |
2481 | (since Linux 2.6.24, see | |
2482 | .BR cpuset (7)). | |
2483 | .IP * | |
2484 | .IR Cpus_allowed_list : | |
2485 | Same as previous, but in "list format" | |
2486 | (since Linux 2.6.26, see | |
2487 | .BR cpuset (7)). | |
2488 | .IP * | |
2489 | .IR Mems_allowed : | |
2490 | Mask of memory nodes allowed to this process | |
2491 | (since Linux 2.6.24, see | |
2492 | .BR cpuset (7)). | |
2493 | .IP * | |
2494 | .IR Mems_allowed_list : | |
2495 | Same as previous, but in "list format" | |
2496 | (since Linux 2.6.26, see | |
2497 | .BR cpuset (7)). | |
2498 | .IP * | |
7c82878a | 2499 | .IR voluntary_ctxt_switches ", " nonvoluntary_ctxt_switches : |
16b5f7ba MK |
2500 | Number of voluntary and involuntary context switches (since Linux 2.6.23). |
2501 | .RE | |
afb7b014 MK |
2502 | .TP |
2503 | .IR /proc/[pid]/syscall " (since Linux 2.6.27)" | |
2504 | .\" commit ebcb67341fee34061430f3367f2e507e52ee051b | |
2505 | This file exposes the system call number and argument registers for the | |
2506 | system call currently being executed by the process, | |
2507 | followed by the values of the stack pointer and program counter registers. | |
2508 | The values of all six argument registers are exposed, | |
2509 | although most system calls use fewer registers. | |
2dad4c59 | 2510 | .IP |
afb7b014 | 2511 | If the process is blocked, but not in a system call, |
1fb61947 | 2512 | then the file displays \-1 in place of the system call number, |
afb7b014 | 2513 | followed by just the values of the stack pointer and program counter. |
64fcb6e1 | 2514 | If process is not blocked, then the file contains just the string "running". |
2dad4c59 | 2515 | .IP |
afb7b014 MK |
2516 | This file is present only if the kernel was configured with |
2517 | .BR CONFIG_HAVE_ARCH_TRACEHOOK . | |
2dad4c59 | 2518 | .IP |
4834ae91 MK |
2519 | Permission to access this file is governed by a ptrace access mode |
2520 | .B PTRACE_MODE_ATTACH_FSCREDS | |
2521 | check; see | |
2522 | .BR ptrace (2). | |
fea681da | 2523 | .TP |
69119dc7 | 2524 | .IR /proc/[pid]/task " (since Linux 2.6.0-test6)" |
afcaf646 MK |
2525 | This is a directory that contains one subdirectory |
2526 | for each thread in the process. | |
69119dc7 MK |
2527 | The name of each subdirectory is the numerical thread ID |
2528 | .RI ( [tid] ) | |
2529 | of the thread (see | |
afcaf646 MK |
2530 | .BR gettid (2)). |
2531 | Within each of these subdirectories, there is a set of | |
2532 | files with the same names and contents as under the | |
69119dc7 | 2533 | .I /proc/[pid] |
afcaf646 MK |
2534 | directories. |
2535 | For attributes that are shared by all threads, the contents for | |
2536 | each of the files under the | |
69119dc7 | 2537 | .I task/[tid] |
afcaf646 | 2538 | subdirectories will be the same as in the corresponding |
c13182ef | 2539 | file in the parent |
69119dc7 | 2540 | .I /proc/[pid] |
afcaf646 | 2541 | directory |
c13182ef | 2542 | (e.g., in a multithreaded process, all of the |
69119dc7 | 2543 | .I task/[tid]/cwd |
c13182ef | 2544 | files will have the same value as the |
69119dc7 | 2545 | .I /proc/[pid]/cwd |
c13182ef | 2546 | file in the parent directory, since all of the threads in a process |
afcaf646 MK |
2547 | share a working directory). |
2548 | For attributes that are distinct for each thread, | |
c13182ef | 2549 | the corresponding files under |
69119dc7 | 2550 | .I task/[tid] |
afcaf646 | 2551 | may have different values (e.g., various fields in each of the |
69119dc7 | 2552 | .I task/[tid]/status |
4a40c703 JH |
2553 | files may be different for each thread), |
2554 | .\" in particular: "children" :/ | |
2555 | or they might not exist in | |
2556 | .I /proc/[pid] | |
2557 | at all. | |
afcaf646 MK |
2558 | .\" The following was still true as at kernel 2.6.13 |
2559 | In a multithreaded process, the contents of the | |
69119dc7 | 2560 | .I /proc/[pid]/task |
c13182ef | 2561 | directory are not available if the main thread has already terminated |
afcaf646 MK |
2562 | (typically by calling |
2563 | .BR pthread_exit (3)). | |
2dad4c59 | 2564 | .IP |
4a40c703 JH |
2565 | .TP |
2566 | .IR /proc/[pid]/task/[tid]/children " (since Linux 3.5)" | |
2567 | .\" commit 818411616baf46ceba0cff6f05af3a9b294734f7 | |
2568 | A space-separated list of child tasks of this task. | |
2569 | Each child task is represented by its TID. | |
2dad4c59 | 2570 | .IP |
4a40c703 | 2571 | .\" see comments in get_children_pid() in fs/proc/array.c |
45dd5092 MK |
2572 | This option is intended for use by the checkpoint-restore (CRIU) system, |
2573 | and reliably provides a list of children only if all of the child processes | |
2574 | are stopped or frozen. | |
2575 | It does not work properly if children of the target task exit while | |
4a40c703 | 2576 | the file is being read! |
45dd5092 | 2577 | Exiting children may cause non-exiting children to be omitted from the list. |
4a40c703 | 2578 | This makes this interface even more unreliable than classic PID-based |
45dd5092 MK |
2579 | approaches if the inspected task and its children aren't frozen, |
2580 | and most code should probably not use this interface. | |
2dad4c59 | 2581 | .IP |
7ded2db4 MK |
2582 | Until Linux 4.2, the presence of this file was governed by the |
2583 | .B CONFIG_CHECKPOINT_RESTORE | |
2584 | kernel configuration option. | |
2585 | Since Linux 4.2, | |
2586 | .\" commit 2e13ba54a2682eea24918b87ad3edf70c2cf085b | |
ae34c521 | 2587 | it is governed by the |
7ded2db4 MK |
2588 | .B CONFIG_PROC_CHILDREN |
2589 | option. | |
afcaf646 | 2590 | .TP |
1509ca0e MK |
2591 | .IR /proc/[pid]/timers " (since Linux 3.10)" |
2592 | .\" commit 5ed67f05f66c41e39880a6d61358438a25f9fee5 | |
2593 | .\" commit 48f6a7a511ef8823fdff39afee0320092d43a8a0 | |
2594 | A list of the POSIX timers for this process. | |
93691c1e | 2595 | Each timer is listed with a line that starts with the string "ID:". |
1509ca0e | 2596 | For example: |
2dad4c59 | 2597 | .IP |
1509ca0e | 2598 | .in +4n |
37d5e699 | 2599 | .EX |
1509ca0e MK |
2600 | ID: 1 |
2601 | signal: 60/00007fff86e452a8 | |
2602 | notify: signal/pid.2634 | |
2603 | ClockID: 0 | |
2604 | ID: 0 | |
2605 | signal: 60/00007fff86e452a8 | |
2606 | notify: signal/pid.2634 | |
2607 | ClockID: 1 | |
37d5e699 | 2608 | .EE |
1509ca0e | 2609 | .in |
2dad4c59 | 2610 | .IP |
1509ca0e MK |
2611 | The lines shown for each timer have the following meanings: |
2612 | .RS | |
2613 | .TP | |
2614 | .I ID | |
2615 | The ID for this timer. | |
2616 | This is not the same as the timer ID returned by | |
2617 | .BR timer_create (2); | |
2618 | rather, it is the same kernel-internal ID that is available via the | |
2619 | .I si_timerid | |
2620 | field of the | |
2621 | .IR siginfo_t | |
2622 | structure (see | |
2623 | .BR sigaction (2)). | |
2624 | .TP | |
2625 | .I signal | |
2626 | This is the signal number that this timer uses to deliver notifications | |
2627 | followed by a slash, and then the | |
7f1ea8fb | 2628 | .I sigev_value |
1509ca0e MK |
2629 | value supplied to the signal handler. |
2630 | Valid only for timers that notify via a signal. | |
2631 | .TP | |
2632 | .I notify | |
2633 | The part before the slash specifies the mechanism | |
2634 | that this timer uses to deliver notifications, | |
2635 | and is one of "thread", "signal", or "none". | |
2636 | Immediately following the slash is either the string "tid" for timers | |
2637 | with | |
2638 | .B SIGEV_THREAD_ID | |
2639 | notification, or "pid" for timers that notify by other mechanisms. | |
dbe6f88b MK |
2640 | Following the "." is the PID of the process |
2641 | (or the kernel thread ID of the thread) that will be delivered | |
1509ca0e MK |
2642 | a signal if the timer delivers notifications via a signal. |
2643 | .TP | |
2644 | .I ClockID | |
2645 | This field identifies the clock that the timer uses for measuring time. | |
2646 | For most clocks, this is a number that matches one of the user-space | |
2647 | .BR CLOCK_* | |
9d54c087 | 2648 | constants exposed via |
1509ca0e MK |
2649 | .IR <time.h> . |
2650 | .B CLOCK_PROCESS_CPUTIME_ID | |
9bc87ed0 | 2651 | timers display with a value of \-6 |
1509ca0e MK |
2652 | in this field. |
2653 | .B CLOCK_THREAD_CPUTIME_ID | |
9bc87ed0 | 2654 | timers display with a value of \-2 |
1509ca0e MK |
2655 | in this field. |
2656 | .RE | |
5734da6d MK |
2657 | .IP |
2658 | This file is available only when the kernel was configured with | |
2659 | .BR CONFIG_CHECKPOINT_RESTORE . | |
1509ca0e | 2660 | .TP |
11f60142 MK |
2661 | .IR /proc/[pid]/timerslack_ns " (since Linux 4.6)" |
2662 | .\" commit da8b44d5a9f8bf26da637b7336508ca534d6b319 | |
2663 | .\" commit 5de23d435e88996b1efe0e2cebe242074ce67c9e | |
2664 | This file exposes the process's "current" timer slack value, | |
2665 | expressed in nanoseconds. | |
2666 | The file is writable, | |
2667 | allowing the process's timer slack value to be changed. | |
2668 | Writing 0 to this file resets the "current" timer slack to the | |
2669 | "default" timer slack value. | |
2670 | For further details, see the discussion of | |
2671 | .BR PR_SET_TIMERSLACK | |
2672 | in | |
2673 | .BR prctl (2). | |
2dad4c59 | 2674 | .IP |
5daae264 MK |
2675 | Initially, |
2676 | permission to access this file was governed by a ptrace access mode | |
a62e0e01 | 2677 | .B PTRACE_MODE_ATTACH_FSCREDS |
5daae264 MK |
2678 | check (see |
2679 | .BR ptrace (2)). | |
2680 | However, this was subsequently deemed too strict a requirement | |
2681 | (and had the side effect that requiring a process to have the | |
2682 | .B CAP_SYS_PTRACE | |
2683 | capability would also allow it to view and change any process's memory). | |
2684 | Therefore, since Linux 4.9, | |
2685 | .\" commit 7abbaf94049914f074306d960b0f968ffe52e59f | |
2686 | only the (weaker) | |
2687 | .B CAP_SYS_NICE | |
2688 | capability is required to access this file. | |
11f60142 | 2689 | .TP |
b1aad373 MK |
2690 | .IR /proc/[pid]/uid_map ", " /proc/[pid]/gid_map " (since Linux 3.5)" |
2691 | See | |
2692 | .BR user_namespaces (7). | |
2693 | .TP | |
2694 | .IR /proc/[pid]/wchan " (since Linux 2.6.0)" | |
2695 | The symbolic name corresponding to the location | |
2696 | in the kernel where the process is sleeping. | |
2dad4c59 | 2697 | .IP |
82664739 MK |
2698 | Permission to access this file is governed by a ptrace access mode |
2699 | .B PTRACE_MODE_READ_FSCREDS | |
2700 | check; see | |
2701 | .BR ptrace (2). | |
b1aad373 MK |
2702 | .TP |
2703 | .I /proc/apm | |
2704 | Advanced power management version and battery information when | |
2705 | .B CONFIG_APM | |
2706 | is defined at kernel compilation time. | |
2707 | .TP | |
2708 | .I /proc/buddyinfo | |
2709 | This file contains information which is used for diagnosing memory | |
2710 | fragmentation issues. | |
2711 | Each line starts with the identification of the node and the name | |
2712 | of the zone which together identify a memory region | |
2713 | This is then | |
2714 | followed by the count of available chunks of a certain order in | |
2715 | which these zones are split. | |
2716 | The size in bytes of a certain order is given by the formula: | |
2dad4c59 | 2717 | .IP |
b1aad373 | 2718 | (2^order)\ *\ PAGE_SIZE |
2dad4c59 | 2719 | .IP |
b1aad373 MK |
2720 | The binary buddy allocator algorithm inside the kernel will split |
2721 | one chunk into two chunks of a smaller order (thus with half the | |
2722 | size) or combine two contiguous chunks into one larger chunk of | |
2723 | a higher order (thus with double the size) to satisfy allocation | |
2724 | requests and to counter memory fragmentation. | |
2725 | The order matches the column number, when starting to count at zero. | |
2dad4c59 | 2726 | .IP |
b5b0d21e | 2727 | For example on an x86-64 system: |
2dad4c59 | 2728 | .IP |
b1aad373 | 2729 | .in -12n |
37d5e699 | 2730 | .EX |
b1aad373 MK |
2731 | Node 0, zone DMA 1 1 1 0 2 1 1 0 1 1 3 |
2732 | Node 0, zone DMA32 65 47 4 81 52 28 13 10 5 1 404 | |
2733 | Node 0, zone Normal 216 55 189 101 84 38 37 27 5 3 587 | |
37d5e699 | 2734 | .EE |
b1aad373 | 2735 | .in |
2dad4c59 | 2736 | .IP |
b1aad373 MK |
2737 | In this example, there is one node containing three zones and there |
2738 | are 11 different chunk sizes. | |
2739 | If the page size is 4 kilobytes, then the first zone called | |
2740 | .I DMA | |
2741 | (on x86 the first 16 megabyte of memory) has 1 chunk of 4 kilobytes | |
2742 | (order 0) available and has 3 chunks of 4 megabytes (order 10) available. | |
2dad4c59 | 2743 | .IP |
b1aad373 MK |
2744 | If the memory is heavily fragmented, the counters for higher |
2745 | order chunks will be zero and allocation of large contiguous areas | |
2746 | will fail. | |
2dad4c59 | 2747 | .IP |
b1aad373 MK |
2748 | Further information about the zones can be found in |
2749 | .IR /proc/zoneinfo . | |
2750 | .TP | |
2751 | .I /proc/bus | |
2752 | Contains subdirectories for installed busses. | |
2753 | .TP | |
2754 | .I /proc/bus/pccard | |
2755 | Subdirectory for PCMCIA devices when | |
2756 | .B CONFIG_PCMCIA | |
2757 | is set at kernel compilation time. | |
2758 | .TP | |
fea681da MK |
2759 | .I /proc/bus/pccard/drivers |
2760 | .TP | |
2761 | .I /proc/bus/pci | |
c13182ef | 2762 | Contains various bus subdirectories and pseudo-files containing |
59a40ed7 | 2763 | information about PCI busses, installed devices, and device |
c13182ef MK |
2764 | drivers. |
2765 | Some of these files are not ASCII. | |
fea681da MK |
2766 | .TP |
2767 | .I /proc/bus/pci/devices | |
59a40ed7 | 2768 | Information about PCI devices. |
c13182ef | 2769 | They may be accessed through |
fea681da MK |
2770 | .BR lspci (8) |
2771 | and | |
2772 | .BR setpci (8). | |
2773 | .TP | |
12b23dfe MK |
2774 | .IR /proc/cgroups " (since Linux 2.6.24)" |
2775 | See | |
2776 | .BR cgroups (7). | |
2777 | .TP | |
fea681da | 2778 | .I /proc/cmdline |
c13182ef MK |
2779 | Arguments passed to the Linux kernel at boot time. |
2780 | Often done via a boot manager such as | |
59a40ed7 MK |
2781 | .BR lilo (8) |
2782 | or | |
2783 | .BR grub (8). | |
f6e524c4 MK |
2784 | .TP |
2785 | .IR /proc/config.gz " (since Linux 2.6)" | |
2786 | This file exposes the configuration options that were used | |
c3d9780d | 2787 | to build the currently running kernel, |
f6e524c4 MK |
2788 | in the same format as they would be shown in the |
2789 | .I .config | |
2790 | file that resulted when configuring the kernel (using | |
2791 | .IR "make xconfig" , | |
2792 | .IR "make config" , | |
2793 | or similar). | |
2794 | The file contents are compressed; view or search them using | |
f78ed33a MK |
2795 | .BR zcat (1) |
2796 | and | |
2797 | .BR zgrep (1). | |
f6e524c4 | 2798 | As long as no changes have been made to the following file, |
250e01ec MK |
2799 | the contents of |
2800 | .I /proc/config.gz | |
37d5e699 MK |
2801 | are the same as those provided by: |
2802 | .IP | |
f6e524c4 | 2803 | .in +4n |
37d5e699 | 2804 | .EX |
c3074d70 | 2805 | cat /lib/modules/$(uname \-r)/build/.config |
37d5e699 | 2806 | .EE |
f6e524c4 | 2807 | .in |
250e01ec MK |
2808 | .IP |
2809 | .I /proc/config.gz | |
90878f7c | 2810 | is provided only if the kernel is configured with |
250e01ec | 2811 | .BR CONFIG_IKCONFIG_PROC . |
fea681da | 2812 | .TP |
577c0e20 MK |
2813 | .I /proc/crypto |
2814 | A list of the ciphers provided by the kernel crypto API. | |
2815 | For details, see the kernel | |
2816 | .I "Linux Kernel Crypto API" | |
2817 | documentation available under the kernel source directory | |
e94de168 ES |
2818 | .I Documentation/crypto/ |
2819 | .\" commit 3b72c814a8e8cd638e1ba0da4dfce501e9dff5af | |
2820 | (or | |
2821 | .I Documentation/DocBook | |
2822 | before 4.10; | |
2823 | the documentation can be built using a command such as | |
577c0e20 | 2824 | .IR "make htmldocs" |
e94de168 | 2825 | in the root directory of the kernel source tree). |
577c0e20 | 2826 | .TP |
fea681da MK |
2827 | .I /proc/cpuinfo |
2828 | This is a collection of CPU and system architecture dependent items, | |
2829 | for each supported architecture a different list. | |
2830 | Two common entries are \fIprocessor\fP which gives CPU number and | |
c13182ef MK |
2831 | \fIbogomips\fP; a system constant that is calculated |
2832 | during kernel initialization. | |
2833 | SMP machines have information for | |
fea681da | 2834 | each CPU. |
a091f002 MK |
2835 | The |
2836 | .BR lscpu (1) | |
2837 | command gathers its information from this file. | |
fea681da MK |
2838 | .TP |
2839 | .I /proc/devices | |
c13182ef MK |
2840 | Text listing of major numbers and device groups. |
2841 | This can be used by MAKEDEV scripts for consistency with the kernel. | |
fea681da MK |
2842 | .TP |
2843 | .IR /proc/diskstats " (since Linux 2.5.69)" | |
2844 | This file contains disk I/O statistics for each disk device. | |
66a9882e | 2845 | See the Linux kernel source file |
fea681da MK |
2846 | .I Documentation/iostats.txt |
2847 | for further information. | |
2848 | .TP | |
2849 | .I /proc/dma | |
c13182ef | 2850 | This is a list of the registered \fIISA\fP DMA (direct memory access) |
fea681da MK |
2851 | channels in use. |
2852 | .TP | |
2853 | .I /proc/driver | |
2854 | Empty subdirectory. | |
2855 | .TP | |
2856 | .I /proc/execdomains | |
2857 | List of the execution domains (ABI personalities). | |
2858 | .TP | |
2859 | .I /proc/fb | |
097585ed MK |
2860 | Frame buffer information when |
2861 | .B CONFIG_FB | |
2862 | is defined during kernel compilation. | |
fea681da MK |
2863 | .TP |
2864 | .I /proc/filesystems | |
9ee4a2b6 MK |
2865 | A text listing of the filesystems which are supported by the kernel, |
2866 | namely filesystems which were compiled into the kernel or whose kernel | |
6387216b MK |
2867 | modules are currently loaded. |
2868 | (See also | |
fb477da2 | 2869 | .BR filesystems (5).) |
9ee4a2b6 | 2870 | If a filesystem is marked with "nodev", |
809d0164 | 2871 | this means that it does not require a block device to be mounted |
9ee4a2b6 | 2872 | (e.g., virtual filesystem, network filesystem). |
2dad4c59 | 2873 | .IP |
809d0164 MK |
2874 | Incidentally, this file may be used by |
2875 | .BR mount (8) | |
9ee4a2b6 MK |
2876 | when no filesystem is specified and it didn't manage to determine the |
2877 | filesystem type. | |
2878 | Then filesystems contained in this file are tried | |
809d0164 | 2879 | (excepted those that are marked with "nodev"). |
fea681da MK |
2880 | .TP |
2881 | .I /proc/fs | |
df352acc | 2882 | .\" FIXME Much more needs to be said about /proc/fs |
91085d85 | 2883 | .\" |
df352acc MK |
2884 | Contains subdirectories that in turn contain files |
2885 | with information about (certain) mounted filesystems. | |
fea681da MK |
2886 | .TP |
2887 | .I /proc/ide | |
2888 | This directory | |
59a40ed7 MK |
2889 | exists on systems with the IDE bus. |
2890 | There are directories for each IDE channel and attached device. | |
c13182ef | 2891 | Files include: |
2dad4c59 | 2892 | .IP |
a08ea57c | 2893 | .in +4n |
37d5e699 | 2894 | .EX |
fea681da MK |
2895 | cache buffer size in KB |
2896 | capacity number of sectors | |
2897 | driver driver version | |
2898 | geometry physical and logical geometry | |
9fdfa163 | 2899 | identify in hexadecimal |
fea681da MK |
2900 | media media type |
2901 | model manufacturer's model number | |
2902 | settings drive settings | |
9fdfa163 MK |
2903 | smart_thresholds in hexadecimal |
2904 | smart_values in hexadecimal | |
37d5e699 | 2905 | .EE |
a08ea57c | 2906 | .in |
2dad4c59 | 2907 | .IP |
c13182ef | 2908 | The |
fea681da MK |
2909 | .BR hdparm (8) |
2910 | utility provides access to this information in a friendly format. | |
2911 | .TP | |
2912 | .I /proc/interrupts | |
23ec6ff0 MK |
2913 | This is used to record the number of interrupts per CPU per IO device. |
2914 | Since Linux 2.6.24, | |
9ea5bc66 | 2915 | for the i386 and x86-64 architectures, at least, this also includes |
23ec6ff0 MK |
2916 | interrupts internal to the system (that is, not associated with a device |
2917 | as such), such as NMI (nonmaskable interrupt), LOC (local timer interrupt), | |
2918 | and for SMP systems, TLB (TLB flush interrupt), RES (rescheduling | |
2919 | interrupt), CAL (remote function call interrupt), and possibly others. | |
2920 | Very easy to read formatting, done in ASCII. | |
fea681da MK |
2921 | .TP |
2922 | .I /proc/iomem | |
2923 | I/O memory map in Linux 2.4. | |
2924 | .TP | |
2925 | .I /proc/ioports | |
c13182ef | 2926 | This is a list of currently registered Input-Output port regions that |
fea681da MK |
2927 | are in use. |
2928 | .TP | |
2929 | .IR /proc/kallsyms " (since Linux 2.5.71)" | |
2930 | This holds the kernel exported symbol definitions used by the | |
2931 | .BR modules (X) | |
2932 | tools to dynamically link and bind loadable modules. | |
2933 | In Linux 2.5.47 and earlier, a similar file with slightly different syntax | |
2934 | was named | |
2935 | .IR ksyms . | |
2936 | .TP | |
2937 | .I /proc/kcore | |
2938 | This file represents the physical memory of the system and is stored | |
c13182ef MK |
2939 | in the ELF core file format. |
2940 | With this pseudo-file, and an unstripped | |
9a67332e MK |
2941 | kernel |
2942 | .RI ( /usr/src/linux/vmlinux ) | |
2943 | binary, GDB can be used to | |
fea681da | 2944 | examine the current state of any kernel data structures. |
2dad4c59 | 2945 | .IP |
fea681da | 2946 | The total length of the file is the size of physical memory (RAM) plus |
ee8655b5 | 2947 | 4\ KiB. |
fea681da | 2948 | .TP |
653836fb MK |
2949 | .IR /proc/keys " (since Linux 2.6.10)" |
2950 | See | |
2951 | .BR keyrings (7). | |
2952 | .TP | |
2953 | .IR /proc/key-users " (since Linux 2.6.10)" | |
2954 | See | |
2955 | .BR keyrings (7). | |
2956 | .TP | |
fea681da MK |
2957 | .I /proc/kmsg |
2958 | This file can be used instead of the | |
2959 | .BR syslog (2) | |
c13182ef MK |
2960 | system call to read kernel messages. |
2961 | A process must have superuser | |
fea681da | 2962 | privileges to read this file, and only one process should read this |
c13182ef MK |
2963 | file. |
2964 | This file should not be read if a syslog process is running | |
fea681da MK |
2965 | which uses the |
2966 | .BR syslog (2) | |
2967 | system call facility to log kernel messages. | |
2dad4c59 | 2968 | .IP |
fea681da | 2969 | Information in this file is retrieved with the |
c4517613 | 2970 | .BR dmesg (1) |
fea681da MK |
2971 | program. |
2972 | .TP | |
55d68a94 | 2973 | .IR /proc/kpagecgroup " (since Linux 4.3)" |
0e462d71 | 2974 | .\" commit 80ae2fdceba8313b0433f899bdd9c6c463291a17 |
55d68a94 OE |
2975 | This file contains a 64-bit inode number of |
2976 | the memory cgroup each page is charged to, | |
2977 | indexed by page frame number (see the discussion of | |
2978 | .IR /proc/[pid]/pagemap ). | |
2979 | .IP | |
2980 | The | |
2981 | .IR /proc/kpagecgroup | |
2982 | file is present only if the | |
2983 | .B CONFIG_MEMCG | |
2984 | kernel configuration option is enabled. | |
2985 | .TP | |
ff56ac8b MK |
2986 | .IR /proc/kpagecount " (since Linux 2.6.25)" |
2987 | This file contains a 64-bit count of the number of | |
2988 | times each physical page frame is mapped, | |
2989 | indexed by page frame number (see the discussion of | |
2990 | .IR /proc/[pid]/pagemap ). | |
2991 | .IP | |
2992 | The | |
2993 | .IR /proc/kpagecount | |
2994 | file is present only if the | |
2995 | .B CONFIG_PROC_PAGE_MONITOR | |
59d566a9 MK |
2996 | kernel configuration option is enabled. |
2997 | .TP | |
2998 | .IR /proc/kpageflags " (since Linux 2.6.25)" | |
ef4f4031 | 2999 | This file contains 64-bit masks corresponding to each physical page frame; |
59d566a9 MK |
3000 | it is indexed by page frame number (see the discussion of |
3001 | .IR /proc/[pid]/pagemap ). | |
3002 | The bits are as follows: | |
2dad4c59 | 3003 | .IP |
59d566a9 MK |
3004 | 0 - KPF_LOCKED |
3005 | 1 - KPF_ERROR | |
3006 | 2 - KPF_REFERENCED | |
3007 | 3 - KPF_UPTODATE | |
3008 | 4 - KPF_DIRTY | |
3009 | 5 - KPF_LRU | |
3010 | 6 - KPF_ACTIVE | |
3011 | 7 - KPF_SLAB | |
3012 | 8 - KPF_WRITEBACK | |
3013 | 9 - KPF_RECLAIM | |
3014 | 10 - KPF_BUDDY | |
3015 | 11 - KPF_MMAP (since Linux 2.6.31) | |
3016 | 12 - KPF_ANON (since Linux 2.6.31) | |
3017 | 13 - KPF_SWAPCACHE (since Linux 2.6.31) | |
3018 | 14 - KPF_SWAPBACKED (since Linux 2.6.31) | |
3019 | 15 - KPF_COMPOUND_HEAD (since Linux 2.6.31) | |
3020 | 16 - KPF_COMPOUND_TAIL (since Linux 2.6.31) | |
d0ffc687 | 3021 | 17 - KPF_HUGE (since Linux 2.6.31) |
59d566a9 MK |
3022 | 18 - KPF_UNEVICTABLE (since Linux 2.6.31) |
3023 | 19 - KPF_HWPOISON (since Linux 2.6.31) | |
3024 | 20 - KPF_NOPAGE (since Linux 2.6.31) | |
3025 | 21 - KPF_KSM (since Linux 2.6.32) | |
3026 | 22 - KPF_THP (since Linux 3.4) | |
5487da4c MK |
3027 | 23 - KPF_BALLOON (since Linux 3.18) |
3028 | .\" KPF_BALLOON: commit 09316c09dde33aae14f34489d9e3d243ec0d5938 | |
f38dfdf1 | 3029 | 24 - KPF_ZERO_PAGE (since Linux 4.0) |
c6f182bc | 3030 | .\" KPF_ZERO_PAGE: commit 56873f43abdcd574b25105867a990f067747b2f4 |
f38dfdf1 | 3031 | 25 - KPF_IDLE (since Linux 4.3) |
c6f182bc | 3032 | .\" KPF_IDLE: commit f074a8f49eb87cde95ac9d040ad5e7ea4f029738 |
2dad4c59 | 3033 | .IP |
59d566a9 MK |
3034 | For further details on the meanings of these bits, |
3035 | see the kernel source file | |
3036 | .IR Documentation/vm/pagemap.txt . | |
3037 | Before kernel 2.6.29, | |
3038 | .\" commit ad3bdefe877afb47480418fdb05ecd42842de65e | |
3039 | .\" commit e07a4b9217d1e97d2f3a62b6b070efdc61212110 | |
3040 | .BR KPF_WRITEBACK , | |
3041 | .BR KPF_RECLAIM , | |
3042 | .BR KPF_BUDDY , | |
3043 | and | |
3044 | .BR KPF_LOCKED | |
3045 | did not report correctly. | |
3046 | .IP | |
3047 | The | |
3048 | .IR /proc/kpageflags | |
3049 | file is present only if the | |
3050 | .B CONFIG_PROC_PAGE_MONITOR | |
ff56ac8b MK |
3051 | kernel configuration option is enabled. |
3052 | .TP | |
93f18cbb | 3053 | .IR /proc/ksyms " (Linux 1.1.23\(en2.5.47)" |
fea681da MK |
3054 | See |
3055 | .IR /proc/kallsyms . | |
3056 | .TP | |
3057 | .I /proc/loadavg | |
6b05dc38 MK |
3058 | The first three fields in this file are load average figures |
3059 | giving the number of jobs in the run queue (state R) | |
fea681da MK |
3060 | or waiting for disk I/O (state D) averaged over 1, 5, and 15 minutes. |
3061 | They are the same as the load average numbers given by | |
3062 | .BR uptime (1) | |
3063 | and other programs. | |
6b05dc38 | 3064 | The fourth field consists of two numbers separated by a slash (/). |
78fc91ec EDB |
3065 | The first of these is the number of currently runnable kernel |
3066 | scheduling entities (processes, threads). | |
6b05dc38 MK |
3067 | The value after the slash is the number of kernel scheduling entities |
3068 | that currently exist on the system. | |
3069 | The fifth field is the PID of the process that was most | |
3070 | recently created on the system. | |
fea681da MK |
3071 | .TP |
3072 | .I /proc/locks | |
3073 | This file shows current file locks | |
3074 | .RB ( flock "(2) and " fcntl (2)) | |
3075 | and leases | |
3076 | .RB ( fcntl (2)). | |
f352b560 MK |
3077 | .IP |
3078 | An example of the content shown in this file is the following: | |
3079 | .IP | |
3080 | .in +4n | |
3081 | .EX | |
3082 | 1: POSIX ADVISORY READ 5433 08:01:7864448 128 128 | |
3083 | 2: FLOCK ADVISORY WRITE 2001 08:01:7864554 0 EOF | |
3084 | 3: FLOCK ADVISORY WRITE 1568 00:2f:32388 0 EOF | |
3085 | 4: POSIX ADVISORY WRITE 699 00:16:28457 0 EOF | |
3086 | 5: POSIX ADVISORY WRITE 764 00:16:21448 0 0 | |
3087 | 6: POSIX ADVISORY READ 3548 08:01:7867240 1 1 | |
3088 | 7: POSIX ADVISORY READ 3548 08:01:7865567 1826 2335 | |
3089 | 8: OFDLCK ADVISORY WRITE -1 08:01:8713209 128 191 | |
3090 | .EE | |
3091 | .in | |
3092 | .IP | |
3093 | The fields shown in each line are as follows: | |
3094 | .RS | |
3095 | .IP (1) 4 | |
3096 | The ordinal position of the lock in the list. | |
3097 | .IP (2) | |
3098 | The lock type. | |
3099 | Values that may appear here include: | |
3100 | .RS | |
3101 | .TP | |
3102 | .B FLOCK | |
3103 | This is a BSD file lock created using | |
3104 | .BR flock (2). | |
3105 | .TP | |
3106 | .B OFDLCK | |
3107 | This is an open file description (OFD) lock created using | |
3108 | .BR fcntl (2). | |
3109 | .TP | |
3110 | .B POSIX | |
3111 | This is a POSIX byte-range lock created using | |
3112 | .BR fcntl (2). | |
3113 | .RE | |
3114 | .IP (3) | |
3115 | Among the strings that can appear here are the following: | |
3116 | .RS | |
3117 | .TP | |
3118 | .B ADVISORY | |
3119 | This is an advisory lock. | |
3120 | .TP | |
3121 | .B MANDATORY | |
3122 | This is a mandatory lock. | |
3123 | .RE | |
3124 | .IP (4) | |
3125 | The type of lock. | |
3126 | Values that can appear here are: | |
3127 | .RS | |
3128 | .TP | |
3129 | .B READ | |
3130 | This is a POSIX or OFD read lock, or a BSD shared lock. | |
3131 | .TP | |
3132 | .B WRITE | |
3133 | This is a POSIX or OFD write lock, or a BSD exclusive lock. | |
3134 | .RE | |
3135 | .IP (5) | |
3136 | The PID of the process that owns the lock. | |
3137 | .IP | |
3138 | Because OFD locks are not owned by a single process | |
3139 | (since multiple processes may have file descriptors that | |
3140 | refer to the same open file description), | |
3141 | the value \-1 is displayed in this field for OFD locks. | |
3142 | (Before kernel 4.14, | |
52f842a5 | 3143 | .\" commit 9d5b86ac13c573795525ecac6ed2db39ab23e2a8 |
f352b560 MK |
3144 | a bug meant that the PID of the process that |
3145 | initially acquired the lock was displayed instead of the value \-1.) | |
3146 | .IP (6) | |
3147 | Three colon-separated subfields that identify the major and minor device | |
3148 | ID of the device containing the filesystem where the locked file resides, | |
3149 | followed by the inode number of the locked file. | |
3150 | .IP (7) | |
3151 | The byte offset of the first byte of the lock. | |
3152 | For BSD locks, this value is always 0. | |
3153 | .IP (8) | |
3154 | The byte offset of the last byte of the lock. | |
3155 | .B EOF | |
3156 | in this field means that the lock extends to the end of the file. | |
3157 | For BSD locks, the value shown is always | |
3158 | .IR EOF . | |
3159 | .RE | |
3160 | .IP | |
8fb9b45a MK |
3161 | Since Linux 4.9, |
3162 | .\" commit d67fd44f697dff293d7cdc29af929241b669affe | |
3163 | the list of locks shown in | |
3164 | .I /proc/locks | |
3165 | is filtered to show just the locks for the processes in the PID | |
3166 | namespace (see | |
3167 | .BR pid_namespaces (7)) | |
3168 | for which the | |
3169 | .I /proc | |
3170 | filesystem was mounted. | |
3171 | (In the the initial PID namespace, | |
3172 | there is no filtering of the records shown in this file.) | |
3173 | .IP | |
9f1002a1 MK |
3174 | The |
3175 | .BR lslocks (8) | |
3176 | command provides a bit more information about each lock. | |
fea681da | 3177 | .TP |
89dd5f8a | 3178 | .IR /proc/malloc " (only up to and including Linux 2.2)" |
59a40ed7 | 3179 | .\" It looks like this only ever did something back in 1.0 days |
90878f7c | 3180 | This file is present only if |
89dd5f8a | 3181 | .B CONFIG_DEBUG_MALLOC |
097585ed | 3182 | was defined during compilation. |
fea681da MK |
3183 | .TP |
3184 | .I /proc/meminfo | |
77b802ec MK |
3185 | This file reports statistics about memory usage on the system. |
3186 | It is used by | |
fea681da MK |
3187 | .BR free (1) |
3188 | to report the amount of free and used memory (both physical and swap) | |
3189 | on the system as well as the shared memory and buffers used by the | |
3190 | kernel. | |
3ba3d5b1 MK |
3191 | Each line of the file consists of a parameter name, followed by a colon, |
3192 | the value of the parameter, and an option unit of measurement (e.g., "kB"). | |
3193 | The list below describes the parameter names and | |
3194 | the format specifier required to read the field value. | |
3195 | Except as noted below, | |
3196 | all of the fields have been present since at least Linux 2.6.0. | |
86cf87d7 | 3197 | Some fields are displayed only if the kernel was configured |
3ba3d5b1 MK |
3198 | with various options; those dependencies are noted in the list. |
3199 | .RS | |
3200 | .TP | |
3201 | .IR MemTotal " %lu" | |
449dd4e2 | 3202 | Total usable RAM (i.e., physical RAM minus a few reserved |
99e91586 | 3203 | bits and the kernel binary code). |
3ba3d5b1 MK |
3204 | .TP |
3205 | .IR MemFree " %lu" | |
7bccb7d4 DP |
3206 | The sum of |
3207 | .IR LowFree + HighFree . | |
3ba3d5b1 | 3208 | .TP |
8b4b1f68 MK |
3209 | .IR MemAvailable " %lu (since Linux 3.14)" |
3210 | An estimate of how much memory is available for starting new | |
3211 | applications, without swapping. | |
3212 | .TP | |
3ba3d5b1 | 3213 | .IR Buffers " %lu" |
99e91586 | 3214 | Relatively temporary storage for raw disk blocks that |
3ba3d5b1 MK |
3215 | shouldn't get tremendously large (20MB or so). |
3216 | .TP | |
3217 | .IR Cached " %lu" | |
3218 | In-memory cache for files read from the disk (the page cache). | |
3219 | Doesn't include | |
3220 | .IR SwapCached . | |
3221 | .TP | |
3222 | .IR SwapCached " %lu" | |
3223 | Memory that once was swapped out, is swapped back in but | |
3224 | still also is in the swap file. | |
fa1d2749 | 3225 | (If memory pressure is high, these pages |
3ba3d5b1 | 3226 | don't need to be swapped out again because they are already |
99e91586 | 3227 | in the swap file. |
3ba3d5b1 MK |
3228 | This saves I/O.) |
3229 | .TP | |
3230 | .IR Active " %lu" | |
3231 | Memory that has been used more recently and usually not | |
3232 | reclaimed unless absolutely necessary. | |
3233 | .TP | |
3234 | .IR Inactive " %lu" | |
3235 | Memory which has been less recently used. | |
3236 | It is more eligible to be reclaimed for other purposes. | |
3237 | .TP | |
3238 | .IR Active(anon) " %lu (since Linux 2.6.28)" | |
3239 | [To be documented.] | |
3240 | .TP | |
3241 | .IR Inactive(anon) " %lu (since Linux 2.6.28)" | |
3242 | [To be documented.] | |
3243 | .TP | |
3244 | .IR Active(file) " %lu (since Linux 2.6.28)" | |
3245 | [To be documented.] | |
3246 | .TP | |
3247 | .IR Inactive(file) " %lu (since Linux 2.6.28)" | |
3248 | [To be documented.] | |
3249 | .TP | |
3250 | .IR Unevictable " %lu (since Linux 2.6.28)" | |
3251 | (From Linux 2.6.28 to 2.6.30, | |
3252 | \fBCONFIG_UNEVICTABLE_LRU\fP was required.) | |
3253 | [To be documented.] | |
3254 | .TP | |
46fbfc07 | 3255 | .IR Mlocked " %lu (since Linux 2.6.28)" |
3ba3d5b1 MK |
3256 | (From Linux 2.6.28 to 2.6.30, |
3257 | \fBCONFIG_UNEVICTABLE_LRU\fP was required.) | |
3258 | [To be documented.] | |
3259 | .TP | |
3260 | .IR HighTotal " %lu" | |
3261 | (Starting with Linux 2.6.19, \fBCONFIG_HIGHMEM\fP is required.) | |
3262 | Total amount of highmem. | |
99e91586 | 3263 | Highmem is all memory above ~860MB of physical memory. |
3ba3d5b1 MK |
3264 | Highmem areas are for use by user-space programs, |
3265 | or for the page cache. | |
3266 | The kernel must use tricks to access | |
3267 | this memory, making it slower to access than lowmem. | |
3268 | .TP | |
3269 | .IR HighFree " %lu | |
3270 | (Starting with Linux 2.6.19, \fBCONFIG_HIGHMEM\fP is required.) | |
3271 | Amount of free highmem. | |
3272 | .TP | |
3273 | .IR LowTotal " %lu | |
3274 | (Starting with Linux 2.6.19, \fBCONFIG_HIGHMEM\fP is required.) | |
3275 | Total amount of lowmem. | |
3276 | Lowmem is memory which can be used for everything that | |
3277 | highmem can be used for, but it is also available for the | |
3278 | kernel's use for its own data structures. | |
3279 | Among many other things, | |
99e91586 | 3280 | it is where everything from |
7bccb7d4 DP |
3281 | .I Slab |
3282 | is allocated. | |
3ba3d5b1 MK |
3283 | Bad things happen when you're out of lowmem. |
3284 | .TP | |
3285 | .IR LowFree " %lu | |
3286 | (Starting with Linux 2.6.19, \fBCONFIG_HIGHMEM\fP is required.) | |
3287 | Amount of free lowmem. | |
3288 | .TP | |
3289 | .IR MmapCopy " %lu (since Linux 2.6.29)" | |
99e91586 DP |
3290 | .RB ( CONFIG_MMU |
3291 | is required.) | |
3ba3d5b1 MK |
3292 | [To be documented.] |
3293 | .TP | |
3294 | .IR SwapTotal " %lu" | |
3295 | Total amount of swap space available. | |
3296 | .TP | |
3297 | .IR SwapFree " %lu" | |
c16d4f25 | 3298 | Amount of swap space that is currently unused. |
3ba3d5b1 MK |
3299 | .TP |
3300 | .IR Dirty " %lu" | |
3301 | Memory which is waiting to get written back to the disk. | |
3302 | .TP | |
3303 | .IR Writeback " %lu" | |
3304 | Memory which is actively being written back to the disk. | |
3305 | .TP | |
3306 | .IR AnonPages " %lu (since Linux 2.6.18)" | |
3307 | Non-file backed pages mapped into user-space page tables. | |
3308 | .TP | |
3309 | .IR Mapped " %lu" | |
fda70f5b MK |
3310 | Files which have been mapped into memory (with |
3311 | .BR mmap (2)), | |
3312 | such as libraries. | |
3ba3d5b1 MK |
3313 | .TP |
3314 | .IR Shmem " %lu (since Linux 2.6.32)" | |
eb775c04 MK |
3315 | Amount of memory consumed in |
3316 | .BR tmpfs (5) | |
3317 | filesystems. | |
3ba3d5b1 MK |
3318 | .TP |
3319 | .IR Slab " %lu" | |
3320 | In-kernel data structures cache. | |
5a5bde70 MK |
3321 | (See |
3322 | .BR slabinfo (5).) | |
3ba3d5b1 MK |
3323 | .TP |
3324 | .IR SReclaimable " %lu (since Linux 2.6.19)" | |
7bccb7d4 DP |
3325 | Part of |
3326 | .IR Slab , | |
3327 | that might be reclaimed, such as caches. | |
3ba3d5b1 MK |
3328 | .TP |
3329 | .IR SUnreclaim " %lu (since Linux 2.6.19)" | |
7bccb7d4 DP |
3330 | Part of |
3331 | .IR Slab , | |
3332 | that cannot be reclaimed on memory pressure. | |
3ba3d5b1 MK |
3333 | .TP |
3334 | .IR KernelStack " %lu (since Linux 2.6.32)" | |
3335 | Amount of memory allocated to kernel stacks. | |
3336 | .TP | |
3337 | .IR PageTables " %lu (since Linux 2.6.18)" | |
3338 | Amount of memory dedicated to the lowest level of page tables. | |
3339 | .TP | |
3340 | .IR Quicklists " %lu (since Linux 2.6.27)" | |
3341 | (\fBCONFIG_QUICKLIST\fP is required.) | |
3342 | [To be documented.] | |
3343 | .TP | |
3344 | .IR NFS_Unstable " %lu (since Linux 2.6.18)" | |
3345 | NFS pages sent to the server, but not yet committed to stable storage. | |
3346 | .TP | |
3347 | .IR Bounce " %lu (since Linux 2.6.18)" | |
3348 | Memory used for block device "bounce buffers". | |
3349 | .TP | |
3350 | .IR WritebackTmp " %lu (since Linux 2.6.26)" | |
3351 | Memory used by FUSE for temporary writeback buffers. | |
3352 | .TP | |
3353 | .IR CommitLimit " %lu (since Linux 2.6.10)" | |
cd7b6c40 MK |
3354 | This is the total amount of memory currently available to |
3355 | be allocated on the system, expressed in kilobytes. | |
90878f7c MK |
3356 | This limit is adhered to |
3357 | only if strict overcommit accounting is enabled (mode 2 in | |
cd7b6c40 MK |
3358 | .IR /proc/sys/vm/overcommit_memory ). |
3359 | The limit is calculated according to the formula described under | |
3360 | .IR /proc/sys/vm/overcommit_memory . | |
3361 | For further details, see the kernel source file | |
3ba3d5b1 MK |
3362 | .IR Documentation/vm/overcommit-accounting . |
3363 | .TP | |
3364 | .IR Committed_AS " %lu" | |
3365 | The amount of memory presently allocated on the system. | |
3366 | The committed memory is a sum of all of the memory which | |
3367 | has been allocated by processes, even if it has not been | |
3368 | "used" by them as of yet. | |
3369 | A process which allocates 1GB of memory (using | |
3370 | .BR malloc (3) | |
33a0ccb2 | 3371 | or similar), but touches only 300MB of that memory will show up |
90878f7c | 3372 | as using only 300MB of memory even if it has the address space |
3ba3d5b1 | 3373 | allocated for the entire 1GB. |
2dad4c59 | 3374 | .IP |
3ba3d5b1 MK |
3375 | This 1GB is memory which has been "committed" to by the VM |
3376 | and can be used at any time by the allocating application. | |
cd7b6c40 | 3377 | With strict overcommit enabled on the system (mode 2 in |
d9e0f03d | 3378 | .IR /proc/sys/vm/overcommit_memory ), |
3ba3d5b1 MK |
3379 | allocations which would exceed the |
3380 | .I CommitLimit | |
cd7b6c40 | 3381 | will not be permitted. |
3ba3d5b1 MK |
3382 | This is useful if one needs to guarantee that processes will not |
3383 | fail due to lack of memory once that memory has been successfully allocated. | |
3384 | .TP | |
3385 | .IR VmallocTotal " %lu" | |
3386 | Total size of vmalloc memory area. | |
3387 | .TP | |
3388 | .IR VmallocUsed " %lu" | |
3389 | Amount of vmalloc area which is used. | |
3390 | .TP | |
3391 | .IR VmallocChunk " %lu" | |
3392 | Largest contiguous block of vmalloc area which is free. | |
3393 | .TP | |
3394 | .IR HardwareCorrupted " %lu (since Linux 2.6.32)" | |
3395 | (\fBCONFIG_MEMORY_FAILURE\fP is required.) | |
3396 | [To be documented.] | |
3397 | .TP | |
3398 | .IR AnonHugePages " %lu (since Linux 2.6.38)" | |
3399 | (\fBCONFIG_TRANSPARENT_HUGEPAGE\fP is required.) | |
7fac88a9 | 3400 | Non-file backed huge pages mapped into user-space page tables. |
3ba3d5b1 | 3401 | .TP |
4ad958e1 MK |
3402 | .IR ShmemHugePages " %lu (since Linux 4.8)" |
3403 | (\fBCONFIG_TRANSPARENT_HUGEPAGE\fP is required.) | |
4e07c70f MK |
3404 | Memory used by shared memory (shmem) and |
3405 | .BR tmpfs (5) | |
3406 | allocated with huge pages | |
4ad958e1 MK |
3407 | .TP |
3408 | .IR ShmemPmdMapped " %lu (since Linux 4.8)" | |
3409 | (\fBCONFIG_TRANSPARENT_HUGEPAGE\fP is required.) | |
956e74b4 | 3410 | Shared memory mapped into user space with huge pages. |
4ad958e1 | 3411 | .TP |
43179f55 MK |
3412 | .IR CmaTotal " %lu (since Linux 3.1)" |
3413 | Total CMA (Contiguous Memory Allocator) pages. | |
3414 | (\fBCONFIG_CMA\fP is required.) | |
3415 | .TP | |
3416 | .IR CmaFree " %lu (since Linux 3.1)" | |
3417 | Free CMA (Contiguous Memory Allocator) pages. | |
3418 | (\fBCONFIG_CMA\fP is required.) | |
3419 | .TP | |
3ba3d5b1 MK |
3420 | .IR HugePages_Total " %lu" |
3421 | (\fBCONFIG_HUGETLB_PAGE\fP is required.) | |
3422 | The size of the pool of huge pages. | |
3423 | .TP | |
3424 | .IR HugePages_Free " %lu" | |
3425 | (\fBCONFIG_HUGETLB_PAGE\fP is required.) | |
3426 | The number of huge pages in the pool that are not yet allocated. | |
3427 | .TP | |
3428 | .IR HugePages_Rsvd " %lu (since Linux 2.6.17)" | |
3429 | (\fBCONFIG_HUGETLB_PAGE\fP is required.) | |
3430 | This is the number of huge pages for | |
3431 | which a commitment to allocate from the pool has been made, | |
3432 | but no allocation has yet been made. | |
3433 | These reserved huge pages | |
3434 | guarantee that an application will be able to allocate a | |
3435 | huge page from the pool of huge pages at fault time. | |
3436 | .TP | |
aa8a6b4f | 3437 | .IR HugePages_Surp " %lu (since Linux 2.6.24)" |
3ba3d5b1 MK |
3438 | (\fBCONFIG_HUGETLB_PAGE\fP is required.) |
3439 | This is the number of huge pages in | |
3440 | the pool above the value in | |
3441 | .IR /proc/sys/vm/nr_hugepages . | |
3442 | The maximum number of surplus huge pages is controlled by | |
3443 | .IR /proc/sys/vm/nr_overcommit_hugepages . | |
3444 | .TP | |
3445 | .IR Hugepagesize " %lu" | |
3446 | (\fBCONFIG_HUGETLB_PAGE\fP is required.) | |
3447 | The size of huge pages. | |
d5268de1 MK |
3448 | .TP |
3449 | .IR DirectMap4k " %lu (since Linux 2.6.27)" | |
3450 | Number of bytes of RAM linearly mapped by kernel in 4kB pages. | |
3451 | (x86.) | |
3452 | .TP | |
3453 | .IR DirectMap4M " %lu (since Linux 2.6.27)" | |
3454 | Number of bytes of RAM linearly mapped by kernel in 4MB pages. | |
3455 | (x86 with | |
3456 | .BR CONFIG_X86_64 | |
3457 | or | |
3458 | .BR CONFIG_X86_PAE | |
3459 | enabled.) | |
3460 | .TP | |
3461 | .IR DirectMap2M " %lu (since Linux 2.6.27)" | |
3462 | Number of bytes of RAM linearly mapped by kernel in 2MB pages. | |
3463 | (x86 with neither | |
3464 | .BR CONFIG_X86_64 | |
3465 | nor | |
3466 | .BR CONFIG_X86_PAE | |
3467 | enabled.) | |
3468 | .TP | |
3469 | .IR DirectMap1G " %lu (since Linux 2.6.27)" | |
3470 | (x86 with | |
3471 | .BR CONFIG_X86_64 | |
3472 | and | |
3473 | .B CONFIG_X86_DIRECT_GBPAGES | |
3474 | enabled.) | |
3ba3d5b1 | 3475 | .RE |
fea681da | 3476 | .TP |
aa341984 MK |
3477 | .I /proc/modules |
3478 | A text list of the modules that have been loaded by the system. | |
3479 | See also | |
3480 | .BR lsmod (8). | |
3481 | .TP | |
fea681da | 3482 | .I /proc/mounts |
c1eea65a | 3483 | Before kernel 2.4.19, this file was a list |
9ee4a2b6 | 3484 | of all the filesystems currently mounted on the system. |
ef5b47f6 MK |
3485 | With the introduction of per-process mount namespaces in Linux 2.4.19 (see |
3486 | .BR mount_namespaces (7)), | |
3487 | this file became a link to | |
c1eea65a | 3488 | .IR /proc/self/mounts , |
732e54dd | 3489 | which lists the mount points of the process's own mount namespace. |
fea681da | 3490 | The format of this file is documented in |
31e9a9ec | 3491 | .BR fstab (5). |
fea681da | 3492 | .TP |
fea681da | 3493 | .I /proc/mtrr |
c13182ef | 3494 | Memory Type Range Registers. |
66a9882e | 3495 | See the Linux kernel source file |
a8999e1f ES |
3496 | .I Documentation/x86/mtrr.txt |
3497 | .\" commit 7225e75144b9718cbbe1820d9c011c809d5773fd | |
3498 | (or | |
cfe70b66 | 3499 | .I Documentation/mtrr.txt |
a8999e1f | 3500 | before Linux 2.6.28) |
fea681da MK |
3501 | for details. |
3502 | .TP | |
3503 | .I /proc/net | |
ccb4bcdc MK |
3504 | This directory contains various files and subdirectories containing |
3505 | information about the networking layer. | |
3506 | The files contain ASCII structures and are, | |
59a40ed7 MK |
3507 | therefore, readable with |
3508 | .BR cat (1). | |
c13182ef | 3509 | However, the standard |
fea681da MK |
3510 | .BR netstat (8) |
3511 | suite provides much cleaner access to these files. | |
2dad4c59 | 3512 | .IP |
9fb88bc8 MK |
3513 | With the advent of network namespaces, |
3514 | various information relating to the network stack is virtualized (see | |
3515 | .BR namespaces (7)). | |
3516 | Thus, since Linux 2.6.25, | |
3517 | .\" commit e9720acd728a46cb40daa52c99a979f7c4ff195c | |
3518 | .IR /proc/net | |
3519 | is a symbolic link to the directory | |
3520 | .IR /proc/self/net , | |
3521 | which contains the same files and directories as listed below. | |
3522 | However, these files and directories now expose information | |
3523 | for the network namespace of which the process is a member. | |
fea681da MK |
3524 | .TP |
3525 | .I /proc/net/arp | |
3526 | This holds an ASCII readable dump of the kernel ARP table used for | |
c13182ef | 3527 | address resolutions. |
01d0a447 | 3528 | It will show both dynamically learned and preprogrammed ARP entries. |
c13182ef | 3529 | The format is: |
c1a022dc MK |
3530 | .IP |
3531 | .in 7n | |
3532 | .EX | |
fea681da MK |
3533 | IP address HW type Flags HW address Mask Device |
3534 | 192.168.0.50 0x1 0x2 00:50:BF:25:68:F3 * eth0 | |
3535 | 192.168.0.250 0x1 0xc 00:00:00:00:00:00 * eth0 | |
c1a022dc | 3536 | .EE |
fea681da | 3537 | .in |
c1a022dc | 3538 | .IP |
6c04f928 | 3539 | Here "IP address" is the IPv4 address of the machine and the "HW type" |
c13182ef MK |
3540 | is the hardware type of the address from RFC\ 826. |
3541 | The flags are the internal | |
9a67332e MK |
3542 | flags of the ARP structure (as defined in |
3543 | .IR /usr/include/linux/if_arp.h ) | |
3544 | and | |
6c04f928 | 3545 | the "HW address" is the data link layer mapping for that IP address if |
fea681da MK |
3546 | it is known. |
3547 | .TP | |
3548 | .I /proc/net/dev | |
c13182ef MK |
3549 | The dev pseudo-file contains network device status information. |
3550 | This gives | |
3551 | the number of received and sent packets, the number of errors and | |
fea681da | 3552 | collisions |
c13182ef MK |
3553 | and other basic statistics. |
3554 | These are used by the | |
fea681da | 3555 | .BR ifconfig (8) |
c13182ef MK |
3556 | program to report device status. |
3557 | The format is: | |
c1a022dc | 3558 | .IP |
fea681da | 3559 | .in 1n |
c1a022dc | 3560 | .EX |
fea681da MK |
3561 | Inter-| Receive | Transmit |
3562 | face |bytes packets errs drop fifo frame compressed multicast|bytes packets errs drop fifo colls carrier compressed | |
3563 | lo: 2776770 11307 0 0 0 0 0 0 2776770 11307 0 0 0 0 0 0 | |
3564 | eth0: 1215645 2751 0 0 0 0 0 0 1782404 4324 0 0 0 427 0 0 | |
3565 | ppp0: 1622270 5552 1 0 0 0 0 0 354130 5669 0 0 0 0 0 0 | |
3566 | tap0: 7714 81 0 0 0 0 0 0 7714 81 0 0 0 0 0 0 | |
c1a022dc | 3567 | .EE |
fea681da | 3568 | .in |
fea681da MK |
3569 | .\" .TP |
3570 | .\" .I /proc/net/ipx | |
3571 | .\" No information. | |
3572 | .\" .TP | |
3573 | .\" .I /proc/net/ipx_route | |
3574 | .\" No information. | |
3575 | .TP | |
3576 | .I /proc/net/dev_mcast | |
3577 | Defined in | |
3578 | .IR /usr/src/linux/net/core/dev_mcast.c : | |
37d5e699 MK |
3579 | .IP |
3580 | .in +4 | |
3581 | .EX | |
9fdfa163 | 3582 | indx interface_name dmi_u dmi_g dmi_address |
fea681da MK |
3583 | 2 eth0 1 0 01005e000001 |
3584 | 3 eth1 1 0 01005e000001 | |
3585 | 4 eth2 1 0 01005e000001 | |
37d5e699 | 3586 | .EE |
fea681da | 3587 | .in |
fea681da MK |
3588 | .TP |
3589 | .I /proc/net/igmp | |
c13182ef MK |
3590 | Internet Group Management Protocol. |
3591 | Defined in | |
fea681da MK |
3592 | .IR /usr/src/linux/net/core/igmp.c . |
3593 | .TP | |
3594 | .I /proc/net/rarp | |
3595 | This file uses the same format as the | |
3596 | .I arp | |
3597 | file and contains the current reverse mapping database used to provide | |
3598 | .BR rarp (8) | |
c13182ef MK |
3599 | reverse address lookup services. |
3600 | If RARP is not configured into the | |
fea681da MK |
3601 | kernel, |
3602 | this file will not be present. | |
3603 | .TP | |
3604 | .I /proc/net/raw | |
c13182ef MK |
3605 | Holds a dump of the RAW socket table. |
3606 | Much of the information is not of | |
fea681da | 3607 | use |
c13182ef | 3608 | apart from debugging. |
6c04f928 | 3609 | The "sl" value is the kernel hash slot for the |
fea681da | 3610 | socket, |
6c04f928 MK |
3611 | the "local_address" is the local address and protocol number pair. |
3612 | \&"St" is | |
c13182ef MK |
3613 | the internal status of the socket. |
3614 | The "tx_queue" and "rx_queue" are the | |
fea681da | 3615 | outgoing and incoming data queue in terms of kernel memory usage. |
94e9d9fe | 3616 | The "tr", "tm\->when", and "rexmits" fields are not used by RAW. |
fdc196f5 MK |
3617 | The "uid" |
3618 | field holds the effective UID of the creator of the socket. | |
fea681da MK |
3619 | .\" .TP |
3620 | .\" .I /proc/net/route | |
3621 | .\" No information, but looks similar to | |
3622 | .\" .BR route (8). | |
3623 | .TP | |
3624 | .I /proc/net/snmp | |
c13182ef | 3625 | This file holds the ASCII data needed for the IP, ICMP, TCP, and UDP |
fea681da | 3626 | management |
763f0e47 | 3627 | information bases for an SNMP agent. |
fea681da MK |
3628 | .TP |
3629 | .I /proc/net/tcp | |
c13182ef MK |
3630 | Holds a dump of the TCP socket table. |
3631 | Much of the information is not | |
3632 | of use apart from debugging. | |
3633 | The "sl" value is the kernel hash slot | |
6beb1671 MK |
3634 | for the socket, the "local_address" is the local address and port number pair. |
3635 | The "rem_address" is the remote address and port number pair | |
6c04f928 MK |
3636 | (if connected). |
3637 | \&"St" is the internal status of the socket. | |
3638 | The "tx_queue" and "rx_queue" are the | |
fea681da | 3639 | outgoing and incoming data queue in terms of kernel memory usage. |
94e9d9fe | 3640 | The "tr", "tm\->when", and "rexmits" fields hold internal information of |
f33774c4 | 3641 | the kernel socket state and are useful only for debugging. |
fdc196f5 MK |
3642 | The "uid" |
3643 | field holds the effective UID of the creator of the socket. | |
fea681da MK |
3644 | .TP |
3645 | .I /proc/net/udp | |
c13182ef MK |
3646 | Holds a dump of the UDP socket table. |
3647 | Much of the information is not of | |
3648 | use apart from debugging. | |
3649 | The "sl" value is the kernel hash slot for the | |
6beb1671 MK |
3650 | socket, the "local_address" is the local address and port number pair. |
3651 | The "rem_address" is the remote address and port number pair | |
f2d607ee MK |
3652 | (if connected). |
3653 | "St" is the internal status of the socket. | |
fea681da | 3654 | The "tx_queue" and "rx_queue" are the outgoing and incoming data queue |
c13182ef | 3655 | in terms of kernel memory usage. |
94e9d9fe | 3656 | The "tr", "tm\->when", and "rexmits" fields |
c13182ef | 3657 | are not used by UDP. |
fdc196f5 MK |
3658 | The "uid" |
3659 | field holds the effective UID of the creator of the socket. | |
fea681da | 3660 | The format is: |
c1a022dc | 3661 | .IP |
fea681da | 3662 | .in 1n |
c1a022dc | 3663 | .EX |
94e9d9fe | 3664 | sl local_address rem_address st tx_queue rx_queue tr rexmits tm\->when uid |
fea681da MK |
3665 | 1: 01642C89:0201 0C642C89:03FF 01 00000000:00000001 01:000071BA 00000000 0 |
3666 | 1: 00000000:0801 00000000:0000 0A 00000000:00000000 00:00000000 6F000100 0 | |
3667 | 1: 00000000:0201 00000000:0000 0A 00000000:00000000 00:00000000 00000000 0 | |
c1a022dc | 3668 | .EE |
fea681da | 3669 | .in |
c1a022dc | 3670 | .IP |
fea681da MK |
3671 | .TP |
3672 | .I /proc/net/unix | |
008f1ecc | 3673 | Lists the UNIX domain sockets present within the system and their |
c13182ef MK |
3674 | status. |
3675 | The format is: | |
c1a022dc MK |
3676 | .IP |
3677 | .in 1n | |
3678 | .EX | |
fea681da MK |
3679 | Num RefCount Protocol Flags Type St Path |
3680 | 0: 00000002 00000000 00000000 0001 03 | |
3681 | 1: 00000001 00000000 00010000 0001 01 /dev/printer | |
c1a022dc MK |
3682 | .EE |
3683 | .in | |
3684 | .IP | |
756f55f6 MK |
3685 | The fields are as follows: |
3686 | .RS | |
3687 | .TP 10 | |
3688 | .IR Num : | |
3689 | the kernel table slot number. | |
3690 | .TP | |
3691 | .IR RefCount : | |
3692 | the number of users of the socket. | |
3693 | .TP | |
3694 | .IR Protocol : | |
3695 | currently always 0. | |
3696 | .TP | |
3697 | .IR Flags : | |
3698 | the internal kernel flags holding the status of the socket. | |
3699 | .TP | |
3700 | .IR Type : | |
a405066e MK |
3701 | the socket type. |
3702 | For | |
3703 | .BR SOCK_STREAM | |
3704 | sockets, this is 0001; for | |
3705 | .BR SOCK_DGRAM | |
3706 | sockets, it is 0002; and for | |
3707 | .BR SOCK_SEQPACKET | |
3708 | sockets, it is 0005. | |
756f55f6 MK |
3709 | .TP |
3710 | .IR St : | |
3711 | the internal state of the socket. | |
3712 | .TP | |
3713 | .IR Path : | |
3714 | the bound path (if any) of the socket. | |
8f8a46fb MK |
3715 | Sockets in the abstract namespace are included in the list, |
3716 | and are shown with a | |
3717 | .I Path | |
3718 | that commences with the character '@'. | |
756f55f6 | 3719 | .RE |
fea681da | 3720 | .TP |
ed8de0e4 | 3721 | .I /proc/net/netfilter/nfnetlink_queue |
6f858d5c | 3722 | This file contains information about netfilter user-space queueing, if used. |
f2d607ee MK |
3723 | Each line represents a queue. |
3724 | Queues that have not been subscribed to | |
6f858d5c | 3725 | by user space are not shown. |
37d5e699 MK |
3726 | .IP |
3727 | .in +4n | |
3728 | .EX | |
ed8de0e4 FW |
3729 | 1 4207 0 2 65535 0 0 0 1 |
3730 | (1) (2) (3)(4) (5) (6) (7) (8) | |
37d5e699 MK |
3731 | .EE |
3732 | .in | |
ed8de0e4 FW |
3733 | .IP |
3734 | The fields in each line are: | |
3735 | .RS 7 | |
3736 | .TP 5 | |
3737 | (1) | |
f2d607ee MK |
3738 | The ID of the queue. |
3739 | This matches what is specified in the | |
ed8de0e4 FW |
3740 | .B \-\-queue\-num |
3741 | or | |
3742 | .B \-\-queue\-balance | |
3743 | options to the | |
3744 | .BR iptables (8) | |
f2d607ee MK |
3745 | NFQUEUE target. |
3746 | See | |
ed8de0e4 FW |
3747 | .BR iptables-extensions (8) |
3748 | for more information. | |
3749 | .TP | |
3750 | (2) | |
7672e08e | 3751 | The netlink port ID subscribed to the queue. |
ed8de0e4 FW |
3752 | .TP |
3753 | (3) | |
3754 | The number of packets currently queued and waiting to be processed by | |
3755 | the application. | |
3756 | .TP | |
3757 | (4) | |
f2d607ee MK |
3758 | The copy mode of the queue. |
3759 | It is either 1 (metadata only) or 2 | |
6f858d5c | 3760 | (also copy payload data to user space). |
ed8de0e4 FW |
3761 | .TP |
3762 | (5) | |
1dea597b | 3763 | Copy range; that is, how many bytes of packet payload should be copied to |
6f858d5c | 3764 | user space at most. |
ed8de0e4 FW |
3765 | .TP |
3766 | (6) | |
f2d607ee MK |
3767 | queue dropped. |
3768 | Number of packets that had to be dropped by the kernel because | |
6f858d5c | 3769 | too many packets are already waiting for user space to send back the mandatory |
ed8de0e4 FW |
3770 | accept/drop verdicts. |
3771 | .TP | |
3772 | (7) | |
f2d607ee MK |
3773 | queue user dropped. |
3774 | Number of packets that were dropped within the netlink | |
3775 | subsystem. | |
3776 | Such drops usually happen when the corresponding socket buffer is | |
6f858d5c | 3777 | full; that is, user space is not able to read messages fast enough. |
ed8de0e4 FW |
3778 | .TP |
3779 | (8) | |
f2d607ee MK |
3780 | sequence number. |
3781 | Every queued packet is associated with a (32-bit) | |
ed8de0e4 FW |
3782 | monotonically-increasing sequence number. |
3783 | This shows the ID of the most recent packet queued. | |
3784 | .RE | |
3785 | .IP | |
f33774c4 | 3786 | The last number exists only for compatibility reasons and is always 1. |
ed8de0e4 | 3787 | .TP |
fea681da | 3788 | .I /proc/partitions |
f042d149 MK |
3789 | Contains the major and minor numbers of each partition as well as the number |
3790 | of 1024-byte blocks and the partition name. | |
fea681da MK |
3791 | .TP |
3792 | .I /proc/pci | |
3793 | This is a listing of all PCI devices found during kernel initialization | |
3794 | and their configuration. | |
2dad4c59 | 3795 | .IP |
59a40ed7 MK |
3796 | This file has been deprecated in favor of a new |
3797 | .I /proc | |
2990d781 MK |
3798 | interface for PCI |
3799 | .RI ( /proc/bus/pci ). | |
3800 | It became optional in Linux 2.2 (available with | |
3801 | .B CONFIG_PCI_OLD_PROC | |
3802 | set at kernel compilation). | |
24b74457 | 3803 | It became once more nonoptionally enabled in Linux 2.4. |
2990d781 MK |
3804 | Next, it was deprecated in Linux 2.6 (still available with |
3805 | .B CONFIG_PCI_LEGACY_PROC | |
3806 | set), and finally removed altogether since Linux 2.6.17. | |
43d42cc0 | 3807 | .\" FIXME Document /proc/sched_debug (since Linux 2.6.23) |
69119dc7 | 3808 | .\" See also /proc/[pid]/sched |
caea7868 MK |
3809 | .TP |
3810 | .IR /proc/profile " (since Linux 2.4)" | |
3811 | This file is present only if the kernel was booted with the | |
3812 | .I profile=1 | |
3813 | command-line option. | |
3814 | It exposes kernel profiling information in a binary format for use by | |
3815 | .BR readprofile (1). | |
3816 | Writing (e.g., an empty string) to this file resets the profiling counters; | |
3817 | on some architectures, | |
3818 | writing a binary integer "profiling multiplier" of size | |
3819 | .IR sizeof(int) | |
8a3ac89a | 3820 | sets the profiling interrupt frequency. |
fea681da MK |
3821 | .TP |
3822 | .I /proc/scsi | |
59a40ed7 MK |
3823 | A directory with the |
3824 | .I scsi | |
3825 | mid-level pseudo-file and various SCSI low-level | |
2990d781 MK |
3826 | driver directories, |
3827 | which contain a file for each SCSI host in this system, all of | |
c13182ef MK |
3828 | which give the status of some part of the SCSI IO subsystem. |
3829 | These files contain ASCII structures and are, therefore, readable with | |
2990d781 | 3830 | .BR cat (1). |
2dad4c59 | 3831 | .IP |
c13182ef | 3832 | You can also write to some of the files to reconfigure the subsystem or |
59a40ed7 | 3833 | switch certain features on or off. |
fea681da MK |
3834 | .TP |
3835 | .I /proc/scsi/scsi | |
c13182ef | 3836 | This is a listing of all SCSI devices known to the kernel. |
59a40ed7 | 3837 | The listing is similar to the one seen during bootup. |
c13182ef | 3838 | scsi currently supports only the \fIadd-single-device\fP command which |
59a40ed7 | 3839 | allows root to add a hotplugged device to the list of known devices. |
2dad4c59 | 3840 | .IP |
59a40ed7 | 3841 | The command |
37d5e699 | 3842 | .IP |
59a40ed7 | 3843 | .in +4n |
37d5e699 | 3844 | .EX |
59a40ed7 | 3845 | echo \(aqscsi add-single-device 1 0 5 0\(aq > /proc/scsi/scsi |
37d5e699 | 3846 | .EE |
59a40ed7 | 3847 | .in |
37d5e699 | 3848 | .IP |
c13182ef MK |
3849 | will cause |
3850 | host scsi1 to scan on SCSI channel 0 for a device on ID 5 LUN 0. | |
3851 | If there | |
fea681da MK |
3852 | is already a device known on this address or the address is invalid, an |
3853 | error will be returned. | |
3854 | .TP | |
3855 | .I /proc/scsi/[drivername] | |
c13182ef MK |
3856 | \fI[drivername]\fP can currently be NCR53c7xx, aha152x, aha1542, aha1740, |
3857 | aic7xxx, buslogic, eata_dma, eata_pio, fdomain, in2000, pas16, qlogic, | |
3858 | scsi_debug, seagate, t128, u15-24f, ultrastore, or wd7000. | |
3859 | These directories show up for all drivers that registered at least one | |
59a40ed7 | 3860 | SCSI HBA. |
c13182ef | 3861 | Every directory contains one file per registered host. |
59a40ed7 | 3862 | Every host-file is named after the number the host was assigned during |
c13182ef | 3863 | initialization. |
2dad4c59 | 3864 | .IP |
c13182ef | 3865 | Reading these files will usually show driver and host configuration, |
f78ed33a | 3866 | statistics, and so on. |
2dad4c59 | 3867 | .IP |
fea681da MK |
3868 | Writing to these files allows different things on different hosts. |
3869 | For example, with the \fIlatency\fP and \fInolatency\fP commands, | |
3870 | root can switch on and off command latency measurement code in the | |
c13182ef MK |
3871 | eata_dma driver. |
3872 | With the \fIlockup\fP and \fIunlock\fP commands, | |
3873 | root can control bus lockups simulated by the scsi_debug driver. | |
fea681da MK |
3874 | .TP |
3875 | .I /proc/self | |
59a40ed7 MK |
3876 | This directory refers to the process accessing the |
3877 | .I /proc | |
9ee4a2b6 | 3878 | filesystem, |
59a40ed7 MK |
3879 | and is identical to the |
3880 | .I /proc | |
3881 | directory named by the process ID of the same process. | |
fea681da MK |
3882 | .TP |
3883 | .I /proc/slabinfo | |
c13182ef | 3884 | Information about kernel caches. |
c13182ef | 3885 | See |
fea681da MK |
3886 | .BR slabinfo (5) |
3887 | for details. | |
3888 | .TP | |
3889 | .I /proc/stat | |
c13182ef MK |
3890 | kernel/system statistics. |
3891 | Varies with architecture. | |
3892 | Common | |
fea681da MK |
3893 | entries include: |
3894 | .RS | |
3895 | .TP | |
46f6dbe8 ES |
3896 | .I cpu 10132153 290696 3084719 46828483 16683 0 25195 0 175628 0 |
3897 | .TQ | |
3898 | .I cpu0 1393280 32966 572056 13343292 6130 0 17875 0 23933 0 | |
bfbfcd18 | 3899 | The amount of time, measured in units of |
268f000b MK |
3900 | USER_HZ (1/100ths of a second on most architectures, use |
3901 | .IR sysconf(_SC_CLK_TCK) | |
3902 | to obtain the right value), | |
b81087ab | 3903 | .\" 1024 on Alpha and ia64 |
46f6dbe8 ES |
3904 | that the system ("cpu" line) or the specific CPU ("cpu\fIN\fR" line) |
3905 | spent in various states: | |
ae3b8047 MK |
3906 | .RS |
3907 | .TP | |
3908 | .I user | |
ea0841f6 | 3909 | (1) Time spent in user mode. |
ae3b8047 MK |
3910 | .TP |
3911 | .I nice | |
0633f951 | 3912 | (2) Time spent in user mode with low priority (nice). |
9f1b9726 | 3913 | .TP |
ae3b8047 | 3914 | .I system |
0633f951 | 3915 | (3) Time spent in system mode. |
ae3b8047 MK |
3916 | .TP |
3917 | .I idle | |
ea0841f6 | 3918 | (4) Time spent in the idle task. |
bea08fec | 3919 | .\" FIXME . Actually, the following info about the /proc/stat 'cpu' field |
e04a1f93 MK |
3920 | .\" does not seem to be quite right (at least in 2.6.12 or 3.6): |
3921 | .\" the idle time in /proc/uptime does not quite match this value | |
3922 | This value should be USER_HZ times the | |
4cb1deb7 MK |
3923 | second entry in the |
3924 | .I /proc/uptime | |
3925 | pseudo-file. | |
ae3b8047 MK |
3926 | .TP |
3927 | .IR iowait " (since Linux 2.5.41)" | |
ea0841f6 | 3928 | (5) Time waiting for I/O to complete. |
e0a73a31 MK |
3929 | This value is not reliable, for the following reasons: |
3930 | .\" See kernel commit 9c240d757658a3ae9968dd309e674c61f07c7f48 | |
3931 | .RS | |
3932 | .IP 1. 3 | |
3933 | The CPU will not wait for I/O to complete; | |
3934 | iowait is the time that a task is waiting for I/O to complete. | |
3935 | When a CPU goes into idle state for outstanding task I/O, | |
3936 | another task will be scheduled on this CPU. | |
3937 | .IP 2. | |
3938 | On a multi-core CPU, | |
3939 | the task waiting for I/O to complete is not running on any CPU, | |
3940 | so the iowait of each CPU is difficult to calculate. | |
3941 | .IP 3. | |
3942 | The value in this field may | |
3943 | .I decrease | |
3944 | in certain conditions. | |
2d3fb75b | 3945 | .RE |
ae3b8047 MK |
3946 | .TP |
3947 | .IR irq " (since Linux 2.6.0-test4)" | |
ea0841f6 | 3948 | (6) Time servicing interrupts. |
ae3b8047 | 3949 | .TP |
0633f951 | 3950 | .IR softirq " (since Linux 2.6.0-test4)" |
ea0841f6 | 3951 | (7) Time servicing softirqs. |
ae3b8047 MK |
3952 | .TP |
3953 | .IR steal " (since Linux 2.6.11)" | |
ea0841f6 | 3954 | (8) Stolen time, which is the time spent in other operating systems when |
9de1f6cc | 3955 | running in a virtualized environment |
ae3b8047 MK |
3956 | .TP |
3957 | .IR guest " (since Linux 2.6.24)" | |
0633f951 | 3958 | (9) Time spent running a virtual CPU for guest |
afef1764 | 3959 | operating systems under the control of the Linux kernel. |
14c06953 | 3960 | .\" See Changelog entry for 5e84cfde51cf303d368fcb48f22059f37b3872de |
d4fd4120 MK |
3961 | .TP |
3962 | .IR guest_nice " (since Linux 2.6.33)" | |
3963 | .\" commit ce0e7b28fb75cb003cfc8d0238613aaf1c55e797 | |
3964 | (10) Time spent running a niced guest (virtual CPU for guest | |
3965 | operating systems under the control of the Linux kernel). | |
ae3b8047 | 3966 | .RE |
fea681da MK |
3967 | .TP |
3968 | \fIpage 5741 1808\fP | |
3969 | The number of pages the system paged in and the number that were paged | |
3970 | out (from disk). | |
3971 | .TP | |
3972 | \fIswap 1 0\fP | |
3973 | The number of swap pages that have been brought in and out. | |
3974 | .TP | |
bea08fec | 3975 | .\" FIXME . The following is not the full picture for the 'intr' of |
777f5a9e | 3976 | .\" /proc/stat on 2.6: |
fea681da | 3977 | \fIintr 1462898\fP |
bfbfcd18 MK |
3978 | This line shows counts of interrupts serviced since boot time, |
3979 | for each of the possible system interrupts. | |
d63ff76e | 3980 | The first column is the total of all interrupts serviced |
d6a56978 MK |
3981 | including unnumbered architecture specific interrupts; |
3982 | each subsequent column is the total for that particular numbered interrupt. | |
d63ff76e | 3983 | Unnumbered interrupts are not shown, only summed into the total. |
fea681da MK |
3984 | .TP |
3985 | \fIdisk_io: (2,0):(31,30,5764,1,2) (3,0):\fP... | |
636297e9 | 3986 | (major,disk_idx):(noinfo, read_io_ops, blks_read, write_io_ops, blks_written) |
bfbfcd18 MK |
3987 | .br |
3988 | (Linux 2.4 only) | |
fea681da MK |
3989 | .TP |
3990 | \fIctxt 115315\fP | |
3991 | The number of context switches that the system underwent. | |
3992 | .TP | |
3993 | \fIbtime 769041601\fP | |
f49c451a | 3994 | boot time, in seconds since the Epoch, 1970-01-01 00:00:00 +0000 (UTC). |
fea681da MK |
3995 | .TP |
3996 | \fIprocesses 86031\fP | |
3997 | Number of forks since boot. | |
bfbfcd18 MK |
3998 | .TP |
3999 | \fIprocs_running 6\fP | |
4000 | Number of processes in runnable state. | |
5fab2e7c | 4001 | (Linux 2.5.45 onward.) |
bfbfcd18 MK |
4002 | .TP |
4003 | \fIprocs_blocked 2\fP | |
4004 | Number of processes blocked waiting for I/O to complete. | |
5fab2e7c | 4005 | (Linux 2.5.45 onward.) |
76f6f102 ES |
4006 | .TP |
4007 | .I softirq 229245889 94 60001584 13619 5175704 2471304 28 51212741 59130143 0 51240672 | |
4008 | .\" commit d3d64df21d3d0de675a0d3ffa7c10514f3644b30 | |
4009 | This line shows the number of softirq for all CPUs. | |
4010 | The first column is the total of all softirqs and | |
4011 | each subsequent column is the total for particular softirq. | |
d7f23d0b | 4012 | (Linux 2.6.31 onward.) |
fea681da MK |
4013 | .RE |
4014 | .TP | |
4015 | .I /proc/swaps | |
c13182ef MK |
4016 | Swap areas in use. |
4017 | See also | |
fea681da MK |
4018 | .BR swapon (8). |
4019 | .TP | |
4020 | .I /proc/sys | |
4021 | This directory (present since 1.3.57) contains a number of files | |
4022 | and subdirectories corresponding to kernel variables. | |
4023 | These variables can be read and sometimes modified using | |
9ee4a2b6 | 4024 | the \fI/proc\fP filesystem, and the (deprecated) |
fea681da | 4025 | .BR sysctl (2) |
c13182ef | 4026 | system call. |
2dad4c59 | 4027 | .IP |
e8aa7100 | 4028 | String values may be terminated by either \(aq\\0\(aq or \(aq\\n\(aq. |
2dad4c59 | 4029 | .IP |
84ff8c1e HS |
4030 | Integer and long values may be written either in decimal or in |
4031 | hexadecimal notation (e.g. 0x3FFF). | |
e8aa7100 MK |
4032 | When writing multiple integer or long values, these may be separated |
4033 | by any of the following whitespace characters: | |
4034 | \(aq\ \(aq, \(aq\\t\(aq, or \(aq\\n\(aq. | |
4035 | Using other separators leads to the error | |
84ff8c1e | 4036 | .BR EINVAL . |
fea681da | 4037 | .TP |
6ab7c0aa | 4038 | .IR /proc/sys/abi " (since Linux 2.4.10)" |
fea681da | 4039 | This directory may contain files with application binary information. |
6ab7c0aa | 4040 | .\" On some systems, it is not present. |
66a9882e | 4041 | See the Linux kernel source file |
6ab7c0aa MK |
4042 | .I Documentation/sysctl/abi.txt |
4043 | for more information. | |
fea681da MK |
4044 | .TP |
4045 | .I /proc/sys/debug | |
4046 | This directory may be empty. | |
4047 | .TP | |
4048 | .I /proc/sys/dev | |
e2badfdf | 4049 | This directory contains device-specific information (e.g., |
9a67332e | 4050 | .IR dev/cdrom/info ). |
fea681da MK |
4051 | On |
4052 | some systems, it may be empty. | |
4053 | .TP | |
4054 | .I /proc/sys/fs | |
49236d3c | 4055 | This directory contains the files and subdirectories for kernel variables |
9ee4a2b6 | 4056 | related to filesystems. |
fea681da MK |
4057 | .TP |
4058 | .I /proc/sys/fs/binfmt_misc | |
c13182ef | 4059 | Documentation for files in this directory can be found |
a2923df0 MK |
4060 | in the Linux kernel source in the file |
4061 | .IR Documentation/admin-guide/binfmt-misc.rst | |
4062 | (or in | |
4063 | .IR Documentation/binfmt_misc.txt | |
4064 | on older kernels). | |
fea681da | 4065 | .TP |
59a40ed7 MK |
4066 | .IR /proc/sys/fs/dentry-state " (since Linux 2.2)" |
4067 | This file contains information about the status of the | |
4068 | directory cache (dcache). | |
4069 | The file contains six numbers, | |
c13182ef | 4070 | .IR nr_dentry ", " nr_unused ", " age_limit " (age in seconds), " |
59a40ed7 | 4071 | .I want_pages |
fea681da | 4072 | (pages requested by system) and two dummy values. |
59a40ed7 MK |
4073 | .RS |
4074 | .IP * 2 | |
4075 | .I nr_dentry | |
4076 | is the number of allocated dentries (dcache entries). | |
4077 | This field is unused in Linux 2.2. | |
4078 | .IP * | |
4079 | .I nr_unused | |
4080 | is the number of unused dentries. | |
4081 | .IP * | |
4082 | .I age_limit | |
4083 | .\" looks like this is unused in kernels 2.2 to 2.6 | |
4084 | is the age in seconds after which dcache entries | |
4085 | can be reclaimed when memory is short. | |
4086 | .IP * | |
4087 | .I want_pages | |
4088 | .\" looks like this is unused in kernels 2.2 to 2.6 | |
c7094399 | 4089 | is nonzero when the kernel has called shrink_dcache_pages() and the |
fea681da | 4090 | dcache isn't pruned yet. |
59a40ed7 | 4091 | .RE |
fea681da MK |
4092 | .TP |
4093 | .I /proc/sys/fs/dir-notify-enable | |
4094 | This file can be used to disable or enable the | |
4095 | .I dnotify | |
4096 | interface described in | |
4097 | .BR fcntl (2) | |
4098 | on a system-wide basis. | |
4099 | A value of 0 in this file disables the interface, | |
4100 | and a value of 1 enables it. | |
4101 | .TP | |
4102 | .I /proc/sys/fs/dquot-max | |
4103 | This file shows the maximum number of cached disk quota entries. | |
4104 | On some (2.4) systems, it is not present. | |
4105 | If the number of free cached disk quota entries is very low and | |
4106 | you have some awesome number of simultaneous system users, | |
4107 | you might want to raise the limit. | |
4108 | .TP | |
4109 | .I /proc/sys/fs/dquot-nr | |
4110 | This file shows the number of allocated disk quota | |
4111 | entries and the number of free disk quota entries. | |
4112 | .TP | |
24cb4a4b | 4113 | .IR /proc/sys/fs/epoll " (since Linux 2.6.28)" |
242b46af MK |
4114 | This directory contains the file |
4115 | .IR max_user_watches , | |
24cb4a4b MK |
4116 | which can be used to limit the amount of kernel memory consumed by the |
4117 | .I epoll | |
4118 | interface. | |
4119 | For further details, see | |