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