System V.2 sar, sadc, sysinfo

Ron Flax ron at vsedev.VSE.COM
Wed Nov 19 13:35:58 AEST 1986


I am in the process of writing a screen oriented realtime version of the
System V sar(1), System Activity Reporting, utility.  I have been
successful in getting most of the necessary info out of the sysinfo
struct by reading kmem.  But I am stumped on where to find the disk
i/o stuff.

The program that does the work for sar(1) is /usr/lib/sa/sadc, doing a
strings on it reveals that several other kernel variables are read,
wnstat and wn_cnt under Microport, fp_stat and hdcnt on an Altos 3068,
hdstat and hd_cnt on a 3b2.  A look at the sar(1m) man page, near
the end says that the disk info is stored in:

struct sa {
	. . .
	long devio[NDEVS][4];
#define IO_OPS	0
#define IO_BCNT 1
#define IO_ACT  2
#define IO_RESP 3
	. . .
};

and so on...

Anyhow the $1,000,000,000.00 question is where (and how??) are they 
getting the info to fill 'devio'?  Anyone with V.2 source have time to look
at this code fragment in sadc.c and give me some insight?  Please?

Thanks!

--
ron at vsedev.VSE.COM	(Ron Flax)
UUCP:	..!seismo!vsedev!ron
INET:	vsedev.VSE.COM!ron at seismo.CSS.GOV



More information about the Comp.unix.wizards mailing list