fix silly indirect-through-zero bug
[unix-history] / usr / src / usr.sbin / sa / sa.8
... / ...
CommitLineData
1.\" Copyright (c) 1980 Regents of the University of California.
2.\" All rights reserved.
3.\"
4.\" %sccs.include.proprietary.roff%
5.\"
6.\" @(#)sa.8 6.4 (Berkeley) %G%
7.\"
8.TH SA 8 ""
9.UC 4
10.SH NAME
11sa, accton \- system accounting
12.SH SYNOPSIS
13.B sa
14[
15.B \-abcdDfijkKlnrstuv
16] [
17.B \-S
18savacctfile ] [
19.B \-U
20usracctfile ] [ file ]
21.PP
22.B accton
23[ file ]
24.SH DESCRIPTION
25With an argument naming an existing
26.I file,
27.I accton
28causes system accounting information for
29every process executed to be placed at the end of the file.
30If no argument is given, accounting is turned off.
31.PP
32.I Sa
33reports on, cleans up, and generally maintains accounting files.
34.PP
35.I Sa
36is able to condense the information in
37.I /var/account/acct
38into a summary file
39.I /var/account/savacct
40which contains a count of the
41number of times each command was called and the time resources consumed.
42This condensation is desirable because on a large system
43.I /var/account/acct
44can grow by 100 blocks per day.
45The summary file is normally read before the accounting file,
46so the reports include all available information.
47.PP
48If a file name is given as the last argument, that file will be treated
49as the accounting file;
50.I /var/account/acct
51is the default.
52.PP
53Output fields are labeled: \*(lqcpu\*(rq for the sum of user+system time
54(in minutes), \*(lqre\*(rq for real time (also in minutes),
55\*(lqk\*(rq for cpu-time averaged core usage (in 1k units),
56\*(lqavio\*(rq for average number of i/o operations per execution.
57With options fields labeled \*(lqtio\*(rq for total i/o operations,
58\*(lqk*sec\*(rq for cpu storage integral (kilo-core seconds), \*(lqu\*(rq and \*(lqs\*(rq
59for user and system cpu time alone (both in minutes) will sometimes appear.
60.PP
61There are near a googol of options:
62.PP
63.TP
64a
65Print all command names, even those containing unprintable characters
66and those used only once. By default, those are placed under the
67name `***other.'
68.TP
69b
70Sort output by sum of user and system time divided by number of calls.
71Default sort is by sum of user and system times.
72.TP
73c
74Besides total user, system, and real time for each command print percentage
75of total time over all commands.
76.TP
77d
78Sort by average number of disk i/o operations.
79.TP
80D
81Print and sort by total number of disk i/o operations.
82.TP
83f
84Force no interactive threshold compression with \-v flag.
85.TP
86i
87Don't read in summary file.
88.TP
89j
90Instead of total minutes time for each category, give seconds per call.
91.TP
92k
93Sort by cpu-time average memory usage.
94.TP
95K
96Print and sort by cpu-storage integral.
97.TP
98l
99Separate system and user time; normally they are combined.
100.TP
101m
102Print number of processes and number of CPU minutes for each user.
103.TP
104n
105Sort by number of calls.
106.TP
107r
108Reverse order of sort.
109.TP
110s
111Merge accounting file into summary file
112.I /var/account/savacct
113when done.
114.TP
115t
116For each command report ratio of real time to the sum of user and system times.
117.TP
118u
119Superseding all other flags, print for each command in the accounting file the
120user ID and command name.
121.TP
122v
123Followed by a number
124.I n,
125types the name of each command used
126.I n
127times or fewer.
128Await a reply from the terminal; if it begins with `y', add the command to
129the category `**junk**.' This is used to strip out garbage.
130.TP
131S
132The following filename is used as the command summary file instead of
133.I /var/account/savacct.
134.TP
135U
136The following filename is used instead of
137.I /var/account/usracct
138to accumulate the per-user statistics printed by the \-m option.
139.dt
140.SH FILES
141.ta 2i
142/var/account/acct raw accounting
143.br
144/var/account/savacct summary
145.br
146/var/account/usracct per-user summary
147.SH "SEE ALSO"
148ac(8), acct(2)
149.SH BUGS
150The number of options to this program is absurd.