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 | |
07a3a0d5 MD |
88 | #define LTTNG_UST_EVENT_PADDING1 8 |
89 | #define LTTNG_UST_EVENT_PADDING2 (LTTNG_UST_SYM_NAME_LEN + 32) | |
90 | struct lttng_ust_event { | |
91 | enum lttng_ust_instrumentation instrumentation; | |
92 | char name[LTTNG_UST_SYM_NAME_LEN]; /* event name */ | |
93 | ||
94 | enum lttng_ust_loglevel_type loglevel_type; | |
95 | int loglevel; /* value, -1: all */ | |
96 | uint64_t token; /* User-provided token */ | |
97 | char padding[LTTNG_UST_EVENT_PADDING1]; | |
98 | ||
99 | /* Per instrumentation type configuration */ | |
100 | union { | |
101 | char padding[LTTNG_UST_EVENT_PADDING2]; | |
102 | } u; | |
103 | } LTTNG_PACKED; | |
104 | ||
105 | #define LTTNG_UST_EVENT_NOTIFIER_PADDING 32 | |
106 | struct lttng_ust_event_notifier { | |
107 | struct lttng_ust_event event; | |
108 | uint64_t error_counter_index; | |
109 | ||
110 | char padding[LTTNG_UST_EVENT_NOTIFIER_PADDING]; | |
111 | } LTTNG_PACKED; | |
112 | ||
113 | #define LTTNG_UST_EVENT_NOTIFIER_NOTIFICATION_PADDING 32 | |
114 | struct lttng_ust_event_notifier_notification { | |
115 | uint64_t token; | |
116 | uint16_t capture_buf_size; | |
117 | char padding[LTTNG_UST_EVENT_NOTIFIER_NOTIFICATION_PADDING]; | |
118 | } LTTNG_PACKED; | |
119 | ||
120 | enum lttng_ust_key_token_type { | |
121 | LTTNG_UST_KEY_TOKEN_STRING = 0, /* arg: strtab_offset. */ | |
122 | LTTNG_UST_KEY_TOKEN_EVENT_NAME = 1, /* no arg. */ | |
123 | LTTNG_UST_KEY_TOKEN_PROVIDER_NAME = 2, /* no arg. */ | |
124 | }; | |
125 | ||
126 | #define LTTNG_UST_KEY_ARG_PADDING1 256 | |
127 | #define LTTNG_UST_KEY_TOKEN_STRING_LEN_MAX 256 | |
128 | struct lttng_ust_key_token { | |
129 | uint32_t type; /* enum lttng_ust_key_token_type */ | |
130 | union { | |
131 | char string[LTTNG_UST_KEY_TOKEN_STRING_LEN_MAX]; | |
132 | char padding[LTTNG_UST_KEY_ARG_PADDING1]; | |
133 | } arg; | |
134 | } LTTNG_PACKED; | |
135 | ||
136 | #define LTTNG_UST_NR_KEY_TOKEN 4 | |
137 | struct lttng_ust_counter_key_dimension { | |
138 | uint32_t nr_key_tokens; | |
139 | struct lttng_ust_key_token key_tokens[LTTNG_UST_NR_KEY_TOKEN]; | |
140 | } LTTNG_PACKED; | |
141 | ||
142 | #define LTTNG_UST_COUNTER_DIMENSION_MAX 4 | |
143 | struct lttng_ust_counter_key { | |
144 | uint32_t nr_dimensions; | |
145 | struct lttng_ust_counter_key_dimension key_dimensions[LTTNG_UST_COUNTER_DIMENSION_MAX]; | |
146 | } LTTNG_PACKED; | |
147 | ||
148 | #define LTTNG_UST_COUNTER_EVENT_PADDING1 16 | |
149 | struct lttng_ust_counter_event { | |
150 | struct lttng_ust_event event; | |
151 | struct lttng_ust_counter_key key; | |
152 | char padding[LTTNG_UST_COUNTER_EVENT_PADDING1]; | |
153 | } LTTNG_PACKED; | |
ebabbf58 MD |
154 | |
155 | enum lttng_ust_counter_arithmetic { | |
4b2c9b6b MD |
156 | LTTNG_UST_COUNTER_ARITHMETIC_MODULAR = 0, |
157 | LTTNG_UST_COUNTER_ARITHMETIC_SATURATION = 1, | |
ebabbf58 MD |
158 | }; |
159 | ||
160 | enum lttng_ust_counter_bitness { | |
5f57042e MD |
161 | LTTNG_UST_COUNTER_BITNESS_32 = 0, |
162 | LTTNG_UST_COUNTER_BITNESS_64 = 1, | |
ebabbf58 MD |
163 | }; |
164 | ||
165 | struct lttng_ust_counter_dimension { | |
166 | uint64_t size; | |
167 | uint64_t underflow_index; | |
168 | uint64_t overflow_index; | |
169 | uint8_t has_underflow; | |
170 | uint8_t has_overflow; | |
171 | } LTTNG_PACKED; | |
172 | ||
07a3a0d5 | 173 | #define LTTNG_UST_COUNTER_CONF_PADDING1 67 |
ebabbf58 MD |
174 | struct lttng_ust_counter_conf { |
175 | uint32_t arithmetic; /* enum lttng_ust_counter_arithmetic */ | |
176 | uint32_t bitness; /* enum lttng_ust_counter_bitness */ | |
177 | uint32_t number_dimensions; | |
178 | int64_t global_sum_step; | |
179 | struct lttng_ust_counter_dimension dimensions[LTTNG_UST_COUNTER_DIMENSION_MAX]; | |
07a3a0d5 MD |
180 | uint8_t coalesce_hits; |
181 | char padding[LTTNG_UST_COUNTER_CONF_PADDING1]; | |
ebabbf58 MD |
182 | } LTTNG_PACKED; |
183 | ||
184 | struct lttng_ust_counter_value { | |
185 | uint32_t number_dimensions; | |
186 | uint64_t dimension_indexes[LTTNG_UST_COUNTER_DIMENSION_MAX]; | |
187 | int64_t value; | |
188 | } LTTNG_PACKED; | |
189 | ||
ebabbf58 MD |
190 | #define LTTNG_UST_COUNTER_PADDING1 (LTTNG_UST_SYM_NAME_LEN + 32) |
191 | #define LTTNG_UST_COUNTER_DATA_MAX_LEN 4096U | |
192 | struct lttng_ust_counter { | |
193 | uint64_t len; | |
194 | char padding[LTTNG_UST_COUNTER_PADDING1]; | |
195 | char data[]; /* variable sized data */ | |
196 | } LTTNG_PACKED; | |
197 | ||
198 | #define LTTNG_UST_COUNTER_GLOBAL_PADDING1 (LTTNG_UST_SYM_NAME_LEN + 32) | |
199 | struct lttng_ust_counter_global { | |
200 | uint64_t len; /* shm len */ | |
201 | char padding[LTTNG_UST_COUNTER_GLOBAL_PADDING1]; | |
202 | } LTTNG_PACKED; | |
203 | ||
204 | #define LTTNG_UST_COUNTER_CPU_PADDING1 (LTTNG_UST_SYM_NAME_LEN + 32) | |
205 | struct lttng_ust_counter_cpu { | |
206 | uint64_t len; /* shm len */ | |
207 | uint32_t cpu_nr; | |
208 | char padding[LTTNG_UST_COUNTER_CPU_PADDING1]; | |
209 | } LTTNG_PACKED; | |
210 | ||
06d4f27e MD |
211 | enum lttng_ust_field_type { |
212 | LTTNG_UST_FIELD_OTHER = 0, | |
213 | LTTNG_UST_FIELD_INTEGER = 1, | |
214 | LTTNG_UST_FIELD_ENUM = 2, | |
215 | LTTNG_UST_FIELD_FLOAT = 3, | |
216 | LTTNG_UST_FIELD_STRING = 4, | |
217 | }; | |
218 | ||
74d81a6c | 219 | #define LTTNG_UST_FIELD_ITER_PADDING (LTTNG_UST_SYM_NAME_LEN + 28) |
06d4f27e MD |
220 | struct lttng_ust_field_iter { |
221 | char event_name[LTTNG_UST_SYM_NAME_LEN]; | |
222 | char field_name[LTTNG_UST_SYM_NAME_LEN]; | |
223 | enum lttng_ust_field_type type; | |
224 | int loglevel; /* event loglevel */ | |
180901e6 | 225 | int nowrite; |
06d4f27e | 226 | char padding[LTTNG_UST_FIELD_ITER_PADDING]; |
b3f60bbf | 227 | } LTTNG_PACKED; |
06d4f27e | 228 | |
9f3fdbc6 | 229 | enum lttng_ust_context_type { |
3b402b40 | 230 | LTTNG_UST_CONTEXT_VTID = 0, |
c1ef86f0 MD |
231 | LTTNG_UST_CONTEXT_VPID = 1, |
232 | LTTNG_UST_CONTEXT_PTHREAD_ID = 2, | |
4847e9bb | 233 | LTTNG_UST_CONTEXT_PROCNAME = 3, |
96f85541 | 234 | LTTNG_UST_CONTEXT_IP = 4, |
d58d1454 | 235 | LTTNG_UST_CONTEXT_PERF_THREAD_COUNTER = 5, |
c7ea8487 | 236 | LTTNG_UST_CONTEXT_CPU_ID = 6, |
53f0df51 | 237 | LTTNG_UST_CONTEXT_APP_CONTEXT = 7, |
735bef47 MJ |
238 | LTTNG_UST_CONTEXT_CGROUP_NS = 8, |
239 | LTTNG_UST_CONTEXT_IPC_NS = 9, | |
240 | LTTNG_UST_CONTEXT_MNT_NS = 10, | |
241 | LTTNG_UST_CONTEXT_NET_NS = 11, | |
242 | LTTNG_UST_CONTEXT_PID_NS = 12, | |
243 | LTTNG_UST_CONTEXT_USER_NS = 13, | |
244 | LTTNG_UST_CONTEXT_UTS_NS = 14, | |
fca2f191 MJ |
245 | LTTNG_UST_CONTEXT_VUID = 15, |
246 | LTTNG_UST_CONTEXT_VEUID = 16, | |
247 | LTTNG_UST_CONTEXT_VSUID = 17, | |
248 | LTTNG_UST_CONTEXT_VGID = 18, | |
249 | LTTNG_UST_CONTEXT_VEGID = 19, | |
250 | LTTNG_UST_CONTEXT_VSGID = 20, | |
cefef7a7 | 251 | LTTNG_UST_CONTEXT_TIME_NS = 21, |
9f3fdbc6 MD |
252 | }; |
253 | ||
d58d1454 MD |
254 | struct lttng_ust_perf_counter_ctx { |
255 | uint32_t type; | |
256 | uint64_t config; | |
257 | char name[LTTNG_UST_SYM_NAME_LEN]; | |
258 | } LTTNG_PACKED; | |
259 | ||
1332bb04 | 260 | #define LTTNG_UST_CONTEXT_PADDING1 16 |
74d81a6c | 261 | #define LTTNG_UST_CONTEXT_PADDING2 (LTTNG_UST_SYM_NAME_LEN + 32) |
9f3fdbc6 MD |
262 | struct lttng_ust_context { |
263 | enum lttng_ust_context_type ctx; | |
1332bb04 MD |
264 | char padding[LTTNG_UST_CONTEXT_PADDING1]; |
265 | ||
9f3fdbc6 | 266 | union { |
d58d1454 | 267 | struct lttng_ust_perf_counter_ctx perf_counter; |
53f0df51 JG |
268 | struct { |
269 | /* Includes trailing '\0'. */ | |
270 | uint32_t provider_name_len; | |
271 | uint32_t ctx_name_len; | |
272 | } app_ctx; | |
1332bb04 | 273 | char padding[LTTNG_UST_CONTEXT_PADDING2]; |
9f3fdbc6 | 274 | } u; |
b3f60bbf | 275 | } LTTNG_PACKED; |
9f3fdbc6 | 276 | |
92462b01 MD |
277 | /* |
278 | * Tracer channel attributes. | |
279 | */ | |
74d81a6c | 280 | #define LTTNG_UST_CHANNEL_ATTR_PADDING (LTTNG_UST_SYM_NAME_LEN + 32) |
92462b01 | 281 | struct lttng_ust_channel_attr { |
92462b01 MD |
282 | uint64_t subbuf_size; /* bytes */ |
283 | uint64_t num_subbuf; /* power of 2 */ | |
b3f60bbf | 284 | int overwrite; /* 1: overwrite, 0: discard */ |
92462b01 MD |
285 | unsigned int switch_timer_interval; /* usec */ |
286 | unsigned int read_timer_interval; /* usec */ | |
287 | enum lttng_ust_output output; /* splice, mmap */ | |
b2c5f61a MD |
288 | union { |
289 | struct { | |
290 | int64_t blocking_timeout; /* Blocking timeout (usec) */ | |
291 | } s; | |
292 | char padding[LTTNG_UST_CHANNEL_ATTR_PADDING]; | |
293 | } u; | |
b3f60bbf | 294 | } LTTNG_PACKED; |
92462b01 | 295 | |
1332bb04 | 296 | #define LTTNG_UST_TRACEPOINT_ITER_PADDING 16 |
cbef6901 MD |
297 | struct lttng_ust_tracepoint_iter { |
298 | char name[LTTNG_UST_SYM_NAME_LEN]; /* provider:name */ | |
882a56d7 | 299 | int loglevel; |
1332bb04 | 300 | char padding[LTTNG_UST_TRACEPOINT_ITER_PADDING]; |
b3f60bbf | 301 | } LTTNG_PACKED; |
cbef6901 | 302 | |
74d81a6c MD |
303 | enum lttng_ust_object_type { |
304 | LTTNG_UST_OBJECT_TYPE_UNKNOWN = -1, | |
305 | LTTNG_UST_OBJECT_TYPE_CHANNEL = 0, | |
306 | LTTNG_UST_OBJECT_TYPE_STREAM = 1, | |
32ce8569 MD |
307 | LTTNG_UST_OBJECT_TYPE_EVENT = 2, |
308 | LTTNG_UST_OBJECT_TYPE_CONTEXT = 3, | |
d8d2416d FD |
309 | LTTNG_UST_OBJECT_TYPE_EVENT_NOTIFIER_GROUP = 4, |
310 | LTTNG_UST_OBJECT_TYPE_EVENT_NOTIFIER = 5, | |
ebabbf58 MD |
311 | LTTNG_UST_OBJECT_TYPE_COUNTER = 6, |
312 | LTTNG_UST_OBJECT_TYPE_COUNTER_GLOBAL = 7, | |
313 | LTTNG_UST_OBJECT_TYPE_COUNTER_CPU = 8, | |
07a3a0d5 | 314 | LTTNG_UST_OBJECT_TYPE_COUNTER_EVENT = 9, |
74d81a6c MD |
315 | }; |
316 | ||
317 | #define LTTNG_UST_OBJECT_DATA_PADDING1 32 | |
318 | #define LTTNG_UST_OBJECT_DATA_PADDING2 (LTTNG_UST_SYM_NAME_LEN + 32) | |
319 | ||
92462b01 | 320 | struct lttng_ust_object_data { |
74d81a6c | 321 | enum lttng_ust_object_type type; |
92462b01 | 322 | int handle; |
74d81a6c MD |
323 | uint64_t size; |
324 | char padding1[LTTNG_UST_OBJECT_DATA_PADDING1]; | |
325 | union { | |
326 | struct { | |
327 | void *data; | |
328 | enum lttng_ust_chan_type type; | |
ff0f5728 | 329 | int wakeup_fd; |
74d81a6c MD |
330 | } channel; |
331 | struct { | |
332 | int shm_fd; | |
333 | int wakeup_fd; | |
334 | uint32_t stream_nr; | |
335 | } stream; | |
ebabbf58 MD |
336 | struct { |
337 | void *data; | |
338 | } counter; | |
339 | struct { | |
340 | int shm_fd; | |
341 | } counter_global; | |
342 | struct { | |
343 | int shm_fd; | |
344 | uint32_t cpu_nr; | |
345 | } counter_cpu; | |
74d81a6c MD |
346 | char padding2[LTTNG_UST_OBJECT_DATA_PADDING2]; |
347 | } u; | |
b3f60bbf | 348 | } LTTNG_PACKED; |
92462b01 | 349 | |
d9a9a33b MD |
350 | enum lttng_ust_calibrate_type { |
351 | LTTNG_UST_CALIBRATE_TRACEPOINT, | |
352 | }; | |
353 | ||
1332bb04 | 354 | #define LTTNG_UST_CALIBRATE_PADDING1 16 |
74d81a6c | 355 | #define LTTNG_UST_CALIBRATE_PADDING2 (LTTNG_UST_SYM_NAME_LEN + 32) |
d9a9a33b MD |
356 | struct lttng_ust_calibrate { |
357 | enum lttng_ust_calibrate_type type; /* type (input) */ | |
1332bb04 MD |
358 | char padding[LTTNG_UST_CALIBRATE_PADDING1]; |
359 | ||
360 | union { | |
361 | char padding[LTTNG_UST_CALIBRATE_PADDING2]; | |
362 | } u; | |
b3f60bbf | 363 | } LTTNG_PACKED; |
d9a9a33b | 364 | |
5b4839a8 | 365 | #define FILTER_BYTECODE_MAX_LEN 65536 |
a5930599 | 366 | #define LTTNG_UST_FILTER_PADDING 32 |
2d78951a | 367 | struct lttng_ust_filter_bytecode { |
2734ca65 CB |
368 | uint32_t len; |
369 | uint32_t reloc_offset; | |
3f6fd224 | 370 | uint64_t seqnum; |
a5930599 | 371 | char padding[LTTNG_UST_FILTER_PADDING]; |
2d78951a | 372 | char data[0]; |
b3f60bbf | 373 | } LTTNG_PACKED; |
2d78951a | 374 | |
d37ecb3f FD |
375 | #define CAPTURE_BYTECODE_MAX_LEN 65536 |
376 | #define LTTNG_UST_CAPTURE_PADDING 32 | |
377 | struct lttng_ust_capture_bytecode { | |
378 | uint32_t len; | |
379 | uint32_t reloc_offset; | |
380 | uint64_t seqnum; | |
381 | char padding[LTTNG_UST_CAPTURE_PADDING]; | |
382 | char data[0]; | |
383 | } LTTNG_PACKED; | |
384 | ||
86e0c24e JI |
385 | #define LTTNG_UST_EXCLUSION_PADDING 32 |
386 | struct lttng_ust_event_exclusion { | |
387 | uint32_t count; | |
388 | char padding[LTTNG_UST_EXCLUSION_PADDING]; | |
389 | char names[LTTNG_UST_SYM_NAME_LEN][0]; | |
390 | } LTTNG_PACKED; | |
391 | ||
9f3fdbc6 MD |
392 | #define _UST_CMD(minor) (minor) |
393 | #define _UST_CMDR(minor, type) (minor) | |
394 | #define _UST_CMDW(minor, type) (minor) | |
395 | ||
46050b1a MD |
396 | /* Handled by object descriptor */ |
397 | #define LTTNG_UST_RELEASE _UST_CMD(0x1) | |
398 | ||
399 | /* Handled by object cmd */ | |
400 | ||
9f3fdbc6 MD |
401 | /* LTTng-UST commands */ |
402 | #define LTTNG_UST_SESSION _UST_CMD(0x40) | |
403 | #define LTTNG_UST_TRACER_VERSION \ | |
404 | _UST_CMDR(0x41, struct lttng_ust_tracer_version) | |
405 | #define LTTNG_UST_TRACEPOINT_LIST _UST_CMD(0x42) | |
406 | #define LTTNG_UST_WAIT_QUIESCENT _UST_CMD(0x43) | |
11ff9c7d | 407 | #define LTTNG_UST_REGISTER_DONE _UST_CMD(0x44) |
06d4f27e | 408 | #define LTTNG_UST_TRACEPOINT_FIELD_LIST _UST_CMD(0x45) |
d8d2416d | 409 | #define LTTNG_UST_EVENT_NOTIFIER_GROUP_CREATE _UST_CMD(0x46) |
9f3fdbc6 | 410 | |
3c5d7582 | 411 | /* Session commands */ |
9f3fdbc6 MD |
412 | #define LTTNG_UST_CHANNEL \ |
413 | _UST_CMDW(0x51, struct lttng_ust_channel) | |
414 | #define LTTNG_UST_SESSION_START _UST_CMD(0x52) | |
415 | #define LTTNG_UST_SESSION_STOP _UST_CMD(0x53) | |
710b8ee3 | 416 | #define LTTNG_UST_SESSION_STATEDUMP _UST_CMD(0x54) |
9f3fdbc6 | 417 | |
3c5d7582 | 418 | /* Channel commands */ |
9f3fdbc6 MD |
419 | #define LTTNG_UST_STREAM _UST_CMD(0x60) |
420 | #define LTTNG_UST_EVENT \ | |
421 | _UST_CMDW(0x61, struct lttng_ust_event) | |
422 | ||
3c5d7582 | 423 | /* Event and channel commands */ |
9f3fdbc6 MD |
424 | #define LTTNG_UST_CONTEXT \ |
425 | _UST_CMDW(0x70, struct lttng_ust_context) | |
43d330a4 | 426 | #define LTTNG_UST_FLUSH_BUFFER \ |
43861eab | 427 | _UST_CMD(0x71) |
9f3fdbc6 | 428 | |
3c5d7582 | 429 | /* Event, event notifier, channel and session commands */ |
9f3fdbc6 MD |
430 | #define LTTNG_UST_ENABLE _UST_CMD(0x80) |
431 | #define LTTNG_UST_DISABLE _UST_CMD(0x81) | |
432 | ||
51489cad MD |
433 | /* Tracepoint list commands */ |
434 | #define LTTNG_UST_TRACEPOINT_LIST_GET _UST_CMD(0x90) | |
06d4f27e | 435 | #define LTTNG_UST_TRACEPOINT_FIELD_LIST_GET _UST_CMD(0x91) |
51489cad | 436 | |
3c5d7582 | 437 | /* Event and event notifier commands */ |
2d78951a | 438 | #define LTTNG_UST_FILTER _UST_CMD(0xA0) |
75582b3a | 439 | #define LTTNG_UST_EXCLUSION _UST_CMD(0xA1) |
2d78951a | 440 | |
d8d2416d FD |
441 | /* Event notifier group commands */ |
442 | #define LTTNG_UST_EVENT_NOTIFIER_CREATE \ | |
443 | _UST_CMDW(0xB0, struct lttng_ust_event_notifier) | |
3c5d7582 MD |
444 | |
445 | /* Event notifier commands */ | |
446 | #define LTTNG_UST_CAPTURE _UST_CMD(0xB6) | |
d8d2416d | 447 | |
ebabbf58 MD |
448 | /* Session and event notifier group commands */ |
449 | #define LTTNG_UST_COUNTER \ | |
450 | _UST_CMDW(0xC0, struct lttng_ust_counter) | |
451 | ||
452 | /* Counter commands */ | |
453 | #define LTTNG_UST_COUNTER_GLOBAL \ | |
454 | _UST_CMDW(0xD0, struct lttng_ust_counter_global) | |
455 | #define LTTNG_UST_COUNTER_CPU \ | |
456 | _UST_CMDW(0xD1, struct lttng_ust_counter_cpu) | |
07a3a0d5 MD |
457 | #define LTTNG_UST_COUNTER_EVENT \ |
458 | _UST_CMDW(0xD2, struct lttng_ust_counter_event) | |
ebabbf58 | 459 | |
46050b1a MD |
460 | #define LTTNG_UST_ROOT_HANDLE 0 |
461 | ||
b61ce3b2 | 462 | struct lttng_ust_obj; |
46050b1a | 463 | |
ef9ff354 MD |
464 | union ust_args { |
465 | struct { | |
74d81a6c | 466 | void *chan_data; |
ff0f5728 | 467 | int wakeup_fd; |
ef9ff354 MD |
468 | } channel; |
469 | struct { | |
74d81a6c MD |
470 | int shm_fd; |
471 | int wakeup_fd; | |
ef9ff354 | 472 | } stream; |
40003310 MD |
473 | struct { |
474 | struct lttng_ust_field_iter entry; | |
475 | } field_list; | |
8e696cfa MD |
476 | struct { |
477 | char *ctxname; | |
478 | } app_context; | |
d8d2416d FD |
479 | struct { |
480 | int event_notifier_notif_fd; | |
481 | } event_notifier_handle; | |
ebabbf58 MD |
482 | struct { |
483 | void *counter_data; | |
484 | } counter; | |
485 | struct { | |
486 | int shm_fd; | |
487 | } counter_shm; | |
ef9ff354 MD |
488 | }; |
489 | ||
b61ce3b2 | 490 | struct lttng_ust_objd_ops { |
ef9ff354 | 491 | long (*cmd)(int objd, unsigned int cmd, unsigned long arg, |
f59ed768 | 492 | union ust_args *args, void *owner); |
46050b1a MD |
493 | int (*release)(int objd); |
494 | }; | |
495 | ||
496 | /* Create root handle. Always ID 0. */ | |
497 | int lttng_abi_create_root_handle(void); | |
498 | ||
b61ce3b2 | 499 | const struct lttng_ust_objd_ops *objd_ops(int id); |
1849ef7c | 500 | int lttng_ust_objd_unref(int id, int is_owner); |
46050b1a MD |
501 | |
502 | void lttng_ust_abi_exit(void); | |
003fedf4 | 503 | void lttng_ust_events_exit(void); |
f59ed768 | 504 | void lttng_ust_objd_table_owner_cleanup(void *owner); |
b35d179d | 505 | |
9f3fdbc6 | 506 | #endif /* _LTTNG_UST_ABI_H */ |