xref: /illumos-gate/usr/src/uts/common/sys/exacct_catalog.h (revision 7f7322febbcfe774b7270abc3b191c094bfcc517)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef	_SYS_EXACCT_CATALOG_H
28 #define	_SYS_EXACCT_CATALOG_H
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 #ifdef	__cplusplus
33 extern "C" {
34 #endif
35 
36 /*
37  * exacct_catalog.h contains the default catalog for SunOS resource values
38  * reported via the extended accounting facility.  Each recorded value written
39  * to an exacct file is identified via its catalog tag, which is the first four
40  * bytes of each object.  The exacct catalog tag is a 32-bit integer partitioned
41  * into three fields, as illustrated by the following diagram.
42  *
43  * 31	   27	   23						  0
44  * +-------+-------+----------------------------------------------+
45  * |type   |catalog|id						  |
46  * +-------+-------+----------------------------------------------+
47  *
48  * Each of the fields is described in more detail below.
49  */
50 
51 /*
52  * Data type field.  These should correspond to the values of an ea_item_type_t,
53  * shifted left 28 bits, plus the special value for a record group.  All
54  * unspecified values of this field are reserved for future use.
55  */
56 #define	EXT_TYPE_MASK		((uint_t)0xf << 28)
57 
58 #define	EXT_NONE		((uint_t)0x0 << 28)
59 #define	EXT_UINT8		((uint_t)0x1 << 28)
60 #define	EXT_UINT16		((uint_t)0x2 << 28)
61 #define	EXT_UINT32		((uint_t)0x3 << 28)
62 #define	EXT_UINT64		((uint_t)0x4 << 28)
63 #define	EXT_DOUBLE		((uint_t)0x5 << 28)
64 #define	EXT_STRING		((uint_t)0x6 << 28)
65 #define	EXT_EXACCT_OBJECT	((uint_t)0x7 << 28)
66 #define	EXT_RAW			((uint_t)0x8 << 28)
67 #define	EXT_GROUP		((uint_t)0xf << 28)
68 
69 /*
70  * The catalog type field is the second four bits of the catalog tag.  All
71  * unspecified values of this field are reserved for future use.
72  */
73 #define	EXC_CATALOG_MASK	((uint_t)0xf << 24)
74 
75 #define	EXC_NONE		(0x0 << 24)
76 #define	EXC_LOCAL		(0x1 << 24)
77 #define	EXC_DEFAULT		EXC_NONE
78 
79 /*
80  * The data id field comprises the final 24 bits of an ea_catalog_t.  The
81  * current Solaris data ids defined in this version of the exacct format follow.
82  * All values of this field are reserved if the catalog type is EXC_DEFAULT.  If
83  * the catalog type is EXC_LOCAL, this field is application defined.
84  */
85 #define	EXD_DATA_MASK		0xffffff
86 
87 #define	EXD_NONE		0x000000
88 
89 #define	EXD_VERSION		0x000001
90 #define	EXD_FILETYPE		0x000002
91 #define	EXD_CREATOR		0x000003
92 #define	EXD_HOSTNAME		0x000004
93 
94 #define	EXD_GROUP_HEADER	0x0000ff
95 #define	EXD_GROUP_PROC		0x000100
96 #define	EXD_GROUP_TASK		0x000101
97 #define	EXD_GROUP_LWP		0x000102
98 #define	EXD_GROUP_PROC_TAG	0x000103
99 #define	EXD_GROUP_TASK_TAG	0x000104
100 #define	EXD_GROUP_LWP_TAG	0x000105
101 #define	EXD_GROUP_PROC_PARTIAL	0x000106
102 #define	EXD_GROUP_TASK_PARTIAL	0x000107
103 #define	EXD_GROUP_TASK_INTERVAL	0x000108
104 #define	EXD_GROUP_FLOW		0x000109
105 #define	EXD_GROUP_RFMA		0x00010a
106 #define	EXD_GROUP_FMA		0x00010b
107 
108 #define	EXD_PROC_PID		0x001000
109 #define	EXD_PROC_UID		0x001001
110 #define	EXD_PROC_GID		0x001002
111 #define	EXD_PROC_TASKID		0x001003
112 #define	EXD_PROC_PROJID		0x001004
113 #define	EXD_PROC_HOSTNAME	0x001005
114 #define	EXD_PROC_COMMAND	0x001006
115 #define	EXD_PROC_START_SEC	0x001007
116 #define	EXD_PROC_START_NSEC	0x001008
117 #define	EXD_PROC_FINISH_SEC	0x001009
118 #define	EXD_PROC_FINISH_NSEC	0x00100a
119 #define	EXD_PROC_CPU_USER_SEC	0x00100b
120 #define	EXD_PROC_CPU_USER_NSEC	0x00100c
121 #define	EXD_PROC_CPU_SYS_SEC	0x00100d
122 #define	EXD_PROC_CPU_SYS_NSEC	0x00100e
123 #define	EXD_PROC_TTY_MAJOR	0x00100f
124 #define	EXD_PROC_TTY_MINOR	0x001010
125 #define	EXD_PROC_FAULTS_MAJOR	0x001011
126 #define	EXD_PROC_FAULTS_MINOR	0x001012
127 #define	EXD_PROC_MESSAGES_RCV	0x001013
128 #define	EXD_PROC_MESSAGES_SND	0x001014
129 #define	EXD_PROC_BLOCKS_IN	0x001015
130 #define	EXD_PROC_BLOCKS_OUT	0x001016
131 #define	EXD_PROC_CHARS_RDWR	0x001017
132 #define	EXD_PROC_CONTEXT_VOL	0x001018
133 #define	EXD_PROC_CONTEXT_INV	0x001019
134 #define	EXD_PROC_SIGNALS	0x00101a
135 #define	EXD_PROC_SWAPS		0x00101b
136 #define	EXD_PROC_SYSCALLS	0x00101c
137 #define	EXD_PROC_ACCT_FLAGS	0x00101d
138 #define	EXD_PROC_TAG		0x00101e
139 #define	EXD_PROC_ANCPID		0x00101f
140 #define	EXD_PROC_WAIT_STATUS	0x001020
141 #define	EXD_PROC_ZONENAME	0x001021
142 /*
143  * Physical memory usage estimates, in kilobytes.  Counts usage due to
144  * both memory used exclusively by the process, and memory shared with
145  * other processes.
146  */
147 #define	EXD_PROC_MEM_RSS_AVG_K	0x001022
148 #define	EXD_PROC_MEM_RSS_MAX_K	0x001023
149 
150 #define	EXD_TASK_TASKID		0x002000
151 #define	EXD_TASK_PROJID		0x002001
152 #define	EXD_TASK_HOSTNAME	0x002002
153 #define	EXD_TASK_START_SEC	0x002003
154 #define	EXD_TASK_START_NSEC	0x002004
155 #define	EXD_TASK_FINISH_SEC	0x002005
156 #define	EXD_TASK_FINISH_NSEC	0x002006
157 #define	EXD_TASK_CPU_USER_SEC	0x002007
158 #define	EXD_TASK_CPU_USER_NSEC	0x002008
159 #define	EXD_TASK_CPU_SYS_SEC	0x002009
160 #define	EXD_TASK_CPU_SYS_NSEC	0x00200a
161 #define	EXD_TASK_FAULTS_MAJOR	0x00200b
162 #define	EXD_TASK_FAULTS_MINOR	0x00200c
163 #define	EXD_TASK_MESSAGES_RCV	0x00200d
164 #define	EXD_TASK_MESSAGES_SND	0x00200e
165 #define	EXD_TASK_BLOCKS_IN	0x00200f
166 #define	EXD_TASK_BLOCKS_OUT	0x002010
167 #define	EXD_TASK_CHARS_RDWR	0x002011
168 #define	EXD_TASK_CONTEXT_VOL	0x002012
169 #define	EXD_TASK_CONTEXT_INV	0x002013
170 #define	EXD_TASK_SIGNALS	0x002014
171 #define	EXD_TASK_SWAPS		0x002015
172 #define	EXD_TASK_SYSCALLS	0x002016
173 #define	EXD_TASK_TAG		0x002017
174 #define	EXD_TASK_ANCTASKID	0x002018
175 #define	EXD_TASK_ZONENAME	0x002019
176 
177 #define	EXD_FLOW_V4SADDR	0x003000
178 #define	EXD_FLOW_V4DADDR	0x003001
179 #define	EXD_FLOW_V6SADDR	0x003002
180 #define	EXD_FLOW_V6DADDR	0x003003
181 #define	EXD_FLOW_SPORT		0x003004
182 #define	EXD_FLOW_DPORT		0x003005
183 #define	EXD_FLOW_PROTOCOL	0x003006
184 #define	EXD_FLOW_DSFIELD	0x003007
185 #define	EXD_FLOW_NBYTES		0x003008
186 #define	EXD_FLOW_NPKTS		0x003009
187 #define	EXD_FLOW_CTIME		0x00300a
188 #define	EXD_FLOW_LSEEN		0x00300b
189 #define	EXD_FLOW_PROJID		0x00300c
190 #define	EXD_FLOW_UID		0x00300d
191 #define	EXD_FLOW_ANAME		0x00300e
192 
193 #define	EXD_FMA_LABEL		0x004000
194 #define	EXD_FMA_VERSION		0x004001
195 #define	EXD_FMA_OSREL		0x004002
196 #define	EXD_FMA_OSVER		0x004003
197 #define	EXD_FMA_PLAT		0x004004
198 #define	EXD_FMA_TODSEC		0x004005
199 #define	EXD_FMA_TODNSEC		0x004006
200 #define	EXD_FMA_NVLIST		0x004007
201 #define	EXD_FMA_MAJOR		0x004008
202 #define	EXD_FMA_MINOR		0x004009
203 #define	EXD_FMA_INODE		0x00400A
204 #define	EXD_FMA_OFFSET		0x00400B
205 #define	EXD_FMA_UUID		0x00400C
206 
207 #ifdef	__cplusplus
208 }
209 #endif
210 
211 #endif	/* _SYS_EXACCT_CATALOG_H */
212