Commit | Line | Data |
---|---|---|
be91a597 KM |
1 | .\" Copyright (c) 1980, 1991 Regents of the University of California. |
2 | .\" All rights reserved. | |
3a8113b3 | 3 | .\" |
be91a597 KM |
4 | .\" @(#)pstat.8 6.9 (Berkeley) %G% |
5 | .\" %sccs.include.redist.man% | |
3a8113b3 | 6 | .\" |
be91a597 KM |
7 | .\" @(#)pstat.8 6.9 (Berkeley) %G% |
8 | .\" | |
9 | .Dd | |
10 | .Dt PSTAT 8 | |
11 | .Os BSD 4 | |
12 | .Sh NAME | |
13 | .Nm pstat | |
14 | .Nd display system data structures | |
15 | .Sh SYNOPSIS | |
16 | .Nm pstat | |
17 | .Op Fl Tfnpstvx | |
18 | .Op Fl U Ar pid | |
19 | .Op Ar system | |
20 | .Op Ar corefile | |
21 | .Sh DESCRIPTION | |
22 | .Nm Pstat | |
2e9b3e06 | 23 | displays certain system data structures. |
3a8113b3 | 24 | If |
be91a597 | 25 | .Ar corefile |
2e9b3e06 | 26 | is given, the information is sought there, otherwise |
3a8113b3 | 27 | in |
be91a597 | 28 | .Pa /dev/kmem . |
3a8113b3 | 29 | The required namelist is taken from |
be91a597 | 30 | .Pa /vmunix |
be3c220c | 31 | unless |
be91a597 | 32 | .Ar system |
be3c220c | 33 | is specified. |
3a8113b3 | 34 | Options are |
be91a597 KM |
35 | .Tw 5n |
36 | .Tl Fl T | |
37 | Prints the number of used and free slots in the several system tables | |
38 | and is useful for checking to see how full system tables have become if the | |
39 | system is under heavy load. | |
40 | .Tl Fl f | |
41 | Print the open file table with these headings: | |
42 | .Tt 0 1 0 OFFSET | |
43 | .Tl LOC | |
3a8113b3 | 44 | The core location of this table entry. |
be91a597 KM |
45 | .Tl TYPE |
46 | The type of object the file table entry points to. | |
47 | .Tl FLG | |
3a8113b3 | 48 | Miscellaneous state variables encoded thus: |
be91a597 KM |
49 | .Tt 0 1 4n 4n |
50 | .Tl R | |
51 | open for reading | |
52 | .Tl W | |
53 | open for writing | |
54 | .Tl A | |
55 | open for appending | |
56 | .Tl S | |
57 | shared lock present | |
58 | .Tl X | |
59 | exclusive lock present | |
60 | .Tl I | |
61 | signal pgrp when data ready | |
62 | .Tl | |
63 | .Tl CNT | |
64 | Number of processes that know this open file. | |
65 | .Tl MSG | |
66 | Number of messages outstanding for this file. | |
67 | .Tl DATA | |
68 | The location of the vnode table entry or socket structure for this file. | |
69 | .Tl OFFSET | |
70 | The file offset (see | |
71 | .Xr lseek 2 ) . | |
72 | .Tl | |
73 | .Tl Fl p | |
3a8113b3 | 74 | Print process table for active processes with these headings: |
be91a597 KM |
75 | .Tt 0 1 0 TEXTP |
76 | .Tl LOC | |
3a8113b3 | 77 | The core location of this table entry. |
be91a597 | 78 | .Tl S |
3a8113b3 | 79 | Run state encoded thus: |
be91a597 KM |
80 | .Tt 0 1 4n 4n |
81 | .Tl 0 | |
3a8113b3 | 82 | no process |
be91a597 | 83 | .Tl 1 |
3a8113b3 | 84 | waiting for some event |
be91a597 | 85 | .Tl 3 |
3a8113b3 | 86 | runnable |
be91a597 | 87 | .Tl 4 |
3a8113b3 | 88 | being created |
be91a597 | 89 | .Tl 5 |
3a8113b3 | 90 | being terminated |
be91a597 KM |
91 | .Tl 6 |
92 | stopped (by signal or under trace) | |
93 | .Tl | |
94 | .Tl F | |
0ecf4440 | 95 | Miscellaneous state variables, or'ed together (hexadecimal): |
be91a597 KM |
96 | .Tt 0 1 4n 1000000xx |
97 | .Tl 0001 | |
3a8113b3 | 98 | loaded |
be91a597 | 99 | .Tl 0002 |
3a8113b3 | 100 | the scheduler process |
be91a597 | 101 | .Tl 0004 |
3a8113b3 | 102 | locked for swap out |
be91a597 | 103 | .Tl 0008 |
3a8113b3 | 104 | swapped out |
be91a597 | 105 | .Tl 0010 |
3a8113b3 | 106 | traced |
be91a597 | 107 | .Tl 0020 |
3a8113b3 | 108 | used in tracing |
be91a597 KM |
109 | . \".Tl 000040 |
110 | . \"locked in by | |
111 | . \".Xr lock 2 . | |
112 | .Tl 0080 | |
3a8113b3 | 113 | in page-wait |
be91a597 | 114 | .Tl 0100 |
3a8113b3 | 115 | prevented from swapping during |
be91a597 KM |
116 | .Xr fork 2 |
117 | .Tl 0200 | |
53536069 | 118 | will restore old mask after taking signal |
be91a597 | 119 | .Tl 0400 |
3a8113b3 | 120 | exiting |
be91a597 | 121 | .Tl 0800 |
0ecf4440 | 122 | doing physical I/O (bio.c) |
be91a597 | 123 | .Tl 1000 |
3a8113b3 | 124 | process resulted from a |
be91a597 | 125 | .Xr vfork 2 |
3a8113b3 | 126 | which is not yet complete |
be91a597 | 127 | .Tl 2000 |
3a8113b3 | 128 | another flag for |
be91a597 KM |
129 | .Xr vfork 2 |
130 | .Tl 4000 | |
3a8113b3 | 131 | process has no virtual memory, as it is a parent in the context of |
be91a597 KM |
132 | .Xr vfork 2 |
133 | .Tl 8000 | |
9eecf21c | 134 | process is demand paging data pages from its text vnode. |
be91a597 | 135 | .Tl 10000 |
0ecf4440 | 136 | process using sequential VM patterns |
be91a597 | 137 | .Tl 20000 |
0ecf4440 | 138 | process using random VM patterns |
be91a597 | 139 | .Tl 100000 |
0ecf4440 | 140 | using old 4.1-compatible signal semantics |
be91a597 | 141 | .Tl 200000 |
0ecf4440 | 142 | process needs profiling tick |
be91a597 | 143 | .Tl 400000 |
0ecf4440 | 144 | process is scanning descriptors during select |
be91a597 | 145 | .Tl 1000000 |
0ecf4440 | 146 | process page tables have changed |
be91a597 KM |
147 | .Tl |
148 | .Tl POIP | |
3a8113b3 | 149 | number of pages currently being pushed out from this process. |
be91a597 | 150 | .Tl PRI |
3a8113b3 | 151 | Scheduling priority, see |
be91a597 KM |
152 | .Xr setpriority 2 . |
153 | .Tl SIG | |
3a8113b3 | 154 | Signals received (signals 1-32 coded in bits 0-31), |
be91a597 | 155 | .Tl UID |
3a8113b3 | 156 | Real user ID. |
be91a597 | 157 | .Tl SLP |
3a8113b3 | 158 | Amount of time process has been blocked. |
be91a597 | 159 | .Tl TIM |
3a8113b3 | 160 | Time resident in seconds; times over 127 coded as 127. |
be91a597 | 161 | .Tl CPU |
3a8113b3 | 162 | Weighted integral of CPU time, for scheduler. |
be91a597 | 163 | .Tl NI |
3a8113b3 KM |
164 | Nice level, |
165 | see | |
be91a597 KM |
166 | .Xr setpriority 2 . |
167 | .Tl PID | |
3a8113b3 | 168 | The process ID number. |
be91a597 | 169 | .Tl PPID |
3a8113b3 | 170 | The process ID of parent process. |
be91a597 | 171 | .Tl ADDR |
3a8113b3 KM |
172 | If in core, the page frame number of the first page of the `u-area' of |
173 | the process. | |
174 | If swapped out, the position in the swap area | |
175 | measured in multiples of 512 bytes. | |
be91a597 | 176 | .Tl RSS |
3a8113b3 KM |
177 | Resident set size \- the number of physical page frames allocated |
178 | to this process. | |
be91a597 | 179 | .Tl SRSS |
3a8113b3 | 180 | RSS at last swap (0 if never swapped). |
be91a597 | 181 | .Tl SIZE |
3a8113b3 | 182 | Virtual size of process image (data+stack) in multiples of 512 bytes. |
be91a597 | 183 | .Tl WCHAN |
3a8113b3 | 184 | Wait channel number of a waiting process. |
be91a597 | 185 | .Tl LINK |
3a8113b3 | 186 | Link pointer in list of runnable processes. |
be91a597 | 187 | .Tl TEXTP |
3a8113b3 | 188 | If text is pure, pointer to location of text table entry. |
be91a597 KM |
189 | .Tl |
190 | .Tl Fl s | |
191 | Print information about swap space usage: the number of (1k byte) pages used | |
192 | and free is given as well as the number of used pages which belong | |
193 | to text images. | |
194 | .Tl Fl t | |
3a8113b3 KM |
195 | Print table for terminals |
196 | with these headings: | |
be91a597 KM |
197 | .Tt 0 1 0 STATE |
198 | .Tl RAW | |
3a8113b3 | 199 | Number of characters in raw input queue. |
be91a597 | 200 | .Tl CAN |
3a8113b3 | 201 | Number of characters in canonicalized input queue. |
be91a597 | 202 | .Tl OUT |
3a8113b3 | 203 | Number of characters in putput queue. |
be91a597 | 204 | .Tl MODE |
3a8113b3 | 205 | See |
be91a597 KM |
206 | .Xr tty 4 . |
207 | .Tl ADDR | |
3a8113b3 | 208 | Physical device address. |
be91a597 | 209 | .Tl DEL |
3a8113b3 | 210 | Number of delimiters (newlines) in canonicalized input queue. |
be91a597 | 211 | .Tl COL |
3a8113b3 | 212 | Calculated column position of terminal. |
be91a597 | 213 | .Tl STATE |
3a8113b3 | 214 | Miscellaneous state variables encoded thus: |
be91a597 KM |
215 | .Tt 0 1 4n 4n |
216 | .Tl T | |
53536069 | 217 | delay timeout in progress |
be91a597 | 218 | .Tl W |
3a8113b3 | 219 | waiting for open to complete |
be91a597 | 220 | .Tl O |
3a8113b3 | 221 | open |
be91a597 | 222 | .Tl F |
53536069 | 223 | outq has been flushed during DMA |
be91a597 | 224 | .Tl C |
3a8113b3 | 225 | carrier is on |
be91a597 | 226 | .Tl B |
3a8113b3 | 227 | busy doing output |
be91a597 | 228 | .Tl A |
3a8113b3 | 229 | process is awaiting output |
be91a597 | 230 | .Tl X |
3a8113b3 | 231 | open for exclusive use |
be91a597 | 232 | .Tl S |
53536069 | 233 | output stopped |
be91a597 | 234 | .Tl H |
3a8113b3 | 235 | hangup on close |
be91a597 KM |
236 | .Tl |
237 | .Tl PGRP | |
3a8113b3 | 238 | Process group for which this is controlling terminal. |
be91a597 KM |
239 | .Tl DISC |
240 | Line discipline; blank is old tty | |
241 | OTTYDISC | |
242 | or | |
243 | .Ql new tty | |
244 | for | |
245 | NTTYDISC | |
246 | or | |
247 | .Ql net | |
248 | for | |
249 | NETLDISC | |
250 | (see | |
251 | .Xr bk 4 ) . | |
252 | .Tl | |
253 | .Tl Fl u | |
3a8113b3 KM |
254 | print information about a user process; |
255 | the next argument is its address as given | |
256 | by | |
be91a597 | 257 | .Xr ps 1 . |
3a8113b3 KM |
258 | The process must be in main memory, or the file used can |
259 | be a core image and the address 0. | |
0ecf4440 MK |
260 | Only the fields located in the first page cluster can be located |
261 | succesfully if the process is in main memory. | |
be91a597 KM |
262 | .Tl Fl v |
263 | Print the active vnodes. Each group of vnodes coresponding | |
264 | to a particular filesystem is preceded by a two line header. The | |
265 | first line consists of the following: | |
266 | .Pp | |
267 | .Df I | |
268 | .No *** MOUNT Em fstype from | |
269 | on | |
270 | .Em on fsflags | |
271 | .De | |
272 | .Pp | |
273 | where | |
274 | .Em fstype | |
275 | is one of | |
276 | .Em ufs , nfs , mfs , or pc ; | |
277 | .Em from | |
278 | is the filesystem is mounted from; | |
279 | .Em on | |
280 | is the directory | |
281 | the filesystem is mounted on; and | |
282 | .Em fsflags | |
283 | is a list | |
284 | of optional flags applied to the mount (see | |
285 | .Xr mount 8 ) . | |
286 | .The second line is a header for the individual fields , | |
287 | the first part of which are fixed, and the second part are filesystem | |
288 | type specific. The headers common to all vnodes are: | |
289 | .\" .Tt 0 1 0 VFLAG | |
290 | .Tt 0 1 0 SIZ/DEV | |
291 | .Tl ADDR | |
292 | Location of this vnode. | |
293 | .Tl TYP | |
294 | File type. | |
295 | .Tl VFLAG | |
296 | A list of letters representing vnode flags: | |
297 | .Pp | |
298 | .Tt 0 1 4n 4n | |
299 | .Tl R | |
300 | \- VROOT | |
301 | .Tl T | |
302 | \- VTEXT | |
303 | .Tl L | |
304 | \- VXLOCK | |
305 | .Tl W | |
306 | \- VXWANT | |
307 | .Tl E | |
308 | \- VEXLOCK | |
309 | .Tl S | |
310 | \- VSHLOCK | |
311 | .Tl T | |
312 | \- VLWAIT | |
313 | .Tl A | |
314 | \- VALIASED | |
315 | .Tl B | |
316 | \- VBWAIT | |
317 | .Tl \&\& | |
318 | .Tl \&**** WAS HERE ***** | |
319 | .Tl \&Next | |
320 | .Tl | |
321 | .Pp | |
322 | .Tl LOC | |
3a8113b3 | 323 | The core location of this table entry. |
be91a597 | 324 | .Tl FLAGS |
3a8113b3 | 325 | Miscellaneous state variables encoded thus: |
be91a597 KM |
326 | .Tt 0 1 4n 4n |
327 | .Tl L | |
328 | locked | |
329 | .Tl U | |
330 | update time | |
331 | .Pq Xr fs 5 | |
332 | must be corrected | |
333 | .Tl A | |
334 | access time must be corrected | |
335 | .Tl W | |
336 | wanted by another process (L flag is on) | |
337 | .Tl C | |
338 | changed time must be corrected | |
339 | .Tl S | |
340 | shared lock applied | |
341 | .Tl E | |
342 | exclusive lock applied | |
343 | .Tl Z | |
344 | someone waiting for a lock | |
345 | .Tl M | |
346 | contains modifications | |
347 | .Tl R | |
348 | has a rename in progress | |
349 | .Tl | |
350 | .Tl CNT | |
351 | Number of open file table entries for this inode. | |
352 | .Tl DEV | |
353 | Major and minor device number of file system in which | |
354 | this inode resides. | |
355 | .Tl RDC | |
356 | Reference count of shared locks on the inode. | |
357 | .Tl WRC | |
358 | Reference count of exclusive locks on the inode (this may | |
359 | be > 1 if, for example, a file descriptor is inherited across a fork). | |
360 | .Tl INO | |
361 | I-number within the device. | |
362 | .Tl MODE | |
363 | Mode bits, see | |
364 | .Xr chmod 2 . | |
365 | .Tl NLK | |
366 | Number of links to this inode. | |
367 | .Tl UID | |
368 | User ID of owner. | |
369 | .Tl SIZ/DEV | |
370 | Number of bytes in an ordinary file, or | |
371 | major and minor device of special file. | |
372 | .Tl | |
373 | .Tl Fl x | |
374 | Print the text table with these headings: | |
375 | .Tt 0 1 0 FLAGS | |
376 | .Tl LOC | |
377 | The core location of this table entry. | |
378 | .Tl FLAGS | |
379 | Miscellaneous state variables encoded thus: | |
380 | .Tt 0 1 4n 4n | |
381 | .Tl T | |
382 | .Xr ptrace 2 | |
383 | in effect | |
384 | .Tl W | |
385 | text not yet written on swap device | |
386 | .Tl L | |
387 | loading in progress | |
388 | .Tl K | |
389 | locked | |
390 | .Tl w | |
391 | wanted (L flag is on) | |
392 | .Tl P | |
393 | resulted from demand-page-from-vnode exec format (see | |
394 | .Xr execve 2 ) | |
395 | .Tl | |
396 | .Tl DADDR | |
397 | Disk address in swap, measured in multiples of 512 bytes. | |
398 | .Tl CADDR | |
399 | Head of a linked list of loaded processes using this text segment. | |
400 | .Tl RSS | |
401 | Size of resident text, measured in multiples of 512 bytes. | |
402 | .Tl SIZE | |
403 | Size of text segment, measured in multiples of 512 bytes. | |
404 | .Tl VPTR | |
405 | Core location of corresponding vnode. | |
406 | .Tl CNT | |
407 | Number of processes using this text segment. | |
408 | .Tl CCNT | |
409 | Number of processes in core using this text segment. | |
410 | .Tl FORW | |
411 | Forward link in free list. | |
412 | .Tl BACK | |
413 | Backward link in free list. | |
414 | .Tl | |
415 | .Tl | |
416 | .Sh FILES | |
417 | .Tw /dev/kmemxx | |
418 | .Tl Pa /vmunix | |
419 | namelist | |
420 | .Tl Pa /dev/kmem | |
421 | default source of tables | |
422 | .Tl | |
423 | .Sh SEE ALSO | |
424 | .Xr iostat 1 , | |
425 | .Xr ps 1 , | |
426 | .Xr systat 1 , | |
427 | .Xr vmstat 1 , | |
428 | .Xr stat 2 , | |
429 | .Xr fs 5 , | |
430 | .Rs | |
431 | .Rt Tn UNIX Rt Implementation , | |
432 | .Ra K. Thompson | |
433 | .Re | |
434 | .Sh BUGS | |
3a8113b3 KM |
435 | It would be very useful if the system recorded \*(lqmaximum occupancy\*(rq |
436 | on the tables reported by | |
be91a597 | 437 | .Fl T ; |
3a8113b3 | 438 | even more useful if these tables were dynamically allocated. |
be91a597 KM |
439 | .Sh HISTORY |
440 | The | |
441 | .Nm | |
442 | command appeared in 4.0BSD. |