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