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