system accounting statistics
utility reports on, cleans up, and generally
maintains system accounting files. See
for details on
enabling system accounting.
is able to condense the information in
into the summary files
, which contain system
statistics according to command name and login ID, respectively. This
condensation is desirable because on a large system,
can grow by hundreds of blocks
per day. The summary files are normally read before the accounting file, so
that reports include all available information.
If file names are supplied, they are read instead of
. After each file is read, if
the summary files are being updated, an updated summary will be saved to disk.
Only one report is printed, after the last file is processed.
The labels used in the output indicate the following, except where otherwise
specified by individual options:
- Average number of I/O operations per execution.
- Sum of user and system time, in minutes.
- Same as
- CPU time averaged core usage, in 1k units.
- CPU storage integral, in 1k-core seconds.
- Real time, in minutes.
- System time, in minutes.
- Total number of I/O operations.
- User time, in minutes.
The options are as follows:
- List all command names, including those containing
unprintable characters and those used only once. By default,
sa places all names containing unprintable
characters and those used only once under the name
- If printing command statistics, sort output by the sum of
user and system time divided by number of calls.
- In addition to the number of calls and the user, system and
real times for each command, print their percentage of the total over all
- If printing command statistics, sort and print by the total
number of disk I/O operations.
- If printing command statistics, sort by the average number
of disk I/O operations. If printing user statistics, print the average
number of disk I/O operations per user.
- Force no interactive threshold comparison with the
- Do not read in the summary files.
- Instead of the total minutes per category, give seconds per
- If printing command statistics, print and sort by the
- If printing command statistics, sort by the CPU time
average memory usage. If printing user statistics, print the CPU time
average memory usage.
- Separate system and user time; normally they are
- Print per-user statistics rather than per-command
statistics, including the user name, the number of commands invoked, total
CPU time used (in minutes), total number of I/O operations, and CPU
storage integral for each user. If this option is specified, only the
-q, and -s flags
- Sort by number of calls.
- Create no output other than error messages.
- Reverse order of sort.
- Truncate the accounting files when done and merge their
data into the summary files.
- For each command, report the ratio of real time to the sum
of user and system CPU times. If the CPU time is too small to report,
“*ignore*” appears in this field.
- Superseding all other flags (except
-q), for each entry in the accounting file
print the user ID, total seconds of CPU usage, total memory usage, number
of I/O operations performed, and command name.
- For each command used
cutoff times or fewer, print the command
name and await a reply from the terminal. If the reply begins with
“y”, add the command to the category
“**junk**”. This flag is used to strip garbage from the
By default, per-command statistics are printed and show the number of calls, the
total elapsed time in minutes, total CPU and user time in minutes, average
number of I/O operations, and CPU time averaged core usage. Children which
have not yet called execve(2)
have ‘*’ appended to their command names.
- raw accounting data file
- per-command accounting summary database
- per-user accounting summary database
utility exits 0 on success,
and >0 if an error occurs.
was written for NetBSD
from the specification provided by various systems' manual pages.
Its date of origin is unknown to the author.
Chris G. Demetriou
While the behavior of the options in this version of
was modeled after the original version, there
are some intentional differences and undoubtedly some unintentional ones as
well. In particular, the -q
option has been
added, and the -m
option now understands more
options than it used to.
The formats of the summary files created by this version of
are very different than those used by the
original version. This is not considered a problem, however, because the
accounting record format has changed as well (since user IDs are now 32 bits).
The number of options to this program is absurd, especially considering that
there's not much logic behind their lettering.
The field labels should be more consistent.
OpenBSD's VM system does not record the CPU storage integral.