acct (5) - Linux Manuals
acct: process accounting file
Command to display acct
manual in Linux: $ man 5 acct
NAME
acct - process accounting file
SYNOPSIS
#include <sys/acct.h>
DESCRIPTION
If the kernel is built with the process accounting option enabled
(
CONFIG_BSD_PROCESS_ACCT),
then calling
acct(2)
starts process accounting, for example:
acct("/var/log/pacct");
When process accounting is enabled, the kernel writes a record
to the accounting file as each process on the system terminates.
This record contains information about the terminated process,
and is defined in
<sys/acct.h>
as follows:
#define ACCT_COMM 16
typedef u_int16_t comp_t;
struct acct {
char ac_flag; /* Accounting flags */
u_int16_t ac_uid; /* Accounting user ID */
u_int16_t ac_gid; /* Accounting group ID */
u_int16_t ac_tty; /* Controlling terminal */
u_int32_t ac_btime; /* Process creation time
(seconds since the Epoch) */
comp_t ac_utime; /* User CPU time */
comp_t ac_stime; /* System CPU time */
comp_t ac_etime; /* Elapsed time */
comp_t ac_mem; /* Average memory usage (kB) */
comp_t ac_io; /* Characters transferred (unused) */
comp_t ac_rw; /* Blocks read or written (unused) */
comp_t ac_minflt; /* Minor page faults */
comp_t ac_majflt; /* Major page faults */
comp_t ac_swaps; /* Number of swaps (unused) */
u_int32_t ac_exitcode; /* Process termination status
(see wait(2)) */
char ac_comm[ACCT_COMM+1];
/* Command name (basename of last