Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ acct(5) — AIX PS/2 1.2.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

acct

utmp, wtmp, .ilog

acctcom

acct

acctcms

acctcon

acctmerg

acctprc

diskusg

runacct



ACCT(5,F)                   AIX Technical Reference                   ACCT(5,F)



-------------------------------------------------------------------------------
acct



PURPOSE

Provides the accounting file format for each process.

SYNOPSIS

#include <sys/acct.h>

DESCRIPTION

The accounting files provide a means to monitor the use of the system.  These
files also serve as a method for billing each process for processor usage,
materials, and services.  The acct system call produces accounting files.  The
<sys/acct.h> file defines the records in these files.  The content of the
records are:

     /* Accounting structures */
     typedef ushort comp_t;     /* floating point */
                /* 13-bit fraction, 3-bit exponent */

     struct acct
     {
          char  ac_flag;     /* Accounting flag */
          char  ac_stat;     /* Exit status */
          ushort  ac_uid;    /* Accounting user-ID */
          ushort  ac_gid;    /* Accounting group-ID */
          dev_t  ac_tty;     /* control typewriter */
          time_t  ac_btime;  /* Beginning time */
          comp_t  ac_utime;  /* accounting user time in clock ticks */
          comp_t  ac_stime;  /* accounting system time in clock ticks */
          comp_t  ac_etime;  /* accounting elapsed time in clock ticks */
          comp_t  ac_mem;    /* memory usage */
          comp_t  ac_io;     /* chars transferred */
          comp_t  ac_rw;     /* blocks read or written */
          char  ac_comm[8];  /* command name */
     };

     #define AFORK  01            /* has executed fork, but no exec */
     #define ASU    02            /* used superuser authority */
     #define ACCTF  0300          /* record type: 00 = acct */

The fields are as follows:

ac_comm   This field contains the command name.  A child process, created by a
          fork system call, receives this information from the parent process.
          An exec system call resets this field.




Processed November 7, 1990         ACCT(5,F)                                  1





ACCT(5,F)                   AIX Technical Reference                   ACCT(5,F)



ac_flag   This field indicates whether the process used superuser authority, or
          whether it was created using a fork command but not yet followed by
          an exec system call.  The fork command turns on the AFORK flag in
          this field and the exec system call turns off the AFORK flag.

ac_mem    This field contains memory usage.  For each clock tick, the system
          updates this field with the current process size and charges usage
          time to the process.  This is computed as ((data size) + (text size))
          / (number of in-memory processes using text)

The following structure (not part of acct.h) represents the total accounting
format used by the various accounting commands:

  /* Float arrays below contain prime time and non-prime time
     components */

     struct tacct {
       uid_t  ta_uid;            /* user-ID */
       char   ta_name[8];        /* login name */
       float  ta_cpu[2];         /* cum. CPU time, p/np (mins) */
       float  ta_kcore[2];       /* cum. kcore-mins, p/np */
       float  ta_io[2];          /* cum. chars xferred (512s) */
       float  ta_rw[2];          /* cum. blocks read/written */
       float  ta_con[2];         /* cum. connect time, p/np, mins */
       float  ta_du;             /* cum. disk usage */
       long   ta_qsys;           /* queuing sys charges (pgs) */
       float  ta_fee;            /* fee for special services */
       long   ta_pc;             /* count of processes */
       unsigned short  ta_sc;    /* count of login sessions */
       unsigned short  ta_dc;    /* count of disk samples */
     };

FILE

/usr/include/sys/acct.h

RELATED INFORMATION

In this book:  "acct" and "utmp, wtmp, .ilog."

The acctcom command in AIX Operating System Commands Reference.

The acct, acctcms, acctcon, acctmerg, acctprc, diskusg, and runacct procedures
in AIX Operating System Commands Reference.











Processed November 7, 1990         ACCT(5,F)                                  2



Typewritten Software • bear@typewritten.org • Edmonds, WA 98026