fix silly indirect-through-zero bug
[unix-history] / usr / src / usr.sbin / sa / sa.8
CommitLineData
64c19a68 1.\" Copyright (c) 1980 Regents of the University of California.
10a25160 2.\" All rights reserved.
64c19a68 3.\"
10a25160
CL
4.\" %sccs.include.proprietary.roff%
5.\"
6.\" @(#)sa.8 6.4 (Berkeley) %G%
64c19a68 7.\"
ecd14fb4 8.TH SA 8 ""
64c19a68 9.UC 4
31c2d36c 10.SH NAME
64c19a68
KM
11sa, accton \- system accounting
12.SH SYNOPSIS
bf0f0609 13.B sa
64c19a68
KM
14[
15.B \-abcdDfijkKlnrstuv
ecd14fb4
KM
16] [
17.B \-S
18savacctfile ] [
19.B \-U
20usracctfile ] [ file ]
64c19a68 21.PP
bf0f0609 22.B accton
64c19a68
KM
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
9e110635 33reports on, cleans up, and generally maintains accounting files.
64c19a68
KM
34.PP
35.I Sa
9e110635 36is able to condense the information in
bf0f0609 37.I /var/account/acct
64c19a68 38into a summary file
bf0f0609 39.I /var/account/savacct
64c19a68 40which contains a count of the
9e110635 41number of times each command was called and the time resources consumed.
64c19a68 42This condensation is desirable because on a large system
bf0f0609 43.I /var/account/acct
64c19a68
KM
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
9e110635 48If a file name is given as the last argument, that file will be treated
64c19a68 49as the accounting file;
bf0f0609 50.I /var/account/acct
64c19a68
KM
51is the default.
52.PP
9e110635 53Output fields are labeled: \*(lqcpu\*(rq for the sum of user+system time
64c19a68
KM
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.
9e110635 57With options fields labeled \*(lqtio\*(rq for total i/o operations,
64c19a68 58\*(lqk*sec\*(rq for cpu storage integral (kilo-core seconds), \*(lqu\*(rq and \*(lqs\*(rq
9e110635 59for user and system cpu time alone (both in minutes) will sometimes appear.
64c19a68
KM
60.PP
61There are near a googol of options:
62.PP
63.TP
64a
ecd14fb4
KM
65Print all command names, even those containing unprintable characters
66and those used only once. By default, those are placed under the
67name `***other.'
64c19a68
KM
68.TP
69b
9e110635 70Sort output by sum of user and system time divided by number of calls.
64c19a68
KM
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
9e110635 90Instead of total minutes time for each category, give seconds per call.
64c19a68
KM
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
bf0f0609 112.I /var/account/savacct
64c19a68
KM
113when done.
114.TP
115t
9e110635 116For each command report ratio of real time to the sum of user and system times.
64c19a68
KM
117.TP
118u
9e110635 119Superseding all other flags, print for each command in the accounting file the
64c19a68
KM
120user ID and command name.
121.TP
122v
123Followed by a number
124.I n,
9e110635 125types the name of each command used
64c19a68
KM
126.I n
127times or fewer.
9e110635
KM
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.
ecd14fb4
KM
130.TP
131S
132The following filename is used as the command summary file instead of
bf0f0609 133.I /var/account/savacct.
ecd14fb4
KM
134.TP
135U
136The following filename is used instead of
bf0f0609 137.I /var/account/usracct
ecd14fb4 138to accumulate the per-user statistics printed by the \-m option.
64c19a68
KM
139.dt
140.SH FILES
141.ta 2i
bf0f0609 142/var/account/acct raw accounting
64c19a68 143.br
bf0f0609 144/var/account/savacct summary
64c19a68 145.br
bf0f0609 146/var/account/usracct per-user summary
64c19a68
KM
147.SH "SEE ALSO"
148ac(8), acct(2)
149.SH BUGS
150The number of options to this program is absurd.