1 .\" $NetBSD: sa.8,v 1.15 2003/02/14 16:11:36 grant Exp $
3 .\" Copyright (c) 1994 Christopher G. Demetriou
4 .\" All rights reserved.
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\" notice, this list of conditions and the following disclaimer in the
13 .\" documentation and/or other materials provided with the distribution.
14 .\" 3. All advertising materials mentioning features or use of this software
15 .\" must display the following acknowledgement:
16 .\" This product includes software developed for the
17 .\" NetBSD Project. See http://www.NetBSD.org/ for
18 .\" information about NetBSD.
19 .\" 4. The name of the author may not be used to endorse or promote products
20 .\" derived from this software without specific prior written permission.
22 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
23 .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
24 .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
25 .\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
26 .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
27 .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
31 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 .\" <<Id: LICENSE,v 1.2 2000/06/14 15:57:33 cgd Exp>>
40 .Nd print system accounting statistics
43 .Op Fl abcdDfijkKlmnqrstu
49 utility reports on, cleans up,
50 and generally maintains system
54 is able to condense the information in
56 into the summary files
57 .Pa /var/account/savacct
59 .Pa /var/account/usracct ,
60 which contain system statistics according
61 to command name and login id, respectively.
62 This condensation is desirable because on a
65 can grow by hundreds of blocks per day.
66 The summary files are normally read before
67 the accounting file, so that reports include
68 all available information.
70 If file names are supplied, they are read instead of
71 .Pa /var/account/acct .
72 After each file is read, if the summary
73 files are being updated, an updated summary will
74 be saved to disk. Only one report is printed,
75 after the last file is processed.
77 The labels used in the output indicate the following, except
78 where otherwise specified by individual options:
81 Average number of I/O operations per execution
83 Sum of user and system time, in minutes
88 CPU-time averaged core usage, in 1k units
90 CPU storage integral, in 1k-core seconds
94 System time, in minutes
96 Total number of I/O operations
106 List all command names, including those containing unprintable
107 characters and those used only once. By default,
109 places all names containing unprintable characters and
110 those used only once under the name ``***other''.
112 If printing command statistics, sort output by the sum of user and system
113 time divided by number of calls.
115 In addition to the number of calls and the user, system and real times
116 for each command, print their percentage of the total over all commands.
118 If printing command statistics, sort by the average number of disk
119 I/O operations. If printing user statistics, print the average number of
120 disk I/O operations per user.
122 If printing command statistics, sort and print by the total number
123 of disk I/O operations.
125 Force no interactive threshold comparison with the
129 Do not read in the summary files.
131 Instead of the total minutes per category, give seconds per call.
133 If printing command statistics, sort by the CPU-time average memory
134 usage. If printing user statistics, print the CPU-time average
137 If printing command statistics, print and sort by the CPU-storage integral.
139 Separate system and user time; normally they are combined.
141 Print per-user statistics rather than per-command statistics.
143 Sort by number of calls.
145 Create no output other than error messages.
147 Reverse order of sort.
149 Truncate the accounting files when done and merge their data
150 into the summary files.
152 For each command, report the ratio of real time to the sum
153 of user and system CPU times.
154 If the CPU time is too small to report, ``*ignore*'' appears in
157 Superseding all other flags, for each entry
158 in the accounting file, print the user ID, total seconds of CPU usage,
159 total memory usage, number of I/O operations performed, and
162 For each command used
164 times or fewer, print the command name and await a reply
165 from the terminal. If the reply begins with ``y'', add
166 the command to the category ``**junk**''. This flag is
167 used to strip garbage from the report.
170 By default, per-command statistics will be printed. The number of
171 calls, the total elapsed time in minutes, total CPU and user time
172 in minutes, average number of I/O operations, and CPU-time
173 averaged core usage will be printed. If the
175 option is specified, per-user statistics will be printed, including
176 the user name, the number of commands invoked, total CPU time used
177 (in minutes), total number of I/O operations, and CPU storage integral
178 for each user. If the
180 option is specified, the uid, user and system time (in seconds),
181 CPU storage integral, I/O usage, and command name will be printed
182 for each entry in the accounting data file.
186 flag is specified, all flags other than
190 flag is specified, only the
202 utility exits 0 on success, and \*[Gt]0 if an error occurs.
204 .Bl -tag -width /var/account/usracct -compact
205 .It Pa /var/account/acct
206 raw accounting data file
207 .It Pa /var/account/savacct
208 per-command accounting summary database
209 .It Pa /var/account/usracct
210 per-user accounting summary database
221 from the specification provided by various systems' manual pages.
222 Its date of origin is unknown to the author.
224 .An Chris G. Demetriou
225 .Aq cgd@postgres.berkeley.edu .
227 The number of options to this program is absurd, especially considering
228 that there's not much logic behind their lettering.
230 The field labels should be more consistent.
233 VM system does not record the CPU storage integral.
235 While the behavior of the options in this version of
237 was modeled after the original version, there are some intentional
238 differences and undoubtedly some unintentional ones as well. In
241 option has been added, and the
243 option now understands more options than it used to.
245 The formats of the summary files created by this version of
247 are very different than the those used by the original version.
248 This is not considered a problem, however, because the accounting record
249 format has changed as well (since user ids are now 32 bits).