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