Summary: Help with acct(5)

From: eric@cc.uq.oz.au
Date: Tue Oct 16 1990 - 14:45:47 CDT


Hi,

[This is a repost. I mailed tha original summary ages ago but never
saw it show up on the list.]

Thanks to every who replied to my troubles with acct(5)!

Here's the original post#
#In acct(5) a type called comp_t is defined and used in the following fields
#in the struct acct {
# comp_t ac_utime; /* Accounting user time */
# comp_t ac_stime; /* Accounting system time */
# comp_t ac_etime; /* Accounting elapsed time */
# comp_t ac_io; /* chars transferred */
# comp_t ac_rw; /* blocks read or written */
# [...] };
#
#However all the man entry has to say about comp_t is "these use a comp_t type
#which is a 3 bits base 8 exponent, 13 bit fraction ``floating point'' number."
#
#That's great, except it neglects to say what time units comp_t is measuring
#in!? [....]

It turns out the comp_t is measured in units of "1/HZ, or 1/60 second (yes, even
with 50 HZ mains power), in 4.1.", explained by both Guy Harris and Pete
Cottrell. (Though under 4.0.3 it's the same as 4.3BSD, 1/64 second as Tim
Pointing notes.)

Pete Cottrell writes:
>The units are 1/60 of a second. This is defined in sys/param.h. kern_acct.c
>fills the acct record fields with the appropriate values of the process'
>rusage structure after applying scale60() to them, e.g.
>
> ap->ac_utime = compress((long)scale60(&ru->ru_utime));
>
>This unit value is slightly different from BSD systems, which 1/64 of
>a second units.

# Also, I couldn't find out the definitions of ac_etime, ac_io and ac_rw?
# Are they documented in some detail anywhere.

Guy Harris explains:
>Not outside the source code. "ac_io" is, as the comment indicates, the
>number of characters tranferred by "read" and "write" I.e., if you do
>
> write(fd, "Hello\n", 6);
>
>"ac_io" is incremented by 6. (It turns out "ac_io" only counts
>"read"/"readv" and "write"/"writev"; it doesn't include "send",
>"sendto", "sendmsg", "recv", "recvfrom", or "recvmsg".)
>
>"ac_rw" is what used to be "ac_io" prior to 4.1, namely the number of
>disk blocks read or written (which includes NFS I/O).
>
>"ac_etime" is the number of time units of wall-clock time between the
>time at which the process was created and the time at which the process
>was terminated.
 
Melissa Metz pointed out that the System & Network Admin binder (section 8.7)
does have some info about what each of the fields in the struct means. Its
fairly general but definitely better than 3 word comments :-)

Thanks again to
        Guy Harris
        Melissa Metz
        Pete Cottrell
        & Tim Pointing
for your help,

Eric.
-------------------------------------+---------------------------------------
Eric Halil |Internet/CSnet: eric@cc.uq.oz.au
Prentice Computer Centre |Bitnet: eric%cc.uq.oz.au@uunet.uu.net
University of Queensland 4072 |UUCP: uunet!munnari!cc.uq.oz!eric
AUSTRALIA -- Phone: +61 7 377 3022 |JANET: eric%cc.uq.oz.au@uk.ac.ukc



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:05:58 CDT