Commit | Line | Data |
---|---|---|
9f3fdbc6 | 1 | /* |
c0c0989a | 2 | * SPDX-License-Identifier: MIT |
e92f3e28 | 3 | * |
c0c0989a | 4 | * Copyright (C) 2010-2012 Mathieu Desnoyers <mathieu.desnoyers@efficios.com> |
a60d70e6 | 5 | * |
c0c0989a | 6 | * LTTng-UST ABI header |
9f3fdbc6 MD |
7 | */ |
8 | ||
c0c0989a MJ |
9 | #ifndef _LTTNG_UST_ABI_H |
10 | #define _LTTNG_UST_ABI_H | |
11 | ||
0a42beb6 | 12 | #include <stdint.h> |
b3f60bbf | 13 | #include <lttng/ust-compiler.h> |
0a42beb6 | 14 | |
db56acaf MD |
15 | #ifndef LTTNG_PACKED |
16 | #error "LTTNG_PACKED should be defined" | |
17 | #endif | |
18 | ||
32ce8569 MD |
19 | #ifndef __ust_stringify |
20 | #define __ust_stringify1(x) #x | |
21 | #define __ust_stringify(x) __ust_stringify1(x) | |
22 | #endif /* __ust_stringify */ | |
9f3fdbc6 | 23 | |
32ce8569 MD |
24 | #define LTTNG_UST_SYM_NAME_LEN 256 |
25 | #define LTTNG_UST_ABI_PROCNAME_LEN 16 | |
26 | ||
27 | /* UST comm magic number, used to validate protocol and endianness. */ | |
28 | #define LTTNG_UST_COMM_MAGIC 0xC57C57C5 | |
b35d179d | 29 | |
0f4eaec3 | 30 | /* Version for ABI between liblttng-ust, sessiond, consumerd */ |
6a359b8a MD |
31 | #define LTTNG_UST_ABI_MAJOR_VERSION 9 |
32 | #define LTTNG_UST_ABI_MAJOR_VERSION_OLDEST_COMPATIBLE 8 | |
33 | #define LTTNG_UST_ABI_MINOR_VERSION 0 | |
0f4eaec3 | 34 | |
9f3fdbc6 | 35 | enum lttng_ust_instrumentation { |
df854e41 MD |
36 | LTTNG_UST_TRACEPOINT = 0, |
37 | LTTNG_UST_PROBE = 1, | |
38 | LTTNG_UST_FUNCTION = 2, | |
6b0e60f1 MD |
39 | }; |
40 | ||
41 | enum lttng_ust_loglevel_type { | |
882a56d7 MD |
42 | LTTNG_UST_LOGLEVEL_ALL = 0, |
43 | LTTNG_UST_LOGLEVEL_RANGE = 1, | |
44 | LTTNG_UST_LOGLEVEL_SINGLE = 2, | |
9f3fdbc6 MD |
45 | }; |
46 | ||
9f3fdbc6 | 47 | enum lttng_ust_output { |
b35d179d | 48 | LTTNG_UST_MMAP = 0, |
9f3fdbc6 MD |
49 | }; |
50 | ||
74d81a6c MD |
51 | enum lttng_ust_chan_type { |
52 | LTTNG_UST_CHAN_PER_CPU = 0, | |
53 | LTTNG_UST_CHAN_METADATA = 1, | |
54 | }; | |
55 | ||
b35d179d | 56 | struct lttng_ust_tracer_version { |
b728d87e MD |
57 | uint32_t major; |
58 | uint32_t minor; | |
b35d179d | 59 | uint32_t patchlevel; |
b3f60bbf | 60 | } LTTNG_PACKED; |
9f3fdbc6 | 61 | |
74d81a6c MD |
62 | #define LTTNG_UST_CHANNEL_PADDING (LTTNG_UST_SYM_NAME_LEN + 32) |
63 | /* | |
64 | * Given that the consumerd is limited to 64k file descriptors, we | |
65 | * cannot expect much more than 1MB channel structure size. This size is | |
66 | * depends on the number of streams within a channel, which depends on | |
67 | * the number of possible CPUs on the system. | |
68 | */ | |
69 | #define LTTNG_UST_CHANNEL_DATA_MAX_LEN 1048576U | |
9f3fdbc6 | 70 | struct lttng_ust_channel { |
74d81a6c MD |
71 | uint64_t len; |
72 | enum lttng_ust_chan_type type; | |
1332bb04 | 73 | char padding[LTTNG_UST_CHANNEL_PADDING]; |
74d81a6c | 74 | char data[]; /* variable sized data */ |
b3f60bbf | 75 | } LTTNG_PACKED; |
9f3fdbc6 | 76 | |
74d81a6c | 77 | #define LTTNG_UST_STREAM_PADDING1 (LTTNG_UST_SYM_NAME_LEN + 32) |
381c0f1e | 78 | struct lttng_ust_stream { |
74d81a6c MD |
79 | uint64_t len; /* shm len */ |
80 | uint32_t stream_nr; /* stream number */ | |
1332bb04 | 81 | char padding[LTTNG_UST_STREAM_PADDING1]; |
74d81a6c MD |
82 | /* |
83 | * shm_fd and wakeup_fd are send over unix socket as file | |
84 | * descriptors after this structure. | |
85 | */ | |
b3f60bbf | 86 | } LTTNG_PACKED; |
381c0f1e | 87 | |
81bc4972 | 88 | #define LTTNG_UST_COUNTER_DIMENSION_MAX 8 |
ebabbf58 MD |
89 | |
90 | enum lttng_ust_counter_arithmetic { | |
4b2c9b6b MD |
91 | LTTNG_UST_COUNTER_ARITHMETIC_MODULAR = 0, |
92 | LTTNG_UST_COUNTER_ARITHMETIC_SATURATION = 1, | |
ebabbf58 MD |
93 | }; |
94 | ||
95 | enum lttng_ust_counter_bitness { | |
5f57042e MD |
96 | LTTNG_UST_COUNTER_BITNESS_32 = 0, |
97 | LTTNG_UST_COUNTER_BITNESS_64 = 1, | |
ebabbf58 MD |
98 | }; |
99 | ||
100 | struct lttng_ust_counter_dimension { | |
101 | uint64_t size; | |
102 | uint64_t underflow_index; | |
103 | uint64_t overflow_index; | |
104 | uint8_t has_underflow; | |
105 | uint8_t has_overflow; | |
106 | } LTTNG_PACKED; | |
107 | ||
81bc4972 | 108 | #define LTTNG_UST_COUNTER_CONF_PADDING1 67 |
ebabbf58 MD |
109 | struct lttng_ust_counter_conf { |
110 | uint32_t arithmetic; /* enum lttng_ust_counter_arithmetic */ | |
111 | uint32_t bitness; /* enum lttng_ust_counter_bitness */ | |
112 | uint32_t number_dimensions; | |
113 | int64_t global_sum_step; | |
114 | struct lttng_ust_counter_dimension dimensions[LTTNG_UST_COUNTER_DIMENSION_MAX]; | |
81bc4972 MD |
115 | uint8_t coalesce_hits; |
116 | char padding[LTTNG_UST_COUNTER_CONF_PADDING1]; | |
ebabbf58 MD |
117 | } LTTNG_PACKED; |
118 | ||
119 | struct lttng_ust_counter_value { | |
120 | uint32_t number_dimensions; | |
121 | uint64_t dimension_indexes[LTTNG_UST_COUNTER_DIMENSION_MAX]; | |
122 | int64_t value; | |
123 | } LTTNG_PACKED; | |
124 | ||
8968a99f | 125 | #define LTTNG_UST_EVENT_PADDING1 8 |
74d81a6c | 126 | #define LTTNG_UST_EVENT_PADDING2 (LTTNG_UST_SYM_NAME_LEN + 32) |
9f3fdbc6 | 127 | struct lttng_ust_event { |
9f3fdbc6 | 128 | enum lttng_ust_instrumentation instrumentation; |
6b0e60f1 MD |
129 | char name[LTTNG_UST_SYM_NAME_LEN]; /* event name */ |
130 | ||
131 | enum lttng_ust_loglevel_type loglevel_type; | |
882a56d7 | 132 | int loglevel; /* value, -1: all */ |
8968a99f | 133 | uint64_t token; /* User-provided token */ |
1332bb04 | 134 | char padding[LTTNG_UST_EVENT_PADDING1]; |
6b0e60f1 | 135 | |
9f3fdbc6 MD |
136 | /* Per instrumentation type configuration */ |
137 | union { | |
1332bb04 | 138 | char padding[LTTNG_UST_EVENT_PADDING2]; |
9f3fdbc6 | 139 | } u; |
b3f60bbf | 140 | } LTTNG_PACKED; |
9f3fdbc6 | 141 | |
1bd9425a | 142 | #define LTTNG_UST_EVENT_NOTIFIER_PADDING 32 |
d8d2416d FD |
143 | struct lttng_ust_event_notifier { |
144 | struct lttng_ust_event event; | |
ebabbf58 | 145 | uint64_t error_counter_index; |
1bd9425a | 146 | char padding[LTTNG_UST_EVENT_NOTIFIER_PADDING]; |
d8d2416d FD |
147 | } LTTNG_PACKED; |
148 | ||
149 | #define LTTNG_EVENT_NOTIFIER_NOTIFICATION_PADDING 32 | |
150 | struct lttng_ust_event_notifier_notification { | |
151 | uint64_t token; | |
d37ecb3f | 152 | uint16_t capture_buf_size; |
d8d2416d FD |
153 | char padding[LTTNG_EVENT_NOTIFIER_NOTIFICATION_PADDING]; |
154 | } LTTNG_PACKED; | |
155 | ||
ebabbf58 MD |
156 | #define LTTNG_UST_COUNTER_PADDING1 (LTTNG_UST_SYM_NAME_LEN + 32) |
157 | #define LTTNG_UST_COUNTER_DATA_MAX_LEN 4096U | |
158 | struct lttng_ust_counter { | |
159 | uint64_t len; | |
160 | char padding[LTTNG_UST_COUNTER_PADDING1]; | |
161 | char data[]; /* variable sized data */ | |
162 | } LTTNG_PACKED; | |
163 | ||
164 | #define LTTNG_UST_COUNTER_GLOBAL_PADDING1 (LTTNG_UST_SYM_NAME_LEN + 32) | |
165 | struct lttng_ust_counter_global { | |
166 | uint64_t len; /* shm len */ | |
167 | char padding[LTTNG_UST_COUNTER_GLOBAL_PADDING1]; | |
168 | } LTTNG_PACKED; | |
169 | ||
170 | #define LTTNG_UST_COUNTER_CPU_PADDING1 (LTTNG_UST_SYM_NAME_LEN + 32) | |
171 | struct lttng_ust_counter_cpu { | |
172 | uint64_t len; /* shm len */ | |
173 | uint32_t cpu_nr; | |
174 | char padding[LTTNG_UST_COUNTER_CPU_PADDING1]; | |
175 | } LTTNG_PACKED; | |
176 | ||
06d4f27e MD |
177 | enum lttng_ust_field_type { |
178 | LTTNG_UST_FIELD_OTHER = 0, | |
179 | LTTNG_UST_FIELD_INTEGER = 1, | |
180 | LTTNG_UST_FIELD_ENUM = 2, | |
181 | LTTNG_UST_FIELD_FLOAT = 3, | |
182 | LTTNG_UST_FIELD_STRING = 4, | |
183 | }; | |
184 | ||
74d81a6c | 185 | #define LTTNG_UST_FIELD_ITER_PADDING (LTTNG_UST_SYM_NAME_LEN + 28) |
06d4f27e MD |
186 | struct lttng_ust_field_iter { |
187 | char event_name[LTTNG_UST_SYM_NAME_LEN]; | |
188 | char field_name[LTTNG_UST_SYM_NAME_LEN]; | |
189 | enum lttng_ust_field_type type; | |
190 | int loglevel; /* event loglevel */ | |
180901e6 | 191 | int nowrite; |
06d4f27e | 192 | char padding[LTTNG_UST_FIELD_ITER_PADDING]; |
b3f60bbf | 193 | } LTTNG_PACKED; |
06d4f27e | 194 | |
9f3fdbc6 | 195 | enum lttng_ust_context_type { |
3b402b40 | 196 | LTTNG_UST_CONTEXT_VTID = 0, |
c1ef86f0 MD |
197 | LTTNG_UST_CONTEXT_VPID = 1, |
198 | LTTNG_UST_CONTEXT_PTHREAD_ID = 2, | |
4847e9bb | 199 | LTTNG_UST_CONTEXT_PROCNAME = 3, |
96f85541 | 200 | LTTNG_UST_CONTEXT_IP = 4, |
d58d1454 | 201 | LTTNG_UST_CONTEXT_PERF_THREAD_COUNTER = 5, |
c7ea8487 | 202 | LTTNG_UST_CONTEXT_CPU_ID = 6, |
53f0df51 | 203 | LTTNG_UST_CONTEXT_APP_CONTEXT = 7, |
735bef47 MJ |
204 | LTTNG_UST_CONTEXT_CGROUP_NS = 8, |
205 | LTTNG_UST_CONTEXT_IPC_NS = 9, | |
206 | LTTNG_UST_CONTEXT_MNT_NS = 10, | |
207 | LTTNG_UST_CONTEXT_NET_NS = 11, | |
208 | LTTNG_UST_CONTEXT_PID_NS = 12, | |
209 | LTTNG_UST_CONTEXT_USER_NS = 13, | |
210 | LTTNG_UST_CONTEXT_UTS_NS = 14, | |
fca2f191 MJ |
211 | LTTNG_UST_CONTEXT_VUID = 15, |
212 | LTTNG_UST_CONTEXT_VEUID = 16, | |
213 | LTTNG_UST_CONTEXT_VSUID = 17, | |
214 | LTTNG_UST_CONTEXT_VGID = 18, | |
215 | LTTNG_UST_CONTEXT_VEGID = 19, | |
216 | LTTNG_UST_CONTEXT_VSGID = 20, | |
cefef7a7 | 217 | LTTNG_UST_CONTEXT_TIME_NS = 21, |
9f3fdbc6 MD |
218 | }; |
219 | ||
d58d1454 MD |
220 | struct lttng_ust_perf_counter_ctx { |
221 | uint32_t type; | |
222 | uint64_t config; | |
223 | char name[LTTNG_UST_SYM_NAME_LEN]; | |
224 | } LTTNG_PACKED; | |
225 | ||
1332bb04 | 226 | #define LTTNG_UST_CONTEXT_PADDING1 16 |
74d81a6c | 227 | #define LTTNG_UST_CONTEXT_PADDING2 (LTTNG_UST_SYM_NAME_LEN + 32) |
9f3fdbc6 MD |
228 | struct lttng_ust_context { |
229 | enum lttng_ust_context_type ctx; | |
1332bb04 MD |
230 | char padding[LTTNG_UST_CONTEXT_PADDING1]; |
231 | ||
9f3fdbc6 | 232 | union { |
d58d1454 | 233 | struct lttng_ust_perf_counter_ctx perf_counter; |
53f0df51 JG |
234 | struct { |
235 | /* Includes trailing '\0'. */ | |
236 | uint32_t provider_name_len; | |
237 | uint32_t ctx_name_len; | |
238 | } app_ctx; | |
1332bb04 | 239 | char padding[LTTNG_UST_CONTEXT_PADDING2]; |
9f3fdbc6 | 240 | } u; |
b3f60bbf | 241 | } LTTNG_PACKED; |
9f3fdbc6 | 242 | |
92462b01 MD |
243 | /* |
244 | * Tracer channel attributes. | |
245 | */ | |
74d81a6c | 246 | #define LTTNG_UST_CHANNEL_ATTR_PADDING (LTTNG_UST_SYM_NAME_LEN + 32) |
92462b01 | 247 | struct lttng_ust_channel_attr { |
92462b01 MD |
248 | uint64_t subbuf_size; /* bytes */ |
249 | uint64_t num_subbuf; /* power of 2 */ | |
b3f60bbf | 250 | int overwrite; /* 1: overwrite, 0: discard */ |
92462b01 MD |
251 | unsigned int switch_timer_interval; /* usec */ |
252 | unsigned int read_timer_interval; /* usec */ | |
253 | enum lttng_ust_output output; /* splice, mmap */ | |
b2c5f61a MD |
254 | union { |
255 | struct { | |
256 | int64_t blocking_timeout; /* Blocking timeout (usec) */ | |
257 | } s; | |
258 | char padding[LTTNG_UST_CHANNEL_ATTR_PADDING]; | |
259 | } u; | |
b3f60bbf | 260 | } LTTNG_PACKED; |
92462b01 | 261 | |
1332bb04 | 262 | #define LTTNG_UST_TRACEPOINT_ITER_PADDING 16 |
cbef6901 MD |
263 | struct lttng_ust_tracepoint_iter { |
264 | char name[LTTNG_UST_SYM_NAME_LEN]; /* provider:name */ | |
882a56d7 | 265 | int loglevel; |
1332bb04 | 266 | char padding[LTTNG_UST_TRACEPOINT_ITER_PADDING]; |
b3f60bbf | 267 | } LTTNG_PACKED; |
cbef6901 | 268 | |
74d81a6c MD |
269 | enum lttng_ust_object_type { |
270 | LTTNG_UST_OBJECT_TYPE_UNKNOWN = -1, | |
271 | LTTNG_UST_OBJECT_TYPE_CHANNEL = 0, | |
272 | LTTNG_UST_OBJECT_TYPE_STREAM = 1, | |
32ce8569 MD |
273 | LTTNG_UST_OBJECT_TYPE_EVENT = 2, |
274 | LTTNG_UST_OBJECT_TYPE_CONTEXT = 3, | |
d8d2416d FD |
275 | LTTNG_UST_OBJECT_TYPE_EVENT_NOTIFIER_GROUP = 4, |
276 | LTTNG_UST_OBJECT_TYPE_EVENT_NOTIFIER = 5, | |
ebabbf58 MD |
277 | LTTNG_UST_OBJECT_TYPE_COUNTER = 6, |
278 | LTTNG_UST_OBJECT_TYPE_COUNTER_GLOBAL = 7, | |
279 | LTTNG_UST_OBJECT_TYPE_COUNTER_CPU = 8, | |
74d81a6c MD |
280 | }; |
281 | ||
282 | #define LTTNG_UST_OBJECT_DATA_PADDING1 32 | |
283 | #define LTTNG_UST_OBJECT_DATA_PADDING2 (LTTNG_UST_SYM_NAME_LEN + 32) | |
284 | ||
92462b01 | 285 | struct lttng_ust_object_data { |
74d81a6c | 286 | enum lttng_ust_object_type type; |
92462b01 | 287 | int handle; |
74d81a6c MD |
288 | uint64_t size; |
289 | char padding1[LTTNG_UST_OBJECT_DATA_PADDING1]; | |
290 | union { | |
291 | struct { | |
292 | void *data; | |
293 | enum lttng_ust_chan_type type; | |
ff0f5728 | 294 | int wakeup_fd; |
74d81a6c MD |
295 | } channel; |
296 | struct { | |
297 | int shm_fd; | |
298 | int wakeup_fd; | |
299 | uint32_t stream_nr; | |
300 | } stream; | |
ebabbf58 MD |
301 | struct { |
302 | void *data; | |
303 | } counter; | |
304 | struct { | |
305 | int shm_fd; | |
306 | } counter_global; | |
307 | struct { | |
308 | int shm_fd; | |
309 | uint32_t cpu_nr; | |
310 | } counter_cpu; | |
74d81a6c MD |
311 | char padding2[LTTNG_UST_OBJECT_DATA_PADDING2]; |
312 | } u; | |
b3f60bbf | 313 | } LTTNG_PACKED; |
92462b01 | 314 | |
d9a9a33b MD |
315 | enum lttng_ust_calibrate_type { |
316 | LTTNG_UST_CALIBRATE_TRACEPOINT, | |
317 | }; | |
318 | ||
1332bb04 | 319 | #define LTTNG_UST_CALIBRATE_PADDING1 16 |
74d81a6c | 320 | #define LTTNG_UST_CALIBRATE_PADDING2 (LTTNG_UST_SYM_NAME_LEN + 32) |
d9a9a33b MD |
321 | struct lttng_ust_calibrate { |
322 | enum lttng_ust_calibrate_type type; /* type (input) */ | |
1332bb04 MD |
323 | char padding[LTTNG_UST_CALIBRATE_PADDING1]; |
324 | ||
325 | union { | |
326 | char padding[LTTNG_UST_CALIBRATE_PADDING2]; | |
327 | } u; | |
b3f60bbf | 328 | } LTTNG_PACKED; |
d9a9a33b | 329 | |
5b4839a8 | 330 | #define FILTER_BYTECODE_MAX_LEN 65536 |
a5930599 | 331 | #define LTTNG_UST_FILTER_PADDING 32 |
2d78951a | 332 | struct lttng_ust_filter_bytecode { |
2734ca65 CB |
333 | uint32_t len; |
334 | uint32_t reloc_offset; | |
3f6fd224 | 335 | uint64_t seqnum; |
a5930599 | 336 | char padding[LTTNG_UST_FILTER_PADDING]; |
2d78951a | 337 | char data[0]; |
b3f60bbf | 338 | } LTTNG_PACKED; |
2d78951a | 339 | |
d37ecb3f FD |
340 | #define CAPTURE_BYTECODE_MAX_LEN 65536 |
341 | #define LTTNG_UST_CAPTURE_PADDING 32 | |
342 | struct lttng_ust_capture_bytecode { | |
343 | uint32_t len; | |
344 | uint32_t reloc_offset; | |
345 | uint64_t seqnum; | |
346 | char padding[LTTNG_UST_CAPTURE_PADDING]; | |
347 | char data[0]; | |
348 | } LTTNG_PACKED; | |
349 | ||
86e0c24e JI |
350 | #define LTTNG_UST_EXCLUSION_PADDING 32 |
351 | struct lttng_ust_event_exclusion { | |
352 | uint32_t count; | |
353 | char padding[LTTNG_UST_EXCLUSION_PADDING]; | |
354 | char names[LTTNG_UST_SYM_NAME_LEN][0]; | |
355 | } LTTNG_PACKED; | |
356 | ||
9f3fdbc6 MD |
357 | #define _UST_CMD(minor) (minor) |
358 | #define _UST_CMDR(minor, type) (minor) | |
359 | #define _UST_CMDW(minor, type) (minor) | |
360 | ||
46050b1a MD |
361 | /* Handled by object descriptor */ |
362 | #define LTTNG_UST_RELEASE _UST_CMD(0x1) | |
363 | ||
364 | /* Handled by object cmd */ | |
365 | ||
9f3fdbc6 MD |
366 | /* LTTng-UST commands */ |
367 | #define LTTNG_UST_SESSION _UST_CMD(0x40) | |
368 | #define LTTNG_UST_TRACER_VERSION \ | |
369 | _UST_CMDR(0x41, struct lttng_ust_tracer_version) | |
370 | #define LTTNG_UST_TRACEPOINT_LIST _UST_CMD(0x42) | |
371 | #define LTTNG_UST_WAIT_QUIESCENT _UST_CMD(0x43) | |
11ff9c7d | 372 | #define LTTNG_UST_REGISTER_DONE _UST_CMD(0x44) |
06d4f27e | 373 | #define LTTNG_UST_TRACEPOINT_FIELD_LIST _UST_CMD(0x45) |
d8d2416d | 374 | #define LTTNG_UST_EVENT_NOTIFIER_GROUP_CREATE _UST_CMD(0x46) |
9f3fdbc6 | 375 | |
3c5d7582 | 376 | /* Session commands */ |
9f3fdbc6 MD |
377 | #define LTTNG_UST_CHANNEL \ |
378 | _UST_CMDW(0x51, struct lttng_ust_channel) | |
379 | #define LTTNG_UST_SESSION_START _UST_CMD(0x52) | |
380 | #define LTTNG_UST_SESSION_STOP _UST_CMD(0x53) | |
710b8ee3 | 381 | #define LTTNG_UST_SESSION_STATEDUMP _UST_CMD(0x54) |
9f3fdbc6 | 382 | |
3c5d7582 | 383 | /* Channel commands */ |
9f3fdbc6 MD |
384 | #define LTTNG_UST_STREAM _UST_CMD(0x60) |
385 | #define LTTNG_UST_EVENT \ | |
386 | _UST_CMDW(0x61, struct lttng_ust_event) | |
387 | ||
3c5d7582 | 388 | /* Event and channel commands */ |
9f3fdbc6 MD |
389 | #define LTTNG_UST_CONTEXT \ |
390 | _UST_CMDW(0x70, struct lttng_ust_context) | |
43d330a4 | 391 | #define LTTNG_UST_FLUSH_BUFFER \ |
43861eab | 392 | _UST_CMD(0x71) |
9f3fdbc6 | 393 | |
3c5d7582 | 394 | /* Event, event notifier, channel and session commands */ |
9f3fdbc6 MD |
395 | #define LTTNG_UST_ENABLE _UST_CMD(0x80) |
396 | #define LTTNG_UST_DISABLE _UST_CMD(0x81) | |
397 | ||
51489cad MD |
398 | /* Tracepoint list commands */ |
399 | #define LTTNG_UST_TRACEPOINT_LIST_GET _UST_CMD(0x90) | |
06d4f27e | 400 | #define LTTNG_UST_TRACEPOINT_FIELD_LIST_GET _UST_CMD(0x91) |
51489cad | 401 | |
3c5d7582 | 402 | /* Event and event notifier commands */ |
2d78951a | 403 | #define LTTNG_UST_FILTER _UST_CMD(0xA0) |
75582b3a | 404 | #define LTTNG_UST_EXCLUSION _UST_CMD(0xA1) |
2d78951a | 405 | |
d8d2416d FD |
406 | /* Event notifier group commands */ |
407 | #define LTTNG_UST_EVENT_NOTIFIER_CREATE \ | |
408 | _UST_CMDW(0xB0, struct lttng_ust_event_notifier) | |
3c5d7582 MD |
409 | |
410 | /* Event notifier commands */ | |
411 | #define LTTNG_UST_CAPTURE _UST_CMD(0xB6) | |
d8d2416d | 412 | |
ebabbf58 MD |
413 | /* Session and event notifier group commands */ |
414 | #define LTTNG_UST_COUNTER \ | |
415 | _UST_CMDW(0xC0, struct lttng_ust_counter) | |
416 | ||
417 | /* Counter commands */ | |
418 | #define LTTNG_UST_COUNTER_GLOBAL \ | |
419 | _UST_CMDW(0xD0, struct lttng_ust_counter_global) | |
420 | #define LTTNG_UST_COUNTER_CPU \ | |
421 | _UST_CMDW(0xD1, struct lttng_ust_counter_cpu) | |
422 | ||
46050b1a MD |
423 | #define LTTNG_UST_ROOT_HANDLE 0 |
424 | ||
b61ce3b2 | 425 | struct lttng_ust_obj; |
46050b1a | 426 | |
ef9ff354 MD |
427 | union ust_args { |
428 | struct { | |
74d81a6c | 429 | void *chan_data; |
ff0f5728 | 430 | int wakeup_fd; |
ef9ff354 MD |
431 | } channel; |
432 | struct { | |
74d81a6c MD |
433 | int shm_fd; |
434 | int wakeup_fd; | |
ef9ff354 | 435 | } stream; |
40003310 MD |
436 | struct { |
437 | struct lttng_ust_field_iter entry; | |
438 | } field_list; | |
8e696cfa MD |
439 | struct { |
440 | char *ctxname; | |
441 | } app_context; | |
d8d2416d FD |
442 | struct { |
443 | int event_notifier_notif_fd; | |
444 | } event_notifier_handle; | |
ebabbf58 MD |
445 | struct { |
446 | void *counter_data; | |
447 | } counter; | |
448 | struct { | |
449 | int shm_fd; | |
450 | } counter_shm; | |
ef9ff354 MD |
451 | }; |
452 | ||
b61ce3b2 | 453 | struct lttng_ust_objd_ops { |
ef9ff354 | 454 | long (*cmd)(int objd, unsigned int cmd, unsigned long arg, |
f59ed768 | 455 | union ust_args *args, void *owner); |
46050b1a MD |
456 | int (*release)(int objd); |
457 | }; | |
458 | ||
459 | /* Create root handle. Always ID 0. */ | |
460 | int lttng_abi_create_root_handle(void); | |
461 | ||
b61ce3b2 | 462 | const struct lttng_ust_objd_ops *objd_ops(int id); |
1849ef7c | 463 | int lttng_ust_objd_unref(int id, int is_owner); |
46050b1a MD |
464 | |
465 | void lttng_ust_abi_exit(void); | |
003fedf4 | 466 | void lttng_ust_events_exit(void); |
f59ed768 | 467 | void lttng_ust_objd_table_owner_cleanup(void *owner); |
b35d179d | 468 | |
9f3fdbc6 | 469 | #endif /* _LTTNG_UST_ABI_H */ |