xref: /onnv-gate/usr/src/uts/common/sys/exacct_catalog.h (revision 8275:7c223a798022)
10Sstevel@tonic-gate /*
20Sstevel@tonic-gate  * CDDL HEADER START
30Sstevel@tonic-gate  *
40Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*8275SEric Cheng  * Common Development and Distribution License (the "License").
6*8275SEric Cheng  * You may not use this file except in compliance with the License.
70Sstevel@tonic-gate  *
80Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
90Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
100Sstevel@tonic-gate  * See the License for the specific language governing permissions
110Sstevel@tonic-gate  * and limitations under the License.
120Sstevel@tonic-gate  *
130Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
140Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
150Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
160Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
170Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
180Sstevel@tonic-gate  *
190Sstevel@tonic-gate  * CDDL HEADER END
200Sstevel@tonic-gate  */
210Sstevel@tonic-gate /*
22*8275SEric Cheng  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
230Sstevel@tonic-gate  * Use is subject to license terms.
240Sstevel@tonic-gate  */
250Sstevel@tonic-gate 
260Sstevel@tonic-gate #ifndef	_SYS_EXACCT_CATALOG_H
270Sstevel@tonic-gate #define	_SYS_EXACCT_CATALOG_H
280Sstevel@tonic-gate 
290Sstevel@tonic-gate #ifdef	__cplusplus
300Sstevel@tonic-gate extern "C" {
310Sstevel@tonic-gate #endif
320Sstevel@tonic-gate 
330Sstevel@tonic-gate /*
340Sstevel@tonic-gate  * exacct_catalog.h contains the default catalog for SunOS resource values
350Sstevel@tonic-gate  * reported via the extended accounting facility.  Each recorded value written
360Sstevel@tonic-gate  * to an exacct file is identified via its catalog tag, which is the first four
370Sstevel@tonic-gate  * bytes of each object.  The exacct catalog tag is a 32-bit integer partitioned
380Sstevel@tonic-gate  * into three fields, as illustrated by the following diagram.
390Sstevel@tonic-gate  *
400Sstevel@tonic-gate  * 31	   27	   23						  0
410Sstevel@tonic-gate  * +-------+-------+----------------------------------------------+
420Sstevel@tonic-gate  * |type   |catalog|id						  |
430Sstevel@tonic-gate  * +-------+-------+----------------------------------------------+
440Sstevel@tonic-gate  *
450Sstevel@tonic-gate  * Each of the fields is described in more detail below.
460Sstevel@tonic-gate  */
470Sstevel@tonic-gate 
480Sstevel@tonic-gate /*
490Sstevel@tonic-gate  * Data type field.  These should correspond to the values of an ea_item_type_t,
500Sstevel@tonic-gate  * shifted left 28 bits, plus the special value for a record group.  All
510Sstevel@tonic-gate  * unspecified values of this field are reserved for future use.
520Sstevel@tonic-gate  */
530Sstevel@tonic-gate #define	EXT_TYPE_MASK		((uint_t)0xf << 28)
540Sstevel@tonic-gate 
550Sstevel@tonic-gate #define	EXT_NONE		((uint_t)0x0 << 28)
560Sstevel@tonic-gate #define	EXT_UINT8		((uint_t)0x1 << 28)
570Sstevel@tonic-gate #define	EXT_UINT16		((uint_t)0x2 << 28)
580Sstevel@tonic-gate #define	EXT_UINT32		((uint_t)0x3 << 28)
590Sstevel@tonic-gate #define	EXT_UINT64		((uint_t)0x4 << 28)
600Sstevel@tonic-gate #define	EXT_DOUBLE		((uint_t)0x5 << 28)
610Sstevel@tonic-gate #define	EXT_STRING		((uint_t)0x6 << 28)
620Sstevel@tonic-gate #define	EXT_EXACCT_OBJECT	((uint_t)0x7 << 28)
630Sstevel@tonic-gate #define	EXT_RAW			((uint_t)0x8 << 28)
640Sstevel@tonic-gate #define	EXT_GROUP		((uint_t)0xf << 28)
650Sstevel@tonic-gate 
660Sstevel@tonic-gate /*
670Sstevel@tonic-gate  * The catalog type field is the second four bits of the catalog tag.  All
680Sstevel@tonic-gate  * unspecified values of this field are reserved for future use.
690Sstevel@tonic-gate  */
700Sstevel@tonic-gate #define	EXC_CATALOG_MASK	((uint_t)0xf << 24)
710Sstevel@tonic-gate 
720Sstevel@tonic-gate #define	EXC_NONE		(0x0 << 24)
730Sstevel@tonic-gate #define	EXC_LOCAL		(0x1 << 24)
740Sstevel@tonic-gate #define	EXC_DEFAULT		EXC_NONE
750Sstevel@tonic-gate 
760Sstevel@tonic-gate /*
770Sstevel@tonic-gate  * The data id field comprises the final 24 bits of an ea_catalog_t.  The
780Sstevel@tonic-gate  * current Solaris data ids defined in this version of the exacct format follow.
790Sstevel@tonic-gate  * All values of this field are reserved if the catalog type is EXC_DEFAULT.  If
800Sstevel@tonic-gate  * the catalog type is EXC_LOCAL, this field is application defined.
810Sstevel@tonic-gate  */
820Sstevel@tonic-gate #define	EXD_DATA_MASK		0xffffff
830Sstevel@tonic-gate 
840Sstevel@tonic-gate #define	EXD_NONE		0x000000
850Sstevel@tonic-gate 
860Sstevel@tonic-gate #define	EXD_VERSION		0x000001
870Sstevel@tonic-gate #define	EXD_FILETYPE		0x000002
880Sstevel@tonic-gate #define	EXD_CREATOR		0x000003
890Sstevel@tonic-gate #define	EXD_HOSTNAME		0x000004
900Sstevel@tonic-gate 
910Sstevel@tonic-gate #define	EXD_GROUP_HEADER	0x0000ff
920Sstevel@tonic-gate #define	EXD_GROUP_PROC		0x000100
930Sstevel@tonic-gate #define	EXD_GROUP_TASK		0x000101
940Sstevel@tonic-gate #define	EXD_GROUP_LWP		0x000102
950Sstevel@tonic-gate #define	EXD_GROUP_PROC_TAG	0x000103
960Sstevel@tonic-gate #define	EXD_GROUP_TASK_TAG	0x000104
970Sstevel@tonic-gate #define	EXD_GROUP_LWP_TAG	0x000105
980Sstevel@tonic-gate #define	EXD_GROUP_PROC_PARTIAL	0x000106
990Sstevel@tonic-gate #define	EXD_GROUP_TASK_PARTIAL	0x000107
1000Sstevel@tonic-gate #define	EXD_GROUP_TASK_INTERVAL	0x000108
1010Sstevel@tonic-gate #define	EXD_GROUP_FLOW		0x000109
1020Sstevel@tonic-gate #define	EXD_GROUP_RFMA		0x00010a
1030Sstevel@tonic-gate #define	EXD_GROUP_FMA		0x00010b
104*8275SEric Cheng #define	EXD_GROUP_NET_LINK_DESC	0X00010c
105*8275SEric Cheng #define	EXD_GROUP_NET_FLOW_DESC	0X00010d
106*8275SEric Cheng #define	EXD_GROUP_NET_LINK_STATS	0X00010e
107*8275SEric Cheng #define	EXD_GROUP_NET_FLOW_STATS	0X00010f
1080Sstevel@tonic-gate 
1090Sstevel@tonic-gate #define	EXD_PROC_PID		0x001000
1100Sstevel@tonic-gate #define	EXD_PROC_UID		0x001001
1110Sstevel@tonic-gate #define	EXD_PROC_GID		0x001002
1120Sstevel@tonic-gate #define	EXD_PROC_TASKID		0x001003
1130Sstevel@tonic-gate #define	EXD_PROC_PROJID		0x001004
1140Sstevel@tonic-gate #define	EXD_PROC_HOSTNAME	0x001005
1150Sstevel@tonic-gate #define	EXD_PROC_COMMAND	0x001006
1160Sstevel@tonic-gate #define	EXD_PROC_START_SEC	0x001007
1170Sstevel@tonic-gate #define	EXD_PROC_START_NSEC	0x001008
1180Sstevel@tonic-gate #define	EXD_PROC_FINISH_SEC	0x001009
1190Sstevel@tonic-gate #define	EXD_PROC_FINISH_NSEC	0x00100a
1200Sstevel@tonic-gate #define	EXD_PROC_CPU_USER_SEC	0x00100b
1210Sstevel@tonic-gate #define	EXD_PROC_CPU_USER_NSEC	0x00100c
1220Sstevel@tonic-gate #define	EXD_PROC_CPU_SYS_SEC	0x00100d
1230Sstevel@tonic-gate #define	EXD_PROC_CPU_SYS_NSEC	0x00100e
1240Sstevel@tonic-gate #define	EXD_PROC_TTY_MAJOR	0x00100f
1250Sstevel@tonic-gate #define	EXD_PROC_TTY_MINOR	0x001010
1260Sstevel@tonic-gate #define	EXD_PROC_FAULTS_MAJOR	0x001011
1270Sstevel@tonic-gate #define	EXD_PROC_FAULTS_MINOR	0x001012
1280Sstevel@tonic-gate #define	EXD_PROC_MESSAGES_RCV	0x001013
1290Sstevel@tonic-gate #define	EXD_PROC_MESSAGES_SND	0x001014
1300Sstevel@tonic-gate #define	EXD_PROC_BLOCKS_IN	0x001015
1310Sstevel@tonic-gate #define	EXD_PROC_BLOCKS_OUT	0x001016
1320Sstevel@tonic-gate #define	EXD_PROC_CHARS_RDWR	0x001017
1330Sstevel@tonic-gate #define	EXD_PROC_CONTEXT_VOL	0x001018
1340Sstevel@tonic-gate #define	EXD_PROC_CONTEXT_INV	0x001019
1350Sstevel@tonic-gate #define	EXD_PROC_SIGNALS	0x00101a
1360Sstevel@tonic-gate #define	EXD_PROC_SWAPS		0x00101b
1370Sstevel@tonic-gate #define	EXD_PROC_SYSCALLS	0x00101c
1380Sstevel@tonic-gate #define	EXD_PROC_ACCT_FLAGS	0x00101d
1390Sstevel@tonic-gate #define	EXD_PROC_TAG		0x00101e
1400Sstevel@tonic-gate #define	EXD_PROC_ANCPID		0x00101f
1410Sstevel@tonic-gate #define	EXD_PROC_WAIT_STATUS	0x001020
1420Sstevel@tonic-gate #define	EXD_PROC_ZONENAME	0x001021
1430Sstevel@tonic-gate /*
1440Sstevel@tonic-gate  * Physical memory usage estimates, in kilobytes.  Counts usage due to
1450Sstevel@tonic-gate  * both memory used exclusively by the process, and memory shared with
1460Sstevel@tonic-gate  * other processes.
1470Sstevel@tonic-gate  */
1480Sstevel@tonic-gate #define	EXD_PROC_MEM_RSS_AVG_K	0x001022
1490Sstevel@tonic-gate #define	EXD_PROC_MEM_RSS_MAX_K	0x001023
1500Sstevel@tonic-gate 
1510Sstevel@tonic-gate #define	EXD_TASK_TASKID		0x002000
1520Sstevel@tonic-gate #define	EXD_TASK_PROJID		0x002001
1530Sstevel@tonic-gate #define	EXD_TASK_HOSTNAME	0x002002
1540Sstevel@tonic-gate #define	EXD_TASK_START_SEC	0x002003
1550Sstevel@tonic-gate #define	EXD_TASK_START_NSEC	0x002004
1560Sstevel@tonic-gate #define	EXD_TASK_FINISH_SEC	0x002005
1570Sstevel@tonic-gate #define	EXD_TASK_FINISH_NSEC	0x002006
1580Sstevel@tonic-gate #define	EXD_TASK_CPU_USER_SEC	0x002007
1590Sstevel@tonic-gate #define	EXD_TASK_CPU_USER_NSEC	0x002008
1600Sstevel@tonic-gate #define	EXD_TASK_CPU_SYS_SEC	0x002009
1610Sstevel@tonic-gate #define	EXD_TASK_CPU_SYS_NSEC	0x00200a
1620Sstevel@tonic-gate #define	EXD_TASK_FAULTS_MAJOR	0x00200b
1630Sstevel@tonic-gate #define	EXD_TASK_FAULTS_MINOR	0x00200c
1640Sstevel@tonic-gate #define	EXD_TASK_MESSAGES_RCV	0x00200d
1650Sstevel@tonic-gate #define	EXD_TASK_MESSAGES_SND	0x00200e
1660Sstevel@tonic-gate #define	EXD_TASK_BLOCKS_IN	0x00200f
1670Sstevel@tonic-gate #define	EXD_TASK_BLOCKS_OUT	0x002010
1680Sstevel@tonic-gate #define	EXD_TASK_CHARS_RDWR	0x002011
1690Sstevel@tonic-gate #define	EXD_TASK_CONTEXT_VOL	0x002012
1700Sstevel@tonic-gate #define	EXD_TASK_CONTEXT_INV	0x002013
1710Sstevel@tonic-gate #define	EXD_TASK_SIGNALS	0x002014
1720Sstevel@tonic-gate #define	EXD_TASK_SWAPS		0x002015
1730Sstevel@tonic-gate #define	EXD_TASK_SYSCALLS	0x002016
1740Sstevel@tonic-gate #define	EXD_TASK_TAG		0x002017
1750Sstevel@tonic-gate #define	EXD_TASK_ANCTASKID	0x002018
1760Sstevel@tonic-gate #define	EXD_TASK_ZONENAME	0x002019
1770Sstevel@tonic-gate 
1780Sstevel@tonic-gate #define	EXD_FLOW_V4SADDR	0x003000
1790Sstevel@tonic-gate #define	EXD_FLOW_V4DADDR	0x003001
1800Sstevel@tonic-gate #define	EXD_FLOW_V6SADDR	0x003002
1810Sstevel@tonic-gate #define	EXD_FLOW_V6DADDR	0x003003
1820Sstevel@tonic-gate #define	EXD_FLOW_SPORT		0x003004
1830Sstevel@tonic-gate #define	EXD_FLOW_DPORT		0x003005
1840Sstevel@tonic-gate #define	EXD_FLOW_PROTOCOL	0x003006
1850Sstevel@tonic-gate #define	EXD_FLOW_DSFIELD	0x003007
1860Sstevel@tonic-gate #define	EXD_FLOW_NBYTES		0x003008
1870Sstevel@tonic-gate #define	EXD_FLOW_NPKTS		0x003009
1880Sstevel@tonic-gate #define	EXD_FLOW_CTIME		0x00300a
1890Sstevel@tonic-gate #define	EXD_FLOW_LSEEN		0x00300b
1900Sstevel@tonic-gate #define	EXD_FLOW_PROJID		0x00300c
1910Sstevel@tonic-gate #define	EXD_FLOW_UID		0x00300d
1920Sstevel@tonic-gate #define	EXD_FLOW_ANAME		0x00300e
1930Sstevel@tonic-gate 
1940Sstevel@tonic-gate #define	EXD_FMA_LABEL		0x004000
1950Sstevel@tonic-gate #define	EXD_FMA_VERSION		0x004001
1960Sstevel@tonic-gate #define	EXD_FMA_OSREL		0x004002
1970Sstevel@tonic-gate #define	EXD_FMA_OSVER		0x004003
1980Sstevel@tonic-gate #define	EXD_FMA_PLAT		0x004004
1990Sstevel@tonic-gate #define	EXD_FMA_TODSEC		0x004005
2000Sstevel@tonic-gate #define	EXD_FMA_TODNSEC		0x004006
2010Sstevel@tonic-gate #define	EXD_FMA_NVLIST		0x004007
2020Sstevel@tonic-gate #define	EXD_FMA_MAJOR		0x004008
2030Sstevel@tonic-gate #define	EXD_FMA_MINOR		0x004009
2040Sstevel@tonic-gate #define	EXD_FMA_INODE		0x00400A
2050Sstevel@tonic-gate #define	EXD_FMA_OFFSET		0x00400B
2061052Sdilpreet #define	EXD_FMA_UUID		0x00400C
2070Sstevel@tonic-gate 
208*8275SEric Cheng /* For EXD_GROUP_FLDESC  and EXD_GROUP_LNDESC */
209*8275SEric Cheng #define	EXD_NET_DESC_NAME	0x005001
210*8275SEric Cheng #define	EXD_NET_DESC_EHOST	0x005002
211*8275SEric Cheng #define	EXD_NET_DESC_EDEST	0x005003
212*8275SEric Cheng #define	EXD_NET_DESC_VLAN_TPID	0x005004
213*8275SEric Cheng #define	EXD_NET_DESC_VLAN_TCI	0x005005
214*8275SEric Cheng #define	EXD_NET_DESC_SAP	0x005006
215*8275SEric Cheng #define	EXD_NET_DESC_PRIORITY	0x005007
216*8275SEric Cheng #define	EXD_NET_DESC_BWLIMIT	0x005008
217*8275SEric Cheng /* For EXD_GROUP_FLDESC  only */
218*8275SEric Cheng #define	EXD_NET_DESC_DEVNAME	0x005009
219*8275SEric Cheng #define	EXD_NET_DESC_V4SADDR	0x00500a
220*8275SEric Cheng #define	EXD_NET_DESC_V4DADDR	0x00500b
221*8275SEric Cheng #define	EXD_NET_DESC_V6SADDR	0x00500c
222*8275SEric Cheng #define	EXD_NET_DESC_V6DADDR	0x00500d
223*8275SEric Cheng #define	EXD_NET_DESC_SPORT	0x00500e
224*8275SEric Cheng #define	EXD_NET_DESC_DPORT	0x00500f
225*8275SEric Cheng #define	EXD_NET_DESC_PROTOCOL	0x005010
226*8275SEric Cheng #define	EXD_NET_DESC_DSFIELD	0x005011
227*8275SEric Cheng 
228*8275SEric Cheng /* For EXD_NET_STATS */
229*8275SEric Cheng #define	EXD_NET_STATS_NAME	0x006000
230*8275SEric Cheng #define	EXD_NET_STATS_CURTIME	0x006001
231*8275SEric Cheng #define	EXD_NET_STATS_IBYTES	0x006002
232*8275SEric Cheng #define	EXD_NET_STATS_OBYTES	0x006003
233*8275SEric Cheng #define	EXD_NET_STATS_IPKTS	0x006004
234*8275SEric Cheng #define	EXD_NET_STATS_OPKTS	0x006005
235*8275SEric Cheng #define	EXD_NET_STATS_IERRPKTS	0x006006
236*8275SEric Cheng #define	EXD_NET_STATS_OERRPKTS	0x006007
237*8275SEric Cheng 
2380Sstevel@tonic-gate #ifdef	__cplusplus
2390Sstevel@tonic-gate }
2400Sstevel@tonic-gate #endif
2410Sstevel@tonic-gate 
2420Sstevel@tonic-gate #endif	/* _SYS_EXACCT_CATALOG_H */
243