Sun OS accounting file format
Diomidis Spinellis
diomidis at ecrcvax.UUCP
Fri Jun 9 05:37:43 AEST 1989
In article <1171 at shell.shell.com> dinah at shell.UUCP (Dinah Anderson) writes:
>We are trying to write our own program to create accouting reports.
>According to the man page, the data ytpe for some of the fields is:
>
> [ ... gives the manual description of comp_t ... ]
>
>Can someone help me understand how to interpret this field?
Comp_t is represented as a three bit base 8 exponent followed by a 13 bit
mantissa. No normalisation takes place. The place of the bits in the
u_short is as follows:
+------+--------------------------+
| exp | mantissa |
+------+--------------------------+
15 13 12 0
Thus the value is: mantissa * 8 ** exponent and you can calculate it by:
(long)(val & 017777) << ((val >> 13) * 3)
>Also does anyone know what the units are for the fields :
>
> comp_t ac_utime;
This is the total amount of time the process spent executing in user
mode.
> comp_t ac_stime;
The total amount of time spent in the system executing on behalf of
the process.
> comp_t ac_etime;
This is the time difference between the process creation (by fork) and
the process termination (by a signal or exit). In other words the time
the process has existed.
The times are expressed in seconds / AHZ. You have to divide by AHZ
(defined in sys/acct.h) in order to get seconds.
>The man page does not say.
True. You could get some info from getrusage(2). With the abudance of
binary UN*X distributions the system source is no longer a viable
substitute for decent documentation. It is becoming time for the
vendors to get their act together and produce more complete
documentation.
>Dinah Anderson
Diomidis
--
Diomidis Spinellis European Computer-Industry Research Centre (ECRC)
Arabellastrasse 17, D-8000 Muenchen 81, West Germany +49 (89) 92699199
USA: diomidis%ecrcvax.uucp at pyramid.pyramid.com ...!pyramid!ecrcvax!diomidis
Europe: diomidis at ecrcvax.uucp ...!unido!ecrcvax!diomidis
More information about the Comp.unix.questions
mailing list