[comp.unix.i386] disk logging and sar

mike@cimcor.MN.ORG (Michael Grenier) (01/07/90)

A stupid question for you UNIX driver hackers :

First, I'm running Micrport UNIX System V.3

I'd like to enable the 'sar -d' command for some block disk
drivers I'm writing. How do I do this?
Right now, sar -d doesn't give me anything.

Also, in /usr/include/conf.h, it talks about a function in the
driver relating to d_print() (like d_open, d_strategy, etc.). What
is that?

Thanks
  -Mike Grenier
   mike@cimcor.mn.org
    uunet!rosevax!cimcor!mike

jje@virtech.uucp (Jeremy J. Epstein) (01/08/90)

In article <9@cimcor.MN.ORG>, mike@cimcor.MN.ORG (Michael Grenier) writes:
> I'd like to enable the 'sar -d' command for some block disk
> drivers I'm writing. How do I do this?
> Right now, sar -d doesn't give me anything.

Before you can use sar to show data, you must have collected the
data using sadc(1M).  The sadc(1M) man page gives some suggested
cron entries to generate the data at 20 minute intervals (too long
when debugging, but OK for normal monitoring).  Make sure that you
put the commands in the crontab file for 'sys', and set the permissions
for /usr/adm/sa appropriately.  Also, you probably want to initialize
sadc at boot time so you get a zero-point.

The other key thing once you're gathering data is updating the right
data structures (in your disk driver)...does anyone recall what
structures sadc reads to accumulate the statistics?

Another tool worth looking at is sadp, which can generate some nify
histograms and graphs of cylinder usage....
-- 
Jeremy Epstein
TRW Systems Division
2750 Prosperity Avenue
FV10/5010

cpcahil@virtech.uucp (Conor P. Cahill) (01/09/90)

In article <1990Jan8.145201.4251@virtech.uucp>, jje@virtech.uucp (Jeremy J. Epstein) writes:
> In article <9@cimcor.MN.ORG>, mike@cimcor.MN.ORG (Michael Grenier) writes:
> > I'd like to enable the 'sar -d' command for some block disk
> > drivers I'm writing. How do I do this?
> > Right now, sar -d doesn't give me anything.
> 
> Before you can use sar to show data, you must have collected the
> data using sadc(1M).  The sadc(1M) man page gives some suggested
> cron entries to generate the data at 20 minute intervals (too long
> when debugging, but OK for normal monitoring).  Make sure that you
> put the commands in the crontab file for 'sys', and set the permissions
> for /usr/adm/sa appropriately.  Also, you probably want to initialize
> sadc at boot time so you get a zero-point.

Not being one to be nit-picky, but sar can be used without first having
run sadc.  If you run sar in interactive mode it will automatically run
the sadc as a child process and capture the output.  The following
command will run sar for a period of 5 seconds making a sample every second:

	sar -d 1 5

For example:

	virtech virtech 3.2 2 i386    01/08/90

	18:28:03  device   %busy   avque   r+w/s  blks/s  avwait  avserv

	18:28:04
	18:28:05
	18:28:06
	18:28:07
	18:28:08
	Average 

Note that for the disk statistics no data is output.  I think the problem
is caused by the drivers not updating the appropriate kernel structures.

-- 
+-----------------------------------------------------------------------+
| Conor P. Cahill     uunet!virtech!cpcahil      	703-430-9247	!
| Virtual Technologies Inc.,    P. O. Box 876,   Sterling, VA 22170     |
+-----------------------------------------------------------------------+

randy@chinet.chi.il.us (Randy Suess) (01/09/90)

In article <1990Jan8.145201.4251@virtech.uucp> jje@virtech.uucp (Jeremy J. Epstein) writes:
]Another tool worth looking at is sadp, which can generate some nify
]histograms and graphs of cylinder usage....

	As I posted in an earlier article, sadp does not seem to
	work under i386. (or AT&T 3.2.1) (will not take a -d drive parameter) 
	I would like to hear from anyone that *has* got it to work.
-randy

-- 
Randy Suess
randy@chinet.chi.il.us