sadc(1M) sadc(1M)NAME sadc, sa1, sa2 - report system activity SYNOPSIS sadc [t n] [file] sa1 [t n] sa2 [-a] [-A] [-b] [-c] [-etime] [-isec] [-m] [-q] [-stime] [-u] [-v] [-w] [-y] ARGUMENTS -a Reports use of file access system routines: iget/s, namei/s, dirblk/s. -A Reports all data. This option is equivalent to the -u, -q, -b, -w, -c, -a, -y, -v, and -m options. -b Reports buffer activity: bread/s, bwrit/s: transfers per second of data between system buffers and disk or other block devices. lread/s, lwrit/s: accesses of system buffers. %rcache, %wcache: cache hit ratios; for example, 1-bread/lread. pread/s, pwrit/s: transfers via raw (physical) device mechanism. -c Reports system calls. scall/s: system calls of all types. sread/s, swrit/s, fork/s, exec/s: specific system calls. rchar/s, wchar/s: characters transferred by read and write system calls. -etime Specifies the ending time of the report. The format for time is hh[:mm[:ss]]. file Specifies the file into which binary data is placed. -isec Selects records at sec second intervals. If this option is not specified, all intervals found in the data file are reported. -m Reports message and semaphore activities. msg/s, sema/s: primitives per second. -q Reports average queue length while occupied and percentage of time occupied: runq-sz, %runocc: run queue of processes in memory and runnable. January 1992 1
sadc(1M) sadc(1M)swpq-sz, %swpocc-: swap queue of processes swapped out but ready to run. -stime Specifies the starting time of the report. The format for time is hh[:mm[:ss]]. t n Specifies the number of times (t) and amount of seconds (n) system data is sampled. When using the sadc command, if t and n are omitted, a special record is written. When using the sa1 shell procedure, if t and n are omitted, the record is written only once. -u Reports CPU utilization (the default): %usr, %sys, %wio, %idle: portion of time running in user mode, running in system mode, idle with some process waiting for block I/O, and otherwise idle. -v Reports status of process, inode, file, file record lock, and file record header tables. proc-sz, inod-sz, file-sz, lock-sz, fhdr-sz: entries/size for each table, evaluated once at sampling point; proc-ov, inod-ov, file-ov: overflows occurring between sampling points. -w Reports system swapping and switching activity: swpin/s, swpot/s, bswin/s, bswot/s: bswin/s, bswot/s: number of transfers and number of 512 byte units transferred for swapins (including initial loading of some programs) and swapouts; pswch/s: process switches. -y Reports TTY device activity: rawch/s, canch/s, outch/s: input character rate, input character rate processed by canon, and output character rate. rcvin/s, xmtin/s, mdmin/s: receive, transmit, and modem interrupt rates. DESCRIPTION System activity data can be accessed at the special request of a user (see sar(1)) or automatically, on a routine basis as described here. The operating system contains a number of counters that are incremented as various system actions occur. These include counters for CPU utilization, buffer usage, disk and tape I/O activity, TTY device activity, switching and system-call, file-access, queue activity, and counters for interprocess communications. sadc and the shell procedures sa1 and sa2 are used to sample, save, and process this data. 2 January 1992
sadc(1M) sadc(1M)The sadc command, the data collector, samples system data n times every t seconds and writes in binary format to file or to standard output. This facility is used at system boot time to mark the time at which the counters restart from zero. The /etc/rc entry su adm -c "/usr/lib/sa/sadc /usr/adm/sa/da`date +%d`" writes the special record to the daily data file to mark the system restart. sa1, which is a shell script and a variant of sadc, is used to collect and store data in binary file /usr/adm/sa/sadd where dd is the current day. The arguments t and n cause records to be written n times at an interval of t seconds, or only once, if omitted. The entries in crontab (see cron(1M)) 0 * * * 0,6 /usr/lib/sa/sa1 0 8-17 * * 1-5 /usr/lib/sa/sa1 1200 3 0 18-7 * * 1-5 /usr/lib/sa/sa1 will produce records every 20 minutes during working hours and hourly otherwise. sa2, which is a variant of sar(1), writes a daily report in the file /usr/adm/sa/sardd. The crontab entry 5 18 * * 1-5 /usr/lib/sa/sa2 -s 8:00 -e 18:01 -i 3600 -A will compile a single report at 6:05 P.M. of each working day giving an hourly summary of all activity in the interval 8:00 A.M. to 6:01 P.M. The structure of the binary daily data file is struct sa { struct sysinfo si; /* defined in /usr/include/sys/sysinfo.h */ int szinode; /* current size of inode table */ int szfile; /* current size of file table */ int sztext; /* current size of text table */ int szproc; /* current size of proc table */ int mszinode; /* maximum size of inode table */ int mszfile; /* maximum size of file table */ int msztext; /* maximum size of text table */ int mszproc; /* maximum size of proc table */ long inodeovf; /* cumulative overflows of inode table since boot */ long fileovf; /* cumulative overflows of file table since boot */ long textovf; /* cumulative overflows of January 1992 3
sadc(1M) sadc(1M)text table since boot */ long procovf; /* cumulative overflows of proc table since boot */ time_t ts; /* time stamp */ long devio[NDEVS][4]; /* device unit information */ #define IO_OPS 0 /* number of I/O requests since boot */ #define IO_BCNT 1 /* number of blocks transferred since boot */ #define IO_ACT 2 /* cumulative time in ticks when drive is active */ #define IO_RESP 3 /* cumulative I/O response time in ticks since boot */ }; FILES /usr/lib/sa/sadc Executable file /usr/lib/sa/sa1 Executable file /usr/lib/sa/sa2 Executable file /usr/adm/sa/sadd Daily data file /usr/adm/sa/sardd Daily report file /tmp/sa.adrfl Address file SEE ALSO cron(1M) sag(1G), sar(1), timex(1) in A/UX Command Reference ``System Activity Package,'' in A/UX Local System Administration 4 January 1992