June 2025 | ||||||
Mo | Tu | We | Th | Fr | Sa | Su |
26 | 27 | 28 | 29 | 30 | 31 | 1 |
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 1 | 2 | 3 | 4 | 5 | 6 |
001: /* 002: * BSD Process Accounting for Linux - Definitions 003: * 004: * Author: Marco van Wieringen (mvw@planets.elm.net) 005: * 006: * This header file contains the definitions needed to implement 007: * BSD-style process accounting. The kernel accounting code and all 008: * user-level programs that try to do something useful with the 009: * process accounting log must include this file. 010: * 011: * Copyright (C) 1995 - 1997 Marco van Wieringen - ELM Consultancy B.V. 012: * 013: */ 014: 015: #ifndef _LINUX_ACCT_H 016: #define _LINUX_ACCT_H 017: 018: #include <linux/types.h> 019: 020: #include <asm/param.h> 021: #include <asm/byteorder.h> 022: 023: /* 024: * comp_t is a 16-bit "floating" point number with a 3-bit base 8 025: * exponent and a 13-bit fraction. 026: * comp2_t is 24-bit with 5-bit base 2 exponent and 20 bit fraction 027: * (leading 1 not stored). 028: * See linux/kernel/acct.c for the specific encoding systems used. 029: */ 030: 031: typedef __u16 comp_t; 032: typedef __u32 comp2_t; 033: 034: /* 035: * accounting file record 036: * 037: * This structure contains all of the information written out to the 038: * process accounting file whenever a process exits. 039: */ 040: 041: #define ACCT_COMM 16 042: 043: struct acct 044: { 045: char ac_flag; /* Flags */ 046: char ac_version; /* Always set to ACCT_VERSION */ 047: /* for binary compatibility back until 2.0 */ 048: __u16 ac_uid16; /* LSB of Real User ID */ 049: __u16 ac_gid16; /* LSB of Real Group ID */ 050: __u16 ac_tty; /* Control Terminal */ 051: __u32 ac_btime; /* Process Creation Time */ 052: comp_t ac_utime; /* User Time */ 053: comp_t ac_stime; /* System Time */ 054: comp_t ac_etime; /* Elapsed Time */ 055: comp_t ac_mem; /* Average Memory Usage */ 056: comp_t ac_io; /* Chars Transferred */ 057: comp_t ac_rw; /* Blocks Read or Written */ 058: comp_t ac_minflt; /* Minor Pagefaults */ 059: comp_t ac_majflt; /* Major Pagefaults */ 060: comp_t ac_swaps; /* Number of Swaps */ 061: /* m68k had no padding here. */ 062: __u16 ac_ahz; /* AHZ */ 063: __u32 ac_exitcode; /* Exitcode */ 064: char ac_comm[ACCT_COMM + 1]; /* Command Name */ 065: __u8 ac_etime_hi; /* Elapsed Time MSB */ 066: __u16 ac_etime_lo; /* Elapsed Time LSB */ 067: __u32 ac_uid; /* Real User ID */ 068: __u32 ac_gid; /* Real Group ID */ 069: }; 070: 071: struct acct_v3 072: { 073: char ac_flag; /* Flags */ 074: char ac_version; /* Always set to ACCT_VERSION */ 075: __u16 ac_tty; /* Control Terminal */ 076: __u32 ac_exitcode; /* Exitcode */ 077: __u32 ac_uid; /* Real User ID */ 078: __u32 ac_gid; /* Real Group ID */ 079: __u32 ac_pid; /* Process ID */ 080: __u32 ac_ppid; /* Parent Process ID */ 081: __u32 ac_btime; /* Process Creation Time */ 082: float ac_etime; /* Elapsed Time */ 083: comp_t ac_utime; /* User Time */ 084: comp_t ac_stime; /* System Time */ 085: comp_t ac_mem; /* Average Memory Usage */ 086: comp_t ac_io; /* Chars Transferred */ 087: comp_t ac_rw; /* Blocks Read or Written */ 088: comp_t ac_minflt; /* Minor Pagefaults */ 089: comp_t ac_majflt; /* Major Pagefaults */ 090: comp_t ac_swaps; /* Number of Swaps */ 091: char ac_comm[ACCT_COMM]; /* Command Name */ 092: }; 093: 094: /* 095: * accounting flags 096: */ 097: /* bit set when the process ... */ 098: #define AFORK 0x01 /* ... executed fork, but did not exec */ 099: #define ASU 0x02 /* ... used super-user privileges */ 100: #define ACOMPAT 0x04 /* ... used compatibility mode (VAX only not used) */ 101: #define ACORE 0x08 /* ... dumped core */ 102: #define AXSIG 0x10 /* ... was killed by a signal */ 103: 104: #ifdef __BIG_ENDIAN 105: #define ACCT_BYTEORDER 0x80 /* accounting file is big endian */ 106: #else 107: #define ACCT_BYTEORDER 0x00 /* accounting file is little endian */ 108: #endif 109: 110: #define ACCT_VERSION 2 111: #define AHZ (HZ) 112: 113: 114: #endif /* _LINUX_ACCT_H */ 115: