bring up to date with source. A couple descriptions maybe need fixing
[unix-history] / usr / src / usr.sbin / pstat / pstat.8
CommitLineData
3a8113b3
KM
1.\" Copyright (c) 1980 Regents of the University of California.
2.\" All rights reserved. The Berkeley software License Agreement
3.\" specifies the terms and conditions for redistribution.
4.\"
53536069 5.\" @(#)pstat.8 6.2 (Berkeley) %G%
3a8113b3 6.\"
be5ac2e5 7.TH PSTAT 8 ""
3a8113b3
KM
8.UC 4
9.SH NAME
10pstat \- print system facts
11.SH SYNOPSIS
12.B /etc/pstat
3a8113b3 13.B \-aixptufT
be3c220c
KM
14[
15.B suboptions
16] [
17.B system
18] [
19.B corefile
20]
3a8113b3
KM
21.SH DESCRIPTION
22.I Pstat
23interprets the contents of certain system tables.
24If
be3c220c 25.I corefile
3a8113b3
KM
26is given, the tables are sought there, otherwise
27in
28.I /dev/kmem.
29The required namelist is taken from
be3c220c
KM
30.I /vmunix
31unless
32.I system
33is specified.
3a8113b3
KM
34Options are
35.TP \w'WCHAN\ 'u
36.B \-a
37Under
38.BR \-p ,
39describe all process slots rather than just active ones.
40.TP
41.B \-i
42Print the inode table with the these headings:
43.IP LOC
44The core location of this table entry.
45.PD 0
46.IP FLAGS
47Miscellaneous state variables encoded thus:
48.RS
49.IP L
50locked
51.IP U
52update time
be3c220c 53.RI ( fs (5))
3a8113b3
KM
54must be corrected
55.IP A
56access time must be corrected
57.IP M
58file system is mounted here
59.IP W
60wanted by another process (L flag is on)
61.IP T
62contains a text file
63.IP C
64changed time must be corrected
be3c220c
KM
65.IP S
66shared lock applied
67.IP E
68exclusive lock applied
69.IP Z
70someone waiting for an exclusive lock
3a8113b3
KM
71.RE
72.IP CNT
73Number of open file table entries for this inode.
74.IP DEV
75Major and minor device number of file system in which
76this inode resides.
be3c220c
KM
77.IP RDC
78Reference count of shared locks on the inode.
79.IP WRC
80Reference count of exclusive locks on the inode (this may
81be > 1 if, for example, a file descriptor is inherited across a fork).
3a8113b3
KM
82.IP INO
83I-number within the device.
84.IP MODE
85Mode bits, see
86.IR chmod (2).
87.IP NLK
88Number of links to this inode.
89.IP UID
90User ID of owner.
91.IP SIZ/DEV
92Number of bytes in an ordinary file, or
93major and minor device of special file.
94.PD
95.TP
96.B \-x
97Print the text table with these headings:
98.IP LOC
99The core location of this table entry.
100.PD 0
101.IP FLAGS
102Miscellaneous state variables encoded thus:
103.RS
104.IP T
105.IR ptrace (2)
106in effect
107.IP W
108text not yet written on swap device
109.IP L
110loading in progress
111.IP K
112locked
113.IP w
114wanted (L flag is on)
115.IP P
116resulted from demand-page-from-inode exec format (see
be3c220c 117.IR execve (2))
3a8113b3
KM
118.RE
119.PD
120.IP DADDR
121Disk address in swap, measured in multiples of 512 bytes.
122.IP CADDR
123Head of a linked list of loaded processes using this text segment.
53536069
JL
124.IP RSS
125Size of resident text, measured in multiples of 512 bytes.
3a8113b3
KM
126.IP SIZE
127Size of text segment, measured in multiples of 512 bytes.
128.IP IPTR
129Core location of corresponding inode.
130.IP CNT
131Number of processes using this text segment.
132.IP CCNT
133Number of processes in core using this text segment.
53536069
JL
134.IP FORW
135Forward link in free list.
136.IP BACK
137Backward link in free list.
3a8113b3
KM
138.PD
139.TP
140.B \-p
141Print process table for active processes with these headings:
142.IP LOC
143The core location of this table entry.
144.PD 0
145.IP S
146Run state encoded thus:
147.RS
148.IP 0
149no process
150.IP 1
151waiting for some event
152.IP 3
153runnable
154.IP 4
155being created
156.IP 5
157being terminated
158.IP 6
159stopped under trace
160.RE
161.IP F
162Miscellaneous state variables, or-ed together (hexadecimal):
163.RS
53536069 164.IP 0001 9n
3a8113b3 165loaded
53536069 166.IP 0002
3a8113b3 167the scheduler process
53536069 168.IP 0004
3a8113b3 169locked for swap out
53536069 170.IP 0008
3a8113b3 171swapped out
53536069 172.IP 0010
3a8113b3 173traced
53536069 174.IP 0020
3a8113b3 175used in tracing
be3c220c
KM
176. \".IP 000040
177. \"locked in by
178. \".IR lock (2).
53536069 179.IP 0080
3a8113b3 180in page-wait
53536069 181.IP 0100
3a8113b3
KM
182prevented from swapping during
183.IR fork (2)
53536069
JL
184.IP 0200
185will restore old mask after taking signal
186.IP 0400
3a8113b3 187exiting
53536069
JL
188.IP 0800
189doing physical i/o (bio.c)
190.IP 1000
3a8113b3
KM
191process resulted from a
192.IR vfork (2)
193which is not yet complete
53536069 194.IP 2000
3a8113b3
KM
195another flag for
196.IR vfork (2)
53536069 197.IP 4000
3a8113b3
KM
198process has no virtual memory, as it is a parent in the context of
199.IR vfork (2)
53536069 200.IP 8000
3a8113b3 201process is demand paging data pages from its text inode.
3a8113b3
KM
202.RE
203.IP POIP
204number of pages currently being pushed out from this process.
205.IP PRI
206Scheduling priority, see
be3c220c 207.IR setpriority (2).
53536069 208.IP SIG
3a8113b3
KM
209Signals received (signals 1-32 coded in bits 0-31),
210.IP UID
211Real user ID.
212.IP SLP
213Amount of time process has been blocked.
214.IP TIM
215Time resident in seconds; times over 127 coded as 127.
216.IP CPU
217Weighted integral of CPU time, for scheduler.
218.IP NI
219Nice level,
220see
be3c220c 221.IR setpriority (2).
3a8113b3
KM
222.IP PGRP
223Process number of root of process group
224(the opener of the controlling terminal).
225.IP PID
226The process ID number.
227.IP PPID
228The process ID of parent process.
229.IP ADDR
230If in core, the page frame number of the first page of the `u-area' of
231the process.
232If swapped out, the position in the swap area
233measured in multiples of 512 bytes.
234.IP RSS
235Resident set size \- the number of physical page frames allocated
236to this process.
237.IP SRSS
238RSS at last swap (0 if never swapped).
239.IP SIZE
240Virtual size of process image (data+stack) in multiples of 512 bytes.
241.IP WCHAN
242Wait channel number of a waiting process.
243.IP LINK
244Link pointer in list of runnable processes.
245.IP TEXTP
246If text is pure, pointer to location of text table entry.
3a8113b3
KM
247.PD
248.TP
249.B \-t
250Print table for terminals
251with these headings:
252.IP RAW
253Number of characters in raw input queue.
254.PD 0
255.IP CAN
256Number of characters in canonicalized input queue.
257.IP OUT
258Number of characters in putput queue.
259.IP MODE
260See
261.IR tty (4).
262.IP ADDR
263Physical device address.
264.IP DEL
265Number of delimiters (newlines) in canonicalized input queue.
266.IP COL
267Calculated column position of terminal.
268.IP STATE
269Miscellaneous state variables encoded thus:
270.RS
53536069
JL
271.IP T
272delay timeout in progress
3a8113b3
KM
273.IP W
274waiting for open to complete
275.IP O
276open
53536069
JL
277.IP F
278outq has been flushed during DMA
3a8113b3
KM
279.IP C
280carrier is on
281.IP B
282busy doing output
283.IP A
284process is awaiting output
285.IP X
286open for exclusive use
53536069
JL
287.IP S
288output stopped
3a8113b3
KM
289.IP H
290hangup on close
291.RE
292.IP PGRP
293Process group for which this is controlling terminal.
294.IP DISC
295Line discipline; blank is old tty OTTYDISC or ``new tty'' for NTTYDISC
296or ``net'' for NETLDISC (see
297.IR bk (4)).
298.PD
299.TP
300.B \-u
301print information about a user process;
302the next argument is its address as given
303by
304.IR ps (1).
305The process must be in main memory, or the file used can
306be a core image and the address 0.
307.TP
308.B \-f
309Print the open file table with these headings:
310.IP LOC
311The core location of this table entry.
be3c220c
KM
312.IP TYPE
313The type of object the file table entry points to.
3a8113b3
KM
314.PD 0
315.IP FLG
316Miscellaneous state variables encoded thus:
317.RS
318.IP R
319open for reading
320.IP W
321open for writing
be3c220c
KM
322.IP A
323open for appending
53536069
JL
324.IP S
325shared lock present
326.IP X
327exclusive lock present
328.IP I
329signal pgrp when data ready
3a8113b3
KM
330.RE
331.IP CNT
332Number of processes that know this open file.
53536069
JL
333.IP MSG
334Number of messages outstanding for this file.
335.IP DATA
336The location of the inode table entry or socket structure for this file.
337.IP OFFSET
be3c220c 338The file offset (see
53536069 339.IR lseek (2)).
3a8113b3
KM
340.PD
341.PP
342.B \-s
343print information about swap space usage: the number of (1k byte) pages used
344and free is given as well as the number of used pages which belong
345to text images.
346.PP
347.B \-T
348prints the number of used and free slots in the several system tables
349and is useful for checking to see how full system tables have become if the
350system is under heavy load.
3a8113b3
KM
351.SH FILES
352.ta \w'/dev/kmem 'u
353/vmunix namelist
354.br
355/dev/kmem default source of tables
356.SH SEE ALSO
be3c220c
KM
357ps(1),
358stat(2),
359fs(5)
3a8113b3
KM
360.br
361K. Thompson,
362.I UNIX Implementation
363.SH BUGS
364It would be very useful if the system recorded \*(lqmaximum occupancy\*(rq
365on the tables reported by
366.B \-T;
367even more useful if these tables were dynamically allocated.