CONTRIBUTING.d/patches: Please provide a git-range-diff(1)
[man-pages.git] / man5 / proc_pid_stat.5
blobb2ee991d8ecef6bc03c3921d444d01ac46cb060b
1 .\" Copyright (C) 1994, 1995, Daniel Quinlan <quinlan@yggdrasil.com>
2 .\" Copyright (C) 2002-2008, 2017, Michael Kerrisk <mtk.manpages@gmail.com>
3 .\" Copyright (C) 2023, Alejandro Colomar <alx@kernel.org>
4 .\"
5 .\" SPDX-License-Identifier: GPL-3.0-or-later
6 .\"
7 .TH proc_pid_stat 5 (date) "Linux man-pages (unreleased)"
8 .SH NAME
9 /proc/pid/stat \- status information
10 .SH DESCRIPTION
11 .TP
12 .IR /proc/ pid /stat
13 Status information about the process.
14 This is used by
15 .BR ps (1).
16 It is defined in the kernel source file
17 .IR fs/proc/array.c "."
18 .IP
19 The fields, in order, with their proper
20 .BR scanf (3)
21 format specifiers, are listed below.
22 Whether or not certain of these fields display valid information is governed by
23 a ptrace access mode
24 .BR PTRACE_MODE_READ_FSCREDS " | " PTRACE_MODE_NOAUDIT
25 check (refer to
26 .BR ptrace (2)).
27 If the check denies access, then the field value is displayed as 0.
28 The affected fields are indicated with the marking [PT].
29 .RS
30 .TP
31 (1) \fIpid\fP \ %d
32 .br
33 The process ID.
34 .TP
35 (2) \fIcomm\fP \ %s
36 The filename of the executable, in parentheses.
37 Strings longer than
38 .B TASK_COMM_LEN
39 (16) characters (including the terminating null byte) are silently truncated.
40 This is visible whether or not the executable is swapped out.
41 .TP
42 (3) \fIstate\fP \ %c
43 One of the following characters, indicating process state:
44 .RS
45 .TP
47 Running
48 .TP
50 Sleeping in an interruptible wait
51 .TP
53 Waiting in uninterruptible
54 disk sleep
55 .TP
57 Zombie
58 .TP
60 Stopped (on a signal) or (before Linux 2.6.33) trace stopped
61 .TP
63 .\" commit 44d90df6b757c59651ddd55f1a84f28132b50d29
64 Tracing stop (Linux 2.6.33 onward)
65 .TP
67 Paging (only before Linux 2.6.0)
68 .TP
70 Dead (from Linux 2.6.0 onward)
71 .TP
73 .\" commit 44d90df6b757c59651ddd55f1a84f28132b50d29
74 Dead (Linux 2.6.33 to
75 .\" commit 74e37200de8e9c4e09b70c21c3f13c2071e77457
76 3.13 only)
77 .TP
79 .\" commit 44d90df6b757c59651ddd55f1a84f28132b50d29
80 Wakekill (Linux 2.6.33 to
81 .\" commit 74e37200de8e9c4e09b70c21c3f13c2071e77457
82 3.13 only)
83 .TP
85 .\" commit 44d90df6b757c59651ddd55f1a84f28132b50d29
86 Waking (Linux 2.6.33 to
87 .\" commit 74e37200de8e9c4e09b70c21c3f13c2071e77457
88 3.13 only)
89 .TP
91 .\" commit f2530dc71cf0822f90bb63ea4600caaef33a66bb
92 Parked (Linux 3.9 to
93 .\" commit 74e37200de8e9c4e09b70c21c3f13c2071e77457
94 3.13 only)
95 .TP
97 .\" commit 06eb61844d841d0032a9950ce7f8e783ee49c0d0
98 Idle (Linux 4.14 onward)
99 .RE
101 (4) \fIppid\fP \ %d
102 The PID of the parent of this process.
104 (5) \fIpgrp\fP \ %d
105 The process group ID of the process.
107 (6) \fIsession\fP \ %d
108 The session ID of the process.
110 (7) \fItty_nr\fP \ %d
111 The controlling terminal of the process.
112 (The minor device number is contained in the combination of bits
113 31 to 20 and 7 to 0;
114 the major device number is in bits 15 to 8.)
116 (8) \fItpgid\fP \ %d
117 .\" This field and following, up to and including wchan added 0.99.1
118 The ID of the foreground process group of the controlling
119 terminal of the process.
121 (9) \fIflags\fP \ %u
122 The kernel flags word of the process.
123 For bit meanings,
124 see the PF_* defines in the Linux kernel source file
125 .IR include/linux/sched.h .
126 Details depend on the kernel version.
128 The format for this field was %lu before Linux 2.6.
130 (10) \fIminflt\fP \ %lu
131 The number of minor faults the process has made which have not
132 required loading a memory page from disk.
134 (11) \fIcminflt\fP \ %lu
135 The number of minor faults that the process's
136 waited-for children have made.
138 (12) \fImajflt\fP \ %lu
139 The number of major faults the process has made which have
140 required loading a memory page from disk.
142 (13) \fIcmajflt\fP \ %lu
143 The number of major faults that the process's
144 waited-for children have made.
146 (14) \fIutime\fP \ %lu
147 Amount of time that this process has been scheduled in user mode,
148 measured in clock ticks (divide by
149 .IR sysconf(_SC_CLK_TCK) ).
150 This includes guest time, \fIguest_time\fP
151 (time spent running a virtual CPU, see below),
152 so that applications that are not aware of the guest time field
153 do not lose that time from their calculations.
155 (15) \fIstime\fP \ %lu
156 Amount of time that this process has been scheduled in kernel mode,
157 measured in clock ticks (divide by
158 .IR sysconf(_SC_CLK_TCK) ).
160 (16) \fIcutime\fP \ %ld
161 Amount of time that this process's
162 waited-for children have been scheduled in user mode,
163 measured in clock ticks (divide by
164 .IR sysconf(_SC_CLK_TCK) ).
165 (See also
166 .BR times (2).)
167 This includes guest time, \fIcguest_time\fP
168 (time spent running a virtual CPU, see below).
170 (17) \fIcstime\fP \ %ld
171 Amount of time that this process's
172 waited-for children have been scheduled in kernel mode,
173 measured in clock ticks (divide by
174 .IR sysconf(_SC_CLK_TCK) ).
176 (18) \fIpriority\fP \ %ld
177 (Explanation for Linux 2.6)
178 For processes running a real-time scheduling policy
179 .RI ( policy
180 below; see
181 .BR sched_setscheduler (2)),
182 this is the negated scheduling priority, minus one;
183 that is, a number in the range \-2 to \-100,
184 corresponding to real-time priorities 1 to 99.
185 For processes running under a non-real-time scheduling policy,
186 this is the raw nice value
187 .RB ( setpriority (2))
188 as represented in the kernel.
189 The kernel stores nice values as numbers
190 in the range 0 (high) to 39 (low),
191 corresponding to the user-visible nice range of \-20 to 19.
193 Before Linux 2.6, this was a scaled value based on
194 the scheduler weighting given to this process.
195 .\" And back in Linux 1.2 days things were different again.
197 (19) \fInice\fP \ %ld
198 The nice value (see
199 .BR setpriority (2)),
200 a value in the range 19 (low priority) to \-20 (high priority).
201 .\" Back in Linux 1.2 days things were different.
202 .\" .TP
203 .\" \fIcounter\fP %ld
204 .\" The current maximum size in jiffies of the process's next timeslice,
205 .\" or what is currently left of its current timeslice, if it is the
206 .\" currently running process.
207 .\" .TP
208 .\" \fItimeout\fP %u
209 .\" The time in jiffies of the process's next timeout.
210 .\" timeout was removed sometime around 2.1/2.2
212 (20) \fInum_threads\fP \ %ld
213 Number of threads in this process (since Linux 2.6).
214 Before Linux 2.6, this field was hard coded to 0 as a placeholder
215 for an earlier removed field.
217 (21) \fIitrealvalue\fP \ %ld
218 The time in jiffies before the next
219 .B SIGALRM
220 is sent to the process due to an interval timer.
221 Since Linux 2.6.17, this field is no longer maintained,
222 and is hard coded as 0.
224 (22) \fIstarttime\fP \ %llu
225 The time the process started after system boot.
226 Before Linux 2.6, this value was expressed in jiffies.
227 Since Linux 2.6, the value is expressed in clock ticks (divide by
228 .IR sysconf(_SC_CLK_TCK) ).
230 The format for this field was %lu before Linux 2.6.
232 (23) \fIvsize\fP \ %lu
233 Virtual memory size in bytes.
235 (24) \fIrss\fP \ %ld
236 Resident Set Size: number of pages the process has in real memory.
237 This is just the pages which
238 count toward text, data, or stack space.
239 This does not include pages
240 which have not been demand-loaded in, or which are swapped out.
241 This value is inaccurate; see
242 .IR /proc/ pid /statm
243 below.
245 (25) \fIrsslim\fP \ %lu
246 Current soft limit in bytes on the rss of the process;
247 see the description of
248 .B RLIMIT_RSS
250 .BR getrlimit (2).
252 (26) \fIstartcode\fP \ %lu \ [PT]
253 The address above which program text can run.
255 (27) \fIendcode\fP \ %lu \ [PT]
256 The address below which program text can run.
258 (28) \fIstartstack\fP \ %lu \ [PT]
259 The address of the start (i.e., bottom) of the stack.
261 (29) \fIkstkesp\fP \ %lu \ [PT]
262 The current value of ESP (stack pointer), as found in the
263 kernel stack page for the process.
265 (30) \fIkstkeip\fP \ %lu \ [PT]
266 The current EIP (instruction pointer).
268 (31) \fIsignal\fP \ %lu
269 The bitmap of pending signals, displayed as a decimal number.
270 Obsolete, because it does not provide information on real-time signals; use
271 .IR /proc/ pid /status
272 instead.
274 (32) \fIblocked\fP \ %lu
275 The bitmap of blocked signals, displayed as a decimal number.
276 Obsolete, because it does not provide information on real-time signals; use
277 .IR /proc/ pid /status
278 instead.
280 (33) \fIsigignore\fP \ %lu
281 The bitmap of ignored signals, displayed as a decimal number.
282 Obsolete, because it does not provide information on real-time signals; use
283 .IR /proc/ pid /status
284 instead.
286 (34) \fIsigcatch\fP \ %lu
287 The bitmap of caught signals, displayed as a decimal number.
288 Obsolete, because it does not provide information on real-time signals; use
289 .IR /proc/ pid /status
290 instead.
292 (35) \fIwchan\fP \ %lu \ [PT]
293 This is the "channel" in which the process is waiting.
294 It is the address of a location in the kernel where the process is sleeping.
295 The corresponding symbolic name can be found in
296 .IR /proc/ pid /wchan .
298 (36) \fInswap\fP \ %lu
299 .\" nswap was added in Linux 2.0
300 Number of pages swapped (not maintained).
302 (37) \fIcnswap\fP \ %lu
303 .\" cnswap was added in Linux 2.0
304 Cumulative \fInswap\fP for child processes (not maintained).
306 (38) \fIexit_signal\fP \ %d \ (since Linux 2.1.22)
307 Signal to be sent to parent when we die.
309 (39) \fIprocessor\fP \ %d \ (since Linux 2.2.8)
310 CPU number last executed on.
312 (40) \fIrt_priority\fP \ %u \ (since Linux 2.5.19)
313 Real-time scheduling priority, a number in the range 1 to 99 for
314 processes scheduled under a real-time policy,
315 or 0, for non-real-time processes (see
316 .BR sched_setscheduler (2)).
318 (41) \fIpolicy\fP \ %u \ (since Linux 2.5.19)
319 Scheduling policy (see
320 .BR sched_setscheduler (2)).
321 Decode using the SCHED_* constants in
322 .IR linux/sched.h .
324 The format for this field was %lu before Linux 2.6.22.
326 (42) \fIdelayacct_blkio_ticks\fP \ %llu \ (since Linux 2.6.18)
327 Aggregated block I/O delays, measured in clock ticks (centiseconds).
329 (43) \fIguest_time\fP \ %lu \ (since Linux 2.6.24)
330 Guest time of the process (time spent running a virtual CPU
331 for a guest operating system), measured in clock ticks (divide by
332 .IR sysconf(_SC_CLK_TCK) ).
334 (44) \fIcguest_time\fP \ %ld \ (since Linux 2.6.24)
335 Guest time of the process's children, measured in clock ticks (divide by
336 .IR sysconf(_SC_CLK_TCK) ).
338 (45) \fIstart_data\fP \ %lu \ (since Linux 3.3) \ [PT]
339 .\" commit b3f7f573a20081910e34e99cbc91831f4f02f1ff
340 Address above which program initialized and
341 uninitialized (BSS) data are placed.
343 (46) \fIend_data\fP \ %lu \ (since Linux 3.3) \ [PT]
344 .\" commit b3f7f573a20081910e34e99cbc91831f4f02f1ff
345 Address below which program initialized and
346 uninitialized (BSS) data are placed.
348 (47) \fIstart_brk\fP \ %lu \ (since Linux 3.3) \ [PT]
349 .\" commit b3f7f573a20081910e34e99cbc91831f4f02f1ff
350 Address above which program heap can be expanded with
351 .BR brk (2).
353 (48) \fIarg_start\fP \ %lu \ (since Linux 3.5) \ [PT]
354 .\" commit 5b172087f99189416d5f47fd7ab5e6fb762a9ba3
355 Address above which program command-line arguments
356 .RI ( argv )
357 are placed.
359 (49) \fIarg_end\fP \ %lu \ (since Linux 3.5) \ [PT]
360 .\" commit 5b172087f99189416d5f47fd7ab5e6fb762a9ba3
361 Address below program command-line arguments
362 .RI ( argv )
363 are placed.
365 (50) \fIenv_start\fP \ %lu \ (since Linux 3.5) \ [PT]
366 .\" commit 5b172087f99189416d5f47fd7ab5e6fb762a9ba3
367 Address above which program environment is placed.
369 (51) \fIenv_end\fP \ %lu \ (since Linux 3.5) \ [PT]
370 .\" commit 5b172087f99189416d5f47fd7ab5e6fb762a9ba3
371 Address below which program environment is placed.
373 (52) \fIexit_code\fP \ %d \ (since Linux 3.5) \ [PT]
374 .\" commit 5b172087f99189416d5f47fd7ab5e6fb762a9ba3
375 The thread's exit status in the form reported by
376 .BR waitpid (2).
378 .SH SEE ALSO
379 .BR proc (5),
380 .BR proc_pid_status (5)