Commit | Line | Data |
---|---|---|
8020ceb5 | 1 | /* |
c0c0989a | 2 | * SPDX-License-Identifier: MIT |
8020ceb5 | 3 | * |
c0c0989a | 4 | * Copyright (C) 2010-2012 Mathieu Desnoyers <mathieu.desnoyers@efficios.com> |
8020ceb5 MD |
5 | * |
6 | * Holds LTTng per-session event registry. | |
8020ceb5 MD |
7 | */ |
8 | ||
c0c0989a MJ |
9 | #ifndef _LTTNG_UST_EVENTS_H |
10 | #define _LTTNG_UST_EVENTS_H | |
11 | ||
9f3fdbc6 | 12 | #include <urcu/list.h> |
1f18504e | 13 | #include <urcu/hlist.h> |
b4051ad8 | 14 | #include <stddef.h> |
9f3fdbc6 | 15 | #include <stdint.h> |
4318ae1b MD |
16 | #include <lttng/ust-abi.h> |
17 | #include <lttng/ust-tracer.h> | |
2ae57758 | 18 | #include <lttng/ust-endian.h> |
20f1eee7 | 19 | #include <float.h> |
d58d1454 MD |
20 | #include <errno.h> |
21 | #include <urcu/ref.h> | |
22 | #include <pthread.h> | |
8020ceb5 | 23 | |
6453d237 MD |
24 | #ifdef __cplusplus |
25 | extern "C" { | |
26 | #endif | |
27 | ||
19d8b1b3 MD |
28 | #define LTTNG_UST_UUID_LEN 16 |
29 | ||
71d31690 MD |
30 | /* |
31 | * Tracepoint provider version. Compatibility based on the major number. | |
32 | * Older tracepoint providers can always register to newer lttng-ust | |
33 | * library, but the opposite is rejected: a newer tracepoint provider is | |
34 | * rejected by an older lttng-ust library. | |
35 | */ | |
04f0b55a | 36 | #define LTTNG_UST_PROVIDER_MAJOR 2 |
71d31690 MD |
37 | #define LTTNG_UST_PROVIDER_MINOR 0 |
38 | ||
e7bc0ef6 | 39 | struct lttng_ust_channel_buffer; |
f69fe5fb | 40 | struct lttng_ust_session; |
4cfec15c | 41 | struct lttng_ust_lib_ring_buffer_ctx; |
25cff019 | 42 | struct lttng_ust_event_field; |
8020ceb5 | 43 | |
37d5e202 MD |
44 | /* |
45 | * Data structures used by tracepoint event declarations, and by the | |
a084756d | 46 | * tracer. |
37d5e202 MD |
47 | */ |
48 | ||
8020ceb5 MD |
49 | /* Type description */ |
50 | ||
a084756d MD |
51 | enum lttng_ust_type { |
52 | lttng_ust_type_integer, | |
53 | lttng_ust_type_string, | |
54 | lttng_ust_type_float, | |
55 | lttng_ust_type_dynamic, | |
56 | lttng_ust_type_enum, | |
57 | lttng_ust_type_array, | |
58 | lttng_ust_type_sequence, | |
59 | lttng_ust_type_struct, | |
60 | NR_LTTNG_UST_TYPE, | |
8020ceb5 MD |
61 | }; |
62 | ||
a084756d MD |
63 | enum lttng_ust_string_encoding { |
64 | lttng_ust_string_encoding_none = 0, | |
65 | lttng_ust_string_encoding_UTF8 = 1, | |
66 | lttng_ust_string_encoding_ASCII = 2, | |
67 | NR_LTTNG_UST_STRING_ENCODING, | |
8020ceb5 MD |
68 | }; |
69 | ||
1a37a873 | 70 | struct lttng_ust_enum_value { |
a6f80644 MD |
71 | unsigned long long value; |
72 | unsigned int signedness:1; | |
73 | }; | |
74 | ||
1a37a873 MD |
75 | enum lttng_ust_enum_entry_option { |
76 | LTTNG_UST_ENUM_ENTRY_OPTION_IS_AUTO = 1U << 0, | |
3e762260 PP |
77 | }; |
78 | ||
891d6b55 MD |
79 | /* |
80 | * Enumeration entry description | |
81 | * | |
82 | * IMPORTANT: this structure is part of the ABI between the probe and | |
83 | * UST. Fields need to be only added at the end, never reordered, never | |
84 | * removed. | |
85 | * | |
86 | * The field @struct_size should be used to determine the size of the | |
87 | * structure. It should be queried before using additional fields added | |
88 | * at the end of the structure. | |
89 | */ | |
90 | ||
91 | struct lttng_ust_enum_entry { | |
92 | uint32_t struct_size; | |
93 | ||
1a37a873 | 94 | struct lttng_ust_enum_value start, end; /* start and end are inclusive */ |
8020ceb5 | 95 | const char *string; |
891d6b55 MD |
96 | unsigned int options; |
97 | ||
98 | /* End of base ABI. Fields below should be used after checking struct_size. */ | |
8020ceb5 MD |
99 | }; |
100 | ||
a084756d MD |
101 | /* |
102 | * struct lttng_ust_type_common is fixed-size. Its children inherits | |
103 | * from it by embedding struct lttng_ust_type_common as its first field. | |
104 | */ | |
105 | struct lttng_ust_type_common { | |
106 | enum lttng_ust_type type; | |
107 | }; | |
108 | ||
109 | struct lttng_ust_type_integer { | |
110 | struct lttng_ust_type_common parent; | |
111 | uint32_t struct_size; | |
8020ceb5 MD |
112 | unsigned int size; /* in bits */ |
113 | unsigned short alignment; /* in bits */ | |
114 | unsigned int signedness:1; | |
115 | unsigned int reverse_byte_order:1; | |
116 | unsigned int base; /* 2, 8, 10, 16, for pretty print */ | |
a084756d MD |
117 | }; |
118 | ||
119 | #define lttng_ust_type_integer_define(_type, _byte_order, _base) \ | |
120 | ((struct lttng_ust_type_common *) __LTTNG_COMPOUND_LITERAL(struct lttng_ust_type_integer, { \ | |
121 | .parent = { \ | |
122 | .type = lttng_ust_type_integer, \ | |
123 | }, \ | |
124 | .struct_size = sizeof(struct lttng_ust_type_integer), \ | |
125 | .size = sizeof(_type) * CHAR_BIT, \ | |
126 | .alignment = lttng_alignof(_type) * CHAR_BIT, \ | |
127 | .signedness = lttng_is_signed_type(_type), \ | |
128 | .reverse_byte_order = _byte_order != BYTE_ORDER, \ | |
129 | .base = _base, \ | |
130 | })) | |
131 | ||
132 | struct lttng_ust_type_float { | |
133 | struct lttng_ust_type_common parent; | |
134 | uint32_t struct_size; | |
135 | unsigned int exp_dig; /* exponent digits, in bits */ | |
136 | unsigned int mant_dig; /* mantissa digits, in bits */ | |
137 | unsigned short alignment; /* in bits */ | |
138 | unsigned int reverse_byte_order:1; | |
8020ceb5 MD |
139 | }; |
140 | ||
d3ed854b MD |
141 | /* |
142 | * Only float and double are supported. long double is not supported at | |
143 | * the moment. | |
144 | */ | |
89080a49 | 145 | #define lttng_ust_float_mant_dig(_type) \ |
20f1eee7 MD |
146 | (sizeof(_type) == sizeof(float) ? FLT_MANT_DIG \ |
147 | : (sizeof(_type) == sizeof(double) ? DBL_MANT_DIG \ | |
d3ed854b | 148 | : 0)) |
20f1eee7 | 149 | |
a084756d MD |
150 | #define lttng_ust_type_float_define(_type) \ |
151 | ((struct lttng_ust_type_common *) __LTTNG_COMPOUND_LITERAL(struct lttng_ust_type_float, { \ | |
152 | .parent = { \ | |
153 | .type = lttng_ust_type_float, \ | |
154 | }, \ | |
155 | .struct_size = sizeof(struct lttng_ust_type_float), \ | |
156 | .exp_dig = sizeof(_type) * CHAR_BIT \ | |
89080a49 MD |
157 | - lttng_ust_float_mant_dig(_type), \ |
158 | .mant_dig = lttng_ust_float_mant_dig(_type), \ | |
a084756d MD |
159 | .alignment = lttng_alignof(_type) * CHAR_BIT, \ |
160 | .reverse_byte_order = BYTE_ORDER != FLOAT_WORD_ORDER, \ | |
161 | })) | |
162 | ||
163 | ||
164 | struct lttng_ust_type_string { | |
165 | struct lttng_ust_type_common parent; | |
166 | uint32_t struct_size; | |
167 | enum lttng_ust_string_encoding encoding; | |
20f1eee7 MD |
168 | }; |
169 | ||
a084756d MD |
170 | struct lttng_ust_type_enum { |
171 | struct lttng_ust_type_common parent; | |
172 | uint32_t struct_size; | |
173 | struct lttng_ust_enum_desc *desc; /* Enumeration mapping */ | |
174 | struct lttng_ust_type_common *container_type; | |
175 | }; | |
176 | ||
177 | struct lttng_ust_type_array { | |
178 | struct lttng_ust_type_common parent; | |
179 | uint32_t struct_size; | |
180 | struct lttng_ust_type_common *elem_type; | |
181 | unsigned int length; /* Num. elems. */ | |
182 | unsigned int alignment; | |
183 | enum lttng_ust_string_encoding encoding; | |
184 | }; | |
185 | ||
186 | struct lttng_ust_type_sequence { | |
187 | struct lttng_ust_type_common parent; | |
188 | uint32_t struct_size; | |
189 | const char *length_name; /* Length field name. */ | |
190 | struct lttng_ust_type_common *elem_type; | |
191 | unsigned int alignment; /* Alignment before elements. */ | |
192 | enum lttng_ust_string_encoding encoding; | |
193 | }; | |
194 | ||
195 | struct lttng_ust_type_struct { | |
196 | struct lttng_ust_type_common parent; | |
197 | uint32_t struct_size; | |
198 | unsigned int nr_fields; | |
199 | struct lttng_ust_event_field **fields; /* Array of pointers to fields. */ | |
200 | unsigned int alignment; | |
8020ceb5 MD |
201 | }; |
202 | ||
891d6b55 MD |
203 | /* |
204 | * Enumeration description | |
205 | * | |
206 | * IMPORTANT: this structure is part of the ABI between the probe and | |
207 | * UST. Fields need to be only added at the end, never reordered, never | |
208 | * removed. | |
209 | * | |
210 | * The field @struct_size should be used to determine the size of the | |
211 | * structure. It should be queried before using additional fields added | |
212 | * at the end of the structure. | |
213 | */ | |
214 | ||
215 | struct lttng_ust_enum_desc { | |
216 | uint32_t struct_size; | |
217 | ||
8020ceb5 | 218 | const char *name; |
a084756d | 219 | struct lttng_ust_enum_entry **entries; |
c785c634 | 220 | unsigned int nr_entries; |
891d6b55 MD |
221 | |
222 | /* End of base ABI. Fields below should be used after checking struct_size. */ | |
8020ceb5 MD |
223 | }; |
224 | ||
180901e6 MD |
225 | /* |
226 | * Event field description | |
227 | * | |
228 | * IMPORTANT: this structure is part of the ABI between the probe and | |
229 | * UST. Fields need to be only added at the end, never reordered, never | |
230 | * removed. | |
25cff019 MD |
231 | * |
232 | * The field @struct_size should be used to determine the size of the | |
233 | * structure. It should be queried before using additional fields added | |
234 | * at the end of the structure. | |
180901e6 | 235 | */ |
8020ceb5 | 236 | |
25cff019 MD |
237 | struct lttng_ust_event_field { |
238 | uint32_t struct_size; | |
239 | ||
8020ceb5 | 240 | const char *name; |
a084756d | 241 | struct lttng_ust_type_common *type; |
25cff019 MD |
242 | unsigned int nowrite:1, /* do not write into trace */ |
243 | nofilter:1; /* do not consider for filter */ | |
244 | ||
245 | /* End of base ABI. Fields below should be used after checking struct_size. */ | |
8020ceb5 MD |
246 | }; |
247 | ||
37d5e202 | 248 | |
dc11f93f MD |
249 | /* |
250 | * IMPORTANT: this structure is part of the ABI between the probe and | |
251 | * UST. Fields need to be only added at the end, never reordered, never | |
252 | * removed. | |
253 | * | |
254 | * The field @struct_size should be used to determine the size of the | |
255 | * structure. It should be queried before using additional fields added | |
256 | * at the end of the structure. | |
257 | */ | |
258 | struct lttng_ust_event_desc { | |
259 | uint32_t struct_size; /* Size of this structure. */ | |
dc177d11 | 260 | |
37d5e202 | 261 | const char *name; |
fbdeb5ec | 262 | void (*probe_callback)(void); |
a084756d MD |
263 | struct lttng_event_ctx *ctx; /* context */ |
264 | struct lttng_ust_event_field **fields; /* event payload */ | |
37d5e202 MD |
265 | unsigned int nr_fields; |
266 | const int **loglevel; | |
dc11f93f MD |
267 | const char *signature; /* Argument types/names received */ |
268 | const char **model_emf_uri; | |
269 | ||
270 | /* End of base ABI. Fields below should be used after checking struct_size. */ | |
37d5e202 MD |
271 | }; |
272 | ||
dc11f93f MD |
273 | /* |
274 | * IMPORTANT: this structure is part of the ABI between the probe and | |
275 | * UST. Fields need to be only added at the end, never reordered, never | |
276 | * removed. | |
277 | * | |
278 | * The field @struct_size should be used to determine the size of the | |
279 | * structure. It should be queried before using additional fields added | |
280 | * at the end of the structure. | |
281 | */ | |
282 | struct lttng_ust_probe_desc { | |
283 | uint32_t struct_size; /* Size of this structure. */ | |
284 | ||
37d5e202 | 285 | const char *provider; |
a084756d | 286 | struct lttng_ust_event_desc **event_desc; |
37d5e202 MD |
287 | unsigned int nr_events; |
288 | struct cds_list_head head; /* chain registered probes */ | |
6715d7d1 MD |
289 | struct cds_list_head lazy_init_head; |
290 | int lazy; /* lazy registration */ | |
71d31690 MD |
291 | uint32_t major; |
292 | uint32_t minor; | |
dc11f93f MD |
293 | |
294 | /* End of base ABI. Fields below should be used after checking struct_size. */ | |
8020ceb5 MD |
295 | }; |
296 | ||
37d5e202 MD |
297 | /* Data structures used by the tracer. */ |
298 | ||
8a92ed2a | 299 | /* |
04aa13f8 | 300 | * Bytecode interpreter return value masks. |
8a92ed2a | 301 | */ |
c7abfd47 MD |
302 | enum lttng_ust_bytecode_interpreter_ret { |
303 | LTTNG_UST_BYTECODE_INTERPRETER_DISCARD = 0, | |
304 | LTTNG_UST_BYTECODE_INTERPRETER_RECORD_FLAG = (1ULL << 0), | |
8a92ed2a MD |
305 | /* Other bits are kept for future use. */ |
306 | }; | |
307 | ||
d37ecb3f | 308 | struct lttng_interpreter_output; |
362a65de | 309 | struct lttng_ust_bytecode_runtime_private; |
d37ecb3f | 310 | |
73d37531 | 311 | /* |
5469a374 MD |
312 | * IMPORTANT: this structure is part of the ABI between the probe and |
313 | * UST. Fields need to be only added at the end, never reordered, never | |
314 | * removed. | |
315 | * | |
316 | * The field @struct_size should be used to determine the size of the | |
317 | * structure. It should be queried before using additional fields added | |
318 | * at the end of the structure. | |
73d37531 | 319 | */ |
5469a374 MD |
320 | struct lttng_ust_bytecode_runtime { |
321 | uint32_t struct_size; /* Size of this structure. */ | |
362a65de | 322 | |
5469a374 | 323 | struct lttng_ust_bytecode_runtime_private *priv; |
f488575f | 324 | /* Associated bytecode */ |
c42416df FD |
325 | union { |
326 | uint64_t (*filter)(void *interpreter_data, | |
327 | const char *interpreter_stack_data); | |
d37ecb3f FD |
328 | uint64_t (*capture)(void *interpreter_data, |
329 | const char *interpreter_stack_data, | |
330 | struct lttng_interpreter_output *interpreter_output); | |
c42416df | 331 | } interpreter_funcs; |
e58095ef | 332 | struct cds_list_head node; /* list of bytecode runtime in event */ |
5469a374 MD |
333 | |
334 | /* End of base ABI. Fields below should be used after checking struct_size. */ | |
e58095ef MD |
335 | }; |
336 | ||
8020ceb5 | 337 | /* |
7dd08bec MD |
338 | * lttng_event structure is referred to by the tracing fast path. It |
339 | * must be kept small. | |
180901e6 MD |
340 | * |
341 | * IMPORTANT: this structure is part of the ABI between the probe and | |
342 | * UST. Fields need to be only added at the end, never reordered, never | |
343 | * removed. | |
8020ceb5 | 344 | */ |
68bb7559 | 345 | |
daacdbfc | 346 | struct lttng_ust_ctx; |
80333dfa MD |
347 | struct lttng_ust_event_common_private; |
348 | ||
808edfc8 MD |
349 | enum lttng_ust_event_type { |
350 | LTTNG_UST_EVENT_TYPE_RECORDER = 0, | |
351 | LTTNG_UST_EVENT_TYPE_NOTIFIER = 1, | |
352 | }; | |
353 | ||
93cfd247 | 354 | /* |
6d35572a MD |
355 | * IMPORTANT: this structure is part of the ABI between the probe and |
356 | * UST. Fields need to be only added at the end, never reordered, never | |
357 | * removed. | |
358 | * | |
93cfd247 MD |
359 | * struct lttng_ust_event_common is the common ancestor of the various |
360 | * public event actions. Inheritance is done by composition: The parent | |
361 | * has a pointer to its child, and the child has a pointer to its | |
362 | * parent. Inheritance of those public structures is done by composition | |
363 | * to ensure both parent and child structures can be extended. | |
364 | * | |
365 | * The field @struct_size should be used to determine the size of the | |
366 | * structure. It should be queried before using additional fields added | |
367 | * at the end of the structure. | |
368 | */ | |
7ee76145 | 369 | struct lttng_ust_event_common { |
80333dfa | 370 | uint32_t struct_size; /* Size of this structure. */ |
dc177d11 | 371 | |
80333dfa MD |
372 | struct lttng_ust_event_common_private *priv; /* Private event interface */ |
373 | ||
808edfc8 | 374 | enum lttng_ust_event_type type; |
ba99fbe2 MD |
375 | void *child; /* Pointer to child, for inheritance by aggregation. */ |
376 | ||
80333dfa MD |
377 | int enabled; |
378 | int has_enablers_without_bytecode; | |
5469a374 | 379 | /* list of struct lttng_ust_bytecode_runtime, sorted by seqnum */ |
80333dfa | 380 | struct cds_list_head filter_bytecode_runtime_head; |
93cfd247 MD |
381 | |
382 | /* End of base ABI. Fields below should be used after checking struct_size. */ | |
80333dfa MD |
383 | }; |
384 | ||
2e70391c | 385 | struct lttng_ust_event_recorder_private; |
68bb7559 | 386 | |
93cfd247 | 387 | /* |
6d35572a MD |
388 | * IMPORTANT: this structure is part of the ABI between the probe and |
389 | * UST. Fields need to be only added at the end, never reordered, never | |
390 | * removed. | |
391 | * | |
93cfd247 MD |
392 | * struct lttng_ust_event_recorder is the action for recording events |
393 | * into a ring buffer. It inherits from struct lttng_ust_event_common | |
394 | * by composition to ensure both parent and child structure are | |
395 | * extensible. | |
396 | * | |
397 | * The field @struct_size should be used to determine the size of the | |
398 | * structure. It should be queried before using additional fields added | |
399 | * at the end of the structure. | |
400 | */ | |
2e70391c MD |
401 | struct lttng_ust_event_recorder { |
402 | uint32_t struct_size; /* Size of this structure. */ | |
dc177d11 | 403 | |
ba99fbe2 | 404 | struct lttng_ust_event_common *parent; /* Inheritance by aggregation. */ |
2e70391c | 405 | struct lttng_ust_event_recorder_private *priv; /* Private event record interface */ |
68bb7559 | 406 | |
8020ceb5 | 407 | unsigned int id; |
e7bc0ef6 | 408 | struct lttng_ust_channel_buffer *chan; |
93cfd247 MD |
409 | |
410 | /* End of base ABI. Fields below should be used after checking struct_size. */ | |
8020ceb5 MD |
411 | }; |
412 | ||
115db533 MD |
413 | struct lttng_ust_event_notifier_private; |
414 | ||
93cfd247 | 415 | /* |
6d35572a MD |
416 | * IMPORTANT: this structure is part of the ABI between the probe and |
417 | * UST. Fields need to be only added at the end, never reordered, never | |
418 | * removed. | |
419 | * | |
93cfd247 MD |
420 | * struct lttng_ust_event_notifier is the action for sending |
421 | * notifications. It inherits from struct lttng_ust_event_common | |
422 | * by composition to ensure both parent and child structure are | |
423 | * extensible. | |
424 | * | |
425 | * The field @struct_size should be used to determine the size of the | |
426 | * structure. It should be queried before using additional fields added | |
427 | * at the end of the structure. | |
428 | */ | |
d7d45c0d | 429 | struct lttng_ust_event_notifier { |
115db533 | 430 | uint32_t struct_size; /* Size of this structure. */ |
105cf2eb | 431 | |
ba99fbe2 | 432 | struct lttng_ust_event_common *parent; /* Inheritance by aggregation. */ |
115db533 MD |
433 | struct lttng_ust_event_notifier_private *priv; /* Private event notifier interface */ |
434 | ||
d7d45c0d | 435 | void (*notification_send)(struct lttng_ust_event_notifier *event_notifier, |
cab88ff8 | 436 | const char *stack_data); |
d37ecb3f | 437 | struct cds_list_head capture_bytecode_runtime_head; |
93cfd247 MD |
438 | |
439 | /* End of base ABI. Fields below should be used after checking struct_size. */ | |
d8d2416d FD |
440 | }; |
441 | ||
5198080d | 442 | struct lttng_ust_lib_ring_buffer_channel; |
a880bae5 | 443 | struct lttng_ust_channel_ops_private; |
8d8a24c8 | 444 | |
180901e6 MD |
445 | /* |
446 | * IMPORTANT: this structure is part of the ABI between the probe and | |
447 | * UST. Fields need to be only added at the end, never reordered, never | |
448 | * removed. | |
49926dbd MD |
449 | * |
450 | * The field @struct_size should be used to determine the size of the | |
451 | * structure. It should be queried before using additional fields added | |
452 | * at the end of the structure. | |
180901e6 | 453 | */ |
49926dbd MD |
454 | struct lttng_ust_channel_ops { |
455 | uint32_t struct_size; | |
456 | ||
a880bae5 MD |
457 | struct lttng_ust_channel_ops_private *priv; /* Private channel ops interface */ |
458 | ||
4cfec15c | 459 | int (*event_reserve)(struct lttng_ust_lib_ring_buffer_ctx *ctx, |
8020ceb5 | 460 | uint32_t event_id); |
4cfec15c | 461 | void (*event_commit)(struct lttng_ust_lib_ring_buffer_ctx *ctx); |
74d81a6c MD |
462 | void (*event_write)(struct lttng_ust_lib_ring_buffer_ctx *ctx, |
463 | const void *src, size_t len); | |
a44c74d9 MD |
464 | void (*event_strcpy)(struct lttng_ust_lib_ring_buffer_ctx *ctx, |
465 | const char *src, size_t len); | |
49926dbd MD |
466 | |
467 | /* End of base ABI. Fields below should be used after checking struct_size. */ | |
8020ceb5 MD |
468 | }; |
469 | ||
e7bc0ef6 MD |
470 | enum lttng_ust_channel_type { |
471 | LTTNG_UST_CHANNEL_TYPE_BUFFER = 0, | |
472 | }; | |
473 | ||
474 | struct lttng_ust_channel_common_private; | |
475 | ||
180901e6 MD |
476 | /* |
477 | * IMPORTANT: this structure is part of the ABI between the probe and | |
478 | * UST. Fields need to be only added at the end, never reordered, never | |
479 | * removed. | |
e7bc0ef6 MD |
480 | * |
481 | * The field @struct_size should be used to determine the size of the | |
482 | * structure. It should be queried before using additional fields added | |
483 | * at the end of the structure. | |
180901e6 | 484 | */ |
e7bc0ef6 MD |
485 | struct lttng_ust_channel_common { |
486 | uint32_t struct_size; /* Size of this structure. */ | |
487 | ||
488 | struct lttng_ust_channel_common_private *priv; /* Private channel interface */ | |
489 | ||
490 | enum lttng_ust_channel_type type; | |
491 | void *child; /* Pointer to child, for inheritance by aggregation. */ | |
492 | ||
976fe9ea | 493 | int enabled; |
f69fe5fb | 494 | struct lttng_ust_session *session; |
e7bc0ef6 MD |
495 | |
496 | /* End of base ABI. Fields below should be used after checking struct_size. */ | |
497 | }; | |
498 | ||
499 | struct lttng_ust_channel_buffer_private; | |
500 | ||
501 | /* | |
502 | * IMPORTANT: this structure is part of the ABI between the probe and | |
503 | * UST. Fields need to be only added at the end, never reordered, never | |
504 | * removed. | |
505 | * | |
506 | * The field @struct_size should be used to determine the size of the | |
507 | * structure. It should be queried before using additional fields added | |
508 | * at the end of the structure. | |
509 | */ | |
510 | struct lttng_ust_channel_buffer { | |
511 | uint32_t struct_size; /* Size of this structure. */ | |
512 | ||
513 | struct lttng_ust_channel_common *parent; /* Inheritance by aggregation. */ | |
514 | struct lttng_ust_channel_buffer_private *priv; /* Private channel buffer interface */ | |
515 | ||
a084756d | 516 | struct lttng_ust_channel_ops *ops; |
e7bc0ef6 MD |
517 | struct lttng_ust_lib_ring_buffer_channel *chan; /* Channel buffers */ |
518 | struct lttng_ust_shm_handle *handle; /* shared-memory handle */ | |
a3f61e7f | 519 | |
e7bc0ef6 | 520 | /* End of base ABI. Fields below should be used after checking struct_size. */ |
8020ceb5 MD |
521 | }; |
522 | ||
2a9d9339 MD |
523 | /* |
524 | * IMPORTANT: this structure is part of the ABI between the probe and | |
525 | * UST. Fields need to be only added at the end, never reordered, never | |
526 | * removed. | |
527 | * | |
528 | * The field @struct_size should be used to determine the size of the | |
529 | * structure. It should be queried before using additional fields added | |
530 | * at the end of the structure. | |
531 | */ | |
532 | struct lttng_ust_stack_ctx { | |
533 | uint32_t struct_size; /* Size of this structure */ | |
534 | ||
2e70391c | 535 | struct lttng_ust_event_recorder *event_recorder; |
2a9d9339 MD |
536 | |
537 | /* End of base ABI. Fields below should be used after checking struct_size. */ | |
53569322 MD |
538 | }; |
539 | ||
bdb12629 MD |
540 | struct lttng_ust_session_private; |
541 | ||
180901e6 MD |
542 | /* |
543 | * IMPORTANT: this structure is part of the ABI between the probe and | |
544 | * UST. Fields need to be only added at the end, never reordered, never | |
545 | * removed. | |
6d35572a MD |
546 | * |
547 | * The field @struct_size should be used to determine the size of the | |
548 | * structure. It should be queried before using additional fields added | |
549 | * at the end of the structure. | |
180901e6 | 550 | */ |
f69fe5fb | 551 | struct lttng_ust_session { |
bd640d74 | 552 | uint32_t struct_size; /* Size of this structure */ |
dc177d11 | 553 | |
bdb12629 MD |
554 | struct lttng_ust_session_private *priv; /* Private session interface */ |
555 | ||
e58095ef | 556 | int active; /* Is trace session active ? */ |
6d35572a MD |
557 | |
558 | /* End of base ABI. Fields below should be used after checking struct_size. */ | |
8020ceb5 MD |
559 | }; |
560 | ||
dc11f93f MD |
561 | int lttng_ust_probe_register(struct lttng_ust_probe_desc *desc); |
562 | void lttng_ust_probe_unregister(struct lttng_ust_probe_desc *desc); | |
9f3fdbc6 | 563 | |
fc80554e | 564 | /* |
0af0bdb2 MJ |
565 | * Applications that change their procname and need the new value to be |
566 | * reflected in the procname event context have to call this function to clear | |
567 | * the internally cached value. This should not be called from a signal | |
568 | * handler. | |
fc80554e | 569 | */ |
0af0bdb2 | 570 | void lttng_ust_context_procname_reset(void); |
d58d1454 | 571 | |
6453d237 MD |
572 | #ifdef __cplusplus |
573 | } | |
574 | #endif | |
575 | ||
51489cad | 576 | #endif /* _LTTNG_UST_EVENTS_H */ |