BSD 4_3_Reno release
[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.\"
1c15e888 5.\" @(#)pstat.8 6.6 (Berkeley) 6/24/90
3a8113b3 6.\"
1c15e888 7.TH PSTAT 8 "June 24, 1990"
3a8113b3
KM
8.UC 4
9.SH NAME
10pstat \- print system facts
11.SH SYNOPSIS
ca615ffd 12.B 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
3a8113b3
KM
57.IP W
58wanted by another process (L flag is on)
3a8113b3
KM
59.IP C
60changed time must be corrected
be3c220c
KM
61.IP S
62shared lock applied
63.IP E
64exclusive lock applied
65.IP Z
0ecf4440 66someone waiting for a lock
9eecf21c
KM
67.IP M
68contains modifications
69.IP R
70has a rename in progress
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
9eecf21c 116resulted from demand-page-from-vnode 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.
9eecf21c
KM
128.IP VPTR
129Core location of corresponding vnode.
3a8113b3
KM
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
0ecf4440 159stopped (by signal or under trace)
3a8113b3
KM
160.RE
161.IP F
0ecf4440 162Miscellaneous state variables, or'ed together (hexadecimal):
3a8113b3 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 188.IP 0800
0ecf4440 189doing physical I/O (bio.c)
53536069 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
9eecf21c 201process is demand paging data pages from its text vnode.
0ecf4440
MK
202.IP 10000
203process using sequential VM patterns
204.IP 20000
205process using random VM patterns
206.IP 100000
207using old 4.1-compatible signal semantics
208.IP 200000
209process needs profiling tick
210.IP 400000
211process is scanning descriptors during select
212.IP 1000000
213process page tables have changed
3a8113b3
KM
214.RE
215.IP POIP
216number of pages currently being pushed out from this process.
217.IP PRI
218Scheduling priority, see
be3c220c 219.IR setpriority (2).
53536069 220.IP SIG
3a8113b3
KM
221Signals received (signals 1-32 coded in bits 0-31),
222.IP UID
223Real user ID.
224.IP SLP
225Amount of time process has been blocked.
226.IP TIM
227Time resident in seconds; times over 127 coded as 127.
228.IP CPU
229Weighted integral of CPU time, for scheduler.
230.IP NI
231Nice level,
232see
be3c220c 233.IR setpriority (2).
3a8113b3
KM
234.IP PID
235The process ID number.
236.IP PPID
237The process ID of parent process.
238.IP ADDR
239If in core, the page frame number of the first page of the `u-area' of
240the process.
241If swapped out, the position in the swap area
242measured in multiples of 512 bytes.
243.IP RSS
244Resident set size \- the number of physical page frames allocated
245to this process.
246.IP SRSS
247RSS at last swap (0 if never swapped).
248.IP SIZE
249Virtual size of process image (data+stack) in multiples of 512 bytes.
250.IP WCHAN
251Wait channel number of a waiting process.
252.IP LINK
253Link pointer in list of runnable processes.
254.IP TEXTP
255If text is pure, pointer to location of text table entry.
3a8113b3
KM
256.PD
257.TP
258.B \-t
259Print table for terminals
260with these headings:
261.IP RAW
262Number of characters in raw input queue.
263.PD 0
264.IP CAN
265Number of characters in canonicalized input queue.
266.IP OUT
267Number of characters in putput queue.
268.IP MODE
269See
270.IR tty (4).
271.IP ADDR
272Physical device address.
273.IP DEL
274Number of delimiters (newlines) in canonicalized input queue.
275.IP COL
276Calculated column position of terminal.
277.IP STATE
278Miscellaneous state variables encoded thus:
279.RS
53536069
JL
280.IP T
281delay timeout in progress
3a8113b3
KM
282.IP W
283waiting for open to complete
284.IP O
285open
53536069
JL
286.IP F
287outq has been flushed during DMA
3a8113b3
KM
288.IP C
289carrier is on
290.IP B
291busy doing output
292.IP A
293process is awaiting output
294.IP X
295open for exclusive use
53536069
JL
296.IP S
297output stopped
3a8113b3
KM
298.IP H
299hangup on close
300.RE
301.IP PGRP
302Process group for which this is controlling terminal.
303.IP DISC
304Line discipline; blank is old tty OTTYDISC or ``new tty'' for NTTYDISC
305or ``net'' for NETLDISC (see
306.IR bk (4)).
307.PD
308.TP
309.B \-u
310print information about a user process;
311the next argument is its address as given
312by
313.IR ps (1).
314The process must be in main memory, or the file used can
315be a core image and the address 0.
0ecf4440
MK
316Only the fields located in the first page cluster can be located
317succesfully if the process is in main memory.
3a8113b3
KM
318.TP
319.B \-f
320Print the open file table with these headings:
321.IP LOC
322The core location of this table entry.
be3c220c
KM
323.IP TYPE
324The type of object the file table entry points to.
3a8113b3
KM
325.PD 0
326.IP FLG
327Miscellaneous state variables encoded thus:
328.RS
329.IP R
330open for reading
331.IP W
332open for writing
be3c220c
KM
333.IP A
334open for appending
53536069
JL
335.IP S
336shared lock present
337.IP X
338exclusive lock present
339.IP I
340signal pgrp when data ready
3a8113b3
KM
341.RE
342.IP CNT
343Number of processes that know this open file.
53536069
JL
344.IP MSG
345Number of messages outstanding for this file.
346.IP DATA
9eecf21c 347The location of the vnode table entry or socket structure for this file.
53536069 348.IP OFFSET
be3c220c 349The file offset (see
53536069 350.IR lseek (2)).
3a8113b3
KM
351.PD
352.PP
353.B \-s
354print information about swap space usage: the number of (1k byte) pages used
355and free is given as well as the number of used pages which belong
356to text images.
357.PP
358.B \-T
359prints the number of used and free slots in the several system tables
360and is useful for checking to see how full system tables have become if the
361system is under heavy load.
3a8113b3
KM
362.SH FILES
363.ta \w'/dev/kmem 'u
364/vmunix namelist
365.br
366/dev/kmem default source of tables
367.SH SEE ALSO
0ecf4440 368iostat(1),
be3c220c 369ps(1),
0ecf4440
MK
370systat(1),
371vmstat(1),
be3c220c 372stat(2),
0ecf4440 373fs(5),
3a8113b3
KM
374.br
375K. Thompson,
376.I UNIX Implementation
377.SH BUGS
378It would be very useful if the system recorded \*(lqmaximum occupancy\*(rq
379on the tables reported by
380.B \-T;
381even more useful if these tables were dynamically allocated.