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