Commit | Line | Data |
---|---|---|
51489cad MD |
1 | #ifndef _LTTNG_UST_EVENTS_H |
2 | #define _LTTNG_UST_EVENTS_H | |
8020ceb5 MD |
3 | |
4 | /* | |
51489cad | 5 | * lttng/ust-events.h |
8020ceb5 | 6 | * |
e92f3e28 | 7 | * Copyright 2010-2012 (c) - Mathieu Desnoyers <mathieu.desnoyers@efficios.com> |
8020ceb5 MD |
8 | * |
9 | * Holds LTTng per-session event registry. | |
10 | * | |
e92f3e28 MD |
11 | * Permission is hereby granted, free of charge, to any person obtaining a copy |
12 | * of this software and associated documentation files (the "Software"), to deal | |
13 | * in the Software without restriction, including without limitation the rights | |
14 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
15 | * copies of the Software, and to permit persons to whom the Software is | |
16 | * furnished to do so, subject to the following conditions: | |
a60d70e6 | 17 | * |
e92f3e28 MD |
18 | * The above copyright notice and this permission notice shall be included in |
19 | * all copies or substantial portions of the Software. | |
8020ceb5 MD |
20 | */ |
21 | ||
9f3fdbc6 | 22 | #include <urcu/list.h> |
1f18504e | 23 | #include <urcu/hlist.h> |
9f3fdbc6 | 24 | #include <stdint.h> |
4318ae1b MD |
25 | #include <lttng/ust-abi.h> |
26 | #include <lttng/ust-tracer.h> | |
2ae57758 | 27 | #include <lttng/ust-endian.h> |
20f1eee7 | 28 | #include <float.h> |
8020ceb5 | 29 | |
19d8b1b3 MD |
30 | #define LTTNG_UST_UUID_LEN 16 |
31 | ||
8020ceb5 MD |
32 | struct ltt_channel; |
33 | struct ltt_session; | |
4cfec15c | 34 | struct lttng_ust_lib_ring_buffer_ctx; |
8020ceb5 | 35 | |
37d5e202 MD |
36 | /* |
37 | * Data structures used by tracepoint event declarations, and by the | |
38 | * tracer. Those structures have padding for future extension. | |
39 | */ | |
40 | ||
c1fca457 MD |
41 | /* |
42 | * LTTng client type enumeration. Used by the consumer to map the | |
43 | * callbacks from its own address space. | |
44 | */ | |
45 | enum lttng_client_types { | |
46 | LTTNG_CLIENT_METADATA = 0, | |
47 | LTTNG_CLIENT_DISCARD = 1, | |
48 | LTTNG_CLIENT_OVERWRITE = 2, | |
49 | LTTNG_NR_CLIENT_TYPES, | |
50 | }; | |
51 | ||
8020ceb5 MD |
52 | /* Type description */ |
53 | ||
54 | /* Update the astract_types name table in lttng-types.c along with this enum */ | |
55 | enum abstract_types { | |
56 | atype_integer, | |
57 | atype_enum, | |
58 | atype_array, | |
59 | atype_sequence, | |
60 | atype_string, | |
20f1eee7 | 61 | atype_float, |
8020ceb5 MD |
62 | NR_ABSTRACT_TYPES, |
63 | }; | |
64 | ||
65 | /* Update the string_encodings name table in lttng-types.c along with this enum */ | |
66 | enum lttng_string_encodings { | |
67 | lttng_encode_none = 0, | |
68 | lttng_encode_UTF8 = 1, | |
69 | lttng_encode_ASCII = 2, | |
70 | NR_STRING_ENCODINGS, | |
71 | }; | |
72 | ||
37d5e202 | 73 | #define LTTNG_UST_ENUM_ENTRY_PADDING 16 |
8020ceb5 MD |
74 | struct lttng_enum_entry { |
75 | unsigned long long start, end; /* start and end are inclusive */ | |
76 | const char *string; | |
37d5e202 | 77 | char padding[LTTNG_UST_ENUM_ENTRY_PADDING]; |
8020ceb5 MD |
78 | }; |
79 | ||
80 | #define __type_integer(_type, _byte_order, _base, _encoding) \ | |
81 | { \ | |
82 | .atype = atype_integer, \ | |
83 | .u.basic.integer = \ | |
84 | { \ | |
85 | .size = sizeof(_type) * CHAR_BIT, \ | |
1dbfff0c MD |
86 | .alignment = lttng_alignof(_type) * CHAR_BIT, \ |
87 | .signedness = lttng_is_signed_type(_type), \ | |
8d1d746f | 88 | .reverse_byte_order = _byte_order != BYTE_ORDER, \ |
8020ceb5 MD |
89 | .base = _base, \ |
90 | .encoding = lttng_encode_##_encoding, \ | |
91 | }, \ | |
92 | } \ | |
93 | ||
37d5e202 | 94 | #define LTTNG_UST_INTEGER_TYPE_PADDING 24 |
8020ceb5 MD |
95 | struct lttng_integer_type { |
96 | unsigned int size; /* in bits */ | |
97 | unsigned short alignment; /* in bits */ | |
98 | unsigned int signedness:1; | |
99 | unsigned int reverse_byte_order:1; | |
100 | unsigned int base; /* 2, 8, 10, 16, for pretty print */ | |
101 | enum lttng_string_encodings encoding; | |
37d5e202 | 102 | char padding[LTTNG_UST_INTEGER_TYPE_PADDING]; |
8020ceb5 MD |
103 | }; |
104 | ||
d3ed854b MD |
105 | /* |
106 | * Only float and double are supported. long double is not supported at | |
107 | * the moment. | |
108 | */ | |
20f1eee7 MD |
109 | #define _float_mant_dig(_type) \ |
110 | (sizeof(_type) == sizeof(float) ? FLT_MANT_DIG \ | |
111 | : (sizeof(_type) == sizeof(double) ? DBL_MANT_DIG \ | |
d3ed854b | 112 | : 0)) |
20f1eee7 MD |
113 | |
114 | #define __type_float(_type) \ | |
115 | { \ | |
116 | .atype = atype_float, \ | |
117 | .u.basic._float = \ | |
118 | { \ | |
119 | .exp_dig = sizeof(_type) * CHAR_BIT \ | |
120 | - _float_mant_dig(_type), \ | |
121 | .mant_dig = _float_mant_dig(_type), \ | |
1dbfff0c | 122 | .alignment = lttng_alignof(_type) * CHAR_BIT, \ |
ad496c21 | 123 | .reverse_byte_order = BYTE_ORDER != FLOAT_WORD_ORDER, \ |
20f1eee7 MD |
124 | }, \ |
125 | } \ | |
126 | ||
37d5e202 | 127 | #define LTTNG_UST_FLOAT_TYPE_PADDING 24 |
20f1eee7 MD |
128 | struct lttng_float_type { |
129 | unsigned int exp_dig; /* exponent digits, in bits */ | |
130 | unsigned int mant_dig; /* mantissa digits, in bits */ | |
131 | unsigned short alignment; /* in bits */ | |
132 | unsigned int reverse_byte_order:1; | |
37d5e202 | 133 | char padding[LTTNG_UST_FLOAT_TYPE_PADDING]; |
20f1eee7 MD |
134 | }; |
135 | ||
37d5e202 | 136 | #define LTTNG_UST_BASIC_TYPE_PADDING 128 |
8020ceb5 MD |
137 | union _lttng_basic_type { |
138 | struct lttng_integer_type integer; | |
139 | struct { | |
140 | const char *name; | |
141 | } enumeration; | |
142 | struct { | |
143 | enum lttng_string_encodings encoding; | |
144 | } string; | |
20f1eee7 | 145 | struct lttng_float_type _float; |
37d5e202 | 146 | char padding[LTTNG_UST_BASIC_TYPE_PADDING]; |
8020ceb5 MD |
147 | }; |
148 | ||
149 | struct lttng_basic_type { | |
150 | enum abstract_types atype; | |
151 | union { | |
152 | union _lttng_basic_type basic; | |
153 | } u; | |
154 | }; | |
155 | ||
37d5e202 | 156 | #define LTTNG_UST_TYPE_PADDING 128 |
8020ceb5 MD |
157 | struct lttng_type { |
158 | enum abstract_types atype; | |
159 | union { | |
160 | union _lttng_basic_type basic; | |
161 | struct { | |
162 | struct lttng_basic_type elem_type; | |
163 | unsigned int length; /* num. elems. */ | |
164 | } array; | |
165 | struct { | |
166 | struct lttng_basic_type length_type; | |
167 | struct lttng_basic_type elem_type; | |
168 | } sequence; | |
37d5e202 | 169 | char padding[LTTNG_UST_TYPE_PADDING]; |
8020ceb5 MD |
170 | } u; |
171 | }; | |
172 | ||
37d5e202 | 173 | #define LTTNG_UST_ENUM_TYPE_PADDING 24 |
8020ceb5 MD |
174 | struct lttng_enum { |
175 | const char *name; | |
176 | struct lttng_type container_type; | |
177 | const struct lttng_enum_entry *entries; | |
23c8854a | 178 | unsigned int len; |
37d5e202 | 179 | char padding[LTTNG_UST_ENUM_TYPE_PADDING]; |
8020ceb5 MD |
180 | }; |
181 | ||
180901e6 MD |
182 | /* |
183 | * Event field description | |
184 | * | |
185 | * IMPORTANT: this structure is part of the ABI between the probe and | |
186 | * UST. Fields need to be only added at the end, never reordered, never | |
187 | * removed. | |
188 | */ | |
8020ceb5 | 189 | |
4774c8f3 | 190 | #define LTTNG_UST_EVENT_FIELD_PADDING 28 |
8020ceb5 MD |
191 | struct lttng_event_field { |
192 | const char *name; | |
193 | struct lttng_type type; | |
180901e6 | 194 | unsigned int nowrite; /* do not write into trace */ |
37d5e202 | 195 | char padding[LTTNG_UST_EVENT_FIELD_PADDING]; |
8020ceb5 MD |
196 | }; |
197 | ||
37d5e202 | 198 | #define LTTNG_UST_CTX_FIELD_PADDING 40 |
8020ceb5 MD |
199 | struct lttng_ctx_field { |
200 | struct lttng_event_field event_field; | |
201 | size_t (*get_size)(size_t offset); | |
202 | void (*record)(struct lttng_ctx_field *field, | |
4cfec15c | 203 | struct lttng_ust_lib_ring_buffer_ctx *ctx, |
8020ceb5 MD |
204 | struct ltt_channel *chan); |
205 | union { | |
37d5e202 | 206 | char padding[LTTNG_UST_CTX_FIELD_PADDING]; |
8020ceb5 MD |
207 | } u; |
208 | void (*destroy)(struct lttng_ctx_field *field); | |
209 | }; | |
210 | ||
37d5e202 | 211 | #define LTTNG_UST_CTX_PADDING 24 |
8020ceb5 MD |
212 | struct lttng_ctx { |
213 | struct lttng_ctx_field *fields; | |
214 | unsigned int nr_fields; | |
215 | unsigned int allocated_fields; | |
37d5e202 MD |
216 | char padding[LTTNG_UST_CTX_PADDING]; |
217 | }; | |
218 | ||
219 | #define LTTNG_UST_EVENT_DESC_PADDING 40 | |
220 | struct lttng_event_desc { | |
221 | const char *name; | |
fbdeb5ec | 222 | void (*probe_callback)(void); |
37d5e202 MD |
223 | const struct lttng_event_ctx *ctx; /* context */ |
224 | const struct lttng_event_field *fields; /* event payload */ | |
225 | unsigned int nr_fields; | |
226 | const int **loglevel; | |
68755429 | 227 | const char *signature; /* Argument types/names received */ |
6ddc916d MD |
228 | union { |
229 | struct { | |
230 | const char **model_emf_uri; | |
231 | } ext; | |
232 | char padding[LTTNG_UST_EVENT_DESC_PADDING]; | |
233 | } u; | |
37d5e202 MD |
234 | }; |
235 | ||
236 | #define LTTNG_UST_PROBE_DESC_PADDING 40 | |
237 | struct lttng_probe_desc { | |
238 | const char *provider; | |
239 | const struct lttng_event_desc **event_desc; | |
240 | unsigned int nr_events; | |
241 | struct cds_list_head head; /* chain registered probes */ | |
242 | char padding[LTTNG_UST_PROBE_DESC_PADDING]; | |
8020ceb5 MD |
243 | }; |
244 | ||
37d5e202 MD |
245 | /* Data structures used by the tracer. */ |
246 | ||
e6c12e3d MD |
247 | /* |
248 | * Entry describing a per-session active wildcard, along with the event | |
249 | * attribute and channel information configuring the events that need to | |
250 | * be enabled. | |
251 | */ | |
252 | struct session_wildcard { | |
253 | struct ltt_channel *chan; | |
254 | struct lttng_ctx *ctx; /* TODO */ | |
255 | struct lttng_ust_event event_param; | |
256 | struct cds_list_head events; /* list of events enabled */ | |
257 | struct cds_list_head list; /* per-session list of wildcards */ | |
51c5df09 | 258 | struct cds_list_head session_list; /* node of session wildcard list */ |
e6c12e3d | 259 | struct wildcard_entry *entry; |
f488575f MD |
260 | /* list of struct lttng_ust_filter_bytecode_node */ |
261 | struct cds_list_head filter_bytecode; | |
e6c12e3d MD |
262 | unsigned int enabled:1; |
263 | }; | |
264 | ||
265 | /* | |
266 | * Entry describing an active wildcard (per name) for all sessions. | |
267 | */ | |
268 | struct wildcard_entry { | |
51c5df09 | 269 | /* node of global wildcards list */ |
e6c12e3d | 270 | struct cds_list_head list; |
51c5df09 | 271 | /* head of session list to which this wildcard apply */ |
e6c12e3d | 272 | struct cds_list_head session_list; |
457a6b58 | 273 | enum lttng_ust_loglevel_type loglevel_type; |
f488575f MD |
274 | /* list of struct lttng_ust_filter_bytecode_node */ |
275 | struct cds_list_head filter_bytecode; | |
457a6b58 | 276 | int loglevel; |
e6c12e3d MD |
277 | char name[0]; |
278 | }; | |
279 | ||
c8fcf224 MD |
280 | struct tp_list_entry { |
281 | struct lttng_ust_tracepoint_iter tp; | |
282 | struct cds_list_head head; | |
283 | }; | |
284 | ||
285 | struct lttng_ust_tracepoint_list { | |
286 | struct tp_list_entry *iter; | |
287 | struct cds_list_head head; | |
8020ceb5 MD |
288 | }; |
289 | ||
06d4f27e MD |
290 | struct tp_field_list_entry { |
291 | struct lttng_ust_field_iter field; | |
292 | struct cds_list_head head; | |
293 | }; | |
294 | ||
295 | struct lttng_ust_field_list { | |
296 | struct tp_field_list_entry *iter; | |
297 | struct cds_list_head head; | |
298 | }; | |
299 | ||
8165c8da | 300 | struct ust_pending_probe; |
fbdeb5ec | 301 | struct ltt_event; |
f488575f MD |
302 | |
303 | struct lttng_ust_filter_bytecode_node { | |
304 | struct cds_list_head node; | |
305 | struct lttng_ust_filter_bytecode bc; | |
306 | }; | |
307 | ||
308 | struct lttng_bytecode_runtime { | |
309 | /* Associated bytecode */ | |
310 | struct lttng_ust_filter_bytecode_node *bc; | |
311 | int (*filter)(void *filter_data, const char *filter_stack_data); | |
312 | struct cds_list_head node; | |
313 | }; | |
8165c8da | 314 | |
8020ceb5 MD |
315 | /* |
316 | * ltt_event structure is referred to by the tracing fast path. It must be | |
317 | * kept small. | |
180901e6 MD |
318 | * |
319 | * IMPORTANT: this structure is part of the ABI between the probe and | |
320 | * UST. Fields need to be only added at the end, never reordered, never | |
321 | * removed. | |
8020ceb5 MD |
322 | */ |
323 | struct ltt_event { | |
180901e6 | 324 | /* LTTng-UST 2.0 starts here */ |
8020ceb5 MD |
325 | unsigned int id; |
326 | struct ltt_channel *chan; | |
976fe9ea | 327 | int enabled; |
8020ceb5 | 328 | const struct lttng_event_desc *desc; |
f488575f | 329 | void *filter_unused; |
8020ceb5 | 330 | struct lttng_ctx *ctx; |
9f3fdbc6 | 331 | enum lttng_ust_instrumentation instrumentation; |
8020ceb5 | 332 | union { |
8020ceb5 | 333 | } u; |
9f3fdbc6 | 334 | struct cds_list_head list; /* Event list */ |
e6c12e3d | 335 | struct cds_list_head wildcard_list; /* Event list for wildcard */ |
8165c8da | 336 | struct ust_pending_probe *pending_probe; |
7c2caf2b | 337 | unsigned int metadata_dumped:1; |
180901e6 | 338 | /* LTTng-UST 2.1 starts here */ |
f488575f MD |
339 | /* list of struct lttng_ust_filter_bytecode_node */ |
340 | struct cds_list_head filter_bytecode; | |
341 | /* list of struct lttng_bytecode_runtime */ | |
342 | struct cds_list_head bytecode_runtime; | |
8020ceb5 MD |
343 | }; |
344 | ||
8d8a24c8 | 345 | struct channel; |
38fae1d3 | 346 | struct lttng_ust_shm_handle; |
8d8a24c8 | 347 | |
180901e6 MD |
348 | /* |
349 | * IMPORTANT: this structure is part of the ABI between the probe and | |
350 | * UST. Fields need to be only added at the end, never reordered, never | |
351 | * removed. | |
352 | */ | |
8020ceb5 | 353 | struct ltt_channel_ops { |
1d498196 | 354 | struct ltt_channel *(*channel_create)(const char *name, |
8020ceb5 MD |
355 | void *buf_addr, |
356 | size_t subbuf_size, size_t num_subbuf, | |
357 | unsigned int switch_timer_interval, | |
193183fb | 358 | unsigned int read_timer_interval, |
ef9ff354 MD |
359 | int **shm_fd, int **wait_fd, |
360 | uint64_t **memory_map_size, | |
d028eddb | 361 | struct ltt_channel *chan_priv_init); |
1d498196 | 362 | void (*channel_destroy)(struct ltt_channel *ltt_chan); |
4cfec15c | 363 | struct lttng_ust_lib_ring_buffer *(*buffer_read_open)(struct channel *chan, |
38fae1d3 | 364 | struct lttng_ust_shm_handle *handle, |
ef9ff354 MD |
365 | int **shm_fd, int **wait_fd, |
366 | uint64_t **memory_map_size); | |
4cfec15c | 367 | void (*buffer_read_close)(struct lttng_ust_lib_ring_buffer *buf, |
38fae1d3 | 368 | struct lttng_ust_shm_handle *handle); |
4cfec15c | 369 | int (*event_reserve)(struct lttng_ust_lib_ring_buffer_ctx *ctx, |
8020ceb5 | 370 | uint32_t event_id); |
4cfec15c MD |
371 | void (*event_commit)(struct lttng_ust_lib_ring_buffer_ctx *ctx); |
372 | void (*event_write)(struct lttng_ust_lib_ring_buffer_ctx *ctx, const void *src, | |
8020ceb5 MD |
373 | size_t len); |
374 | /* | |
375 | * packet_avail_size returns the available size in the current | |
376 | * packet. Note that the size returned is only a hint, since it | |
377 | * may change due to concurrent writes. | |
378 | */ | |
1d498196 | 379 | size_t (*packet_avail_size)(struct channel *chan, |
38fae1d3 | 380 | struct lttng_ust_shm_handle *handle); |
9f3fdbc6 MD |
381 | //wait_queue_head_t *(*get_reader_wait_queue)(struct channel *chan); |
382 | //wait_queue_head_t *(*get_hp_wait_queue)(struct channel *chan); | |
8020ceb5 MD |
383 | int (*is_finalized)(struct channel *chan); |
384 | int (*is_disabled)(struct channel *chan); | |
38fae1d3 | 385 | int (*flush_buffer)(struct channel *chan, struct lttng_ust_shm_handle *handle); |
8020ceb5 MD |
386 | }; |
387 | ||
180901e6 MD |
388 | /* |
389 | * IMPORTANT: this structure is part of the ABI between the probe and | |
390 | * UST. Fields need to be only added at the end, never reordered, never | |
391 | * removed. | |
392 | */ | |
8020ceb5 | 393 | struct ltt_channel { |
a3f61e7f MD |
394 | /* |
395 | * The pointers located in this private data are NOT safe to be | |
396 | * dereferenced by the consumer. The only operations the | |
397 | * consumer process is designed to be allowed to do is to read | |
398 | * and perform subbuffer flush. | |
399 | */ | |
8020ceb5 | 400 | struct channel *chan; /* Channel buffers */ |
976fe9ea | 401 | int enabled; |
8020ceb5 MD |
402 | struct lttng_ctx *ctx; |
403 | /* Event ID management */ | |
404 | struct ltt_session *session; | |
0a42beb6 | 405 | int objd; /* Object associated to channel */ |
8020ceb5 | 406 | unsigned int free_event_id; /* Next event ID to allocate */ |
8165c8da | 407 | unsigned int used_event_id; /* Max allocated event IDs */ |
9f3fdbc6 | 408 | struct cds_list_head list; /* Channel list */ |
8020ceb5 MD |
409 | struct ltt_channel_ops *ops; |
410 | int header_type; /* 0: unset, 1: compact, 2: large */ | |
38fae1d3 | 411 | struct lttng_ust_shm_handle *handle; /* shared-memory handle */ |
7c2caf2b | 412 | unsigned int metadata_dumped:1; |
a3f61e7f MD |
413 | |
414 | /* Channel ID, available for consumer too */ | |
415 | unsigned int id; | |
416 | /* Copy of session UUID for consumer (availability through shm) */ | |
19d8b1b3 | 417 | unsigned char uuid[LTTNG_UST_UUID_LEN]; /* Trace session unique ID */ |
8020ceb5 MD |
418 | }; |
419 | ||
180901e6 MD |
420 | /* |
421 | * IMPORTANT: this structure is part of the ABI between the probe and | |
422 | * UST. Fields need to be only added at the end, never reordered, never | |
423 | * removed. | |
424 | */ | |
8020ceb5 MD |
425 | struct ltt_session { |
426 | int active; /* Is trace session active ? */ | |
427 | int been_active; /* Has trace session been active ? */ | |
0a42beb6 | 428 | int objd; /* Object associated to session */ |
8020ceb5 | 429 | struct ltt_channel *metadata; /* Metadata channel */ |
9f3fdbc6 MD |
430 | struct cds_list_head chan; /* Channel list head */ |
431 | struct cds_list_head events; /* Event list head */ | |
e6c12e3d | 432 | struct cds_list_head wildcards; /* Wildcard list head */ |
9f3fdbc6 | 433 | struct cds_list_head list; /* Session list */ |
8020ceb5 | 434 | unsigned int free_chan_id; /* Next chan ID to allocate */ |
19d8b1b3 | 435 | unsigned char uuid[LTTNG_UST_UUID_LEN]; /* Trace session unique ID */ |
7c2caf2b | 436 | unsigned int metadata_dumped:1; |
8020ceb5 MD |
437 | }; |
438 | ||
439 | struct ltt_transport { | |
440 | char *name; | |
9f3fdbc6 | 441 | struct cds_list_head node; |
8020ceb5 MD |
442 | struct ltt_channel_ops ops; |
443 | }; | |
444 | ||
445 | struct ltt_session *ltt_session_create(void); | |
976fe9ea MD |
446 | int ltt_session_enable(struct ltt_session *session); |
447 | int ltt_session_disable(struct ltt_session *session); | |
8020ceb5 MD |
448 | void ltt_session_destroy(struct ltt_session *session); |
449 | ||
450 | struct ltt_channel *ltt_channel_create(struct ltt_session *session, | |
451 | const char *transport_name, | |
452 | void *buf_addr, | |
453 | size_t subbuf_size, size_t num_subbuf, | |
454 | unsigned int switch_timer_interval, | |
193183fb | 455 | unsigned int read_timer_interval, |
ef9ff354 MD |
456 | int **shm_fd, int **wait_fd, |
457 | uint64_t **memory_map_size, | |
d028eddb | 458 | struct ltt_channel *chan_priv_init); |
8020ceb5 MD |
459 | struct ltt_channel *ltt_global_channel_create(struct ltt_session *session, |
460 | int overwrite, void *buf_addr, | |
461 | size_t subbuf_size, size_t num_subbuf, | |
462 | unsigned int switch_timer_interval, | |
193183fb | 463 | unsigned int read_timer_interval, |
ef9ff354 MD |
464 | int **shm_fd, int **wait_fd, |
465 | uint64_t **memory_map_size); | |
8020ceb5 | 466 | |
576599a0 MD |
467 | int ltt_event_create(struct ltt_channel *chan, |
468 | struct lttng_ust_event *event_param, | |
576599a0 | 469 | struct ltt_event **event); |
8020ceb5 | 470 | |
976fe9ea MD |
471 | int ltt_channel_enable(struct ltt_channel *channel); |
472 | int ltt_channel_disable(struct ltt_channel *channel); | |
473 | int ltt_event_enable(struct ltt_event *event); | |
474 | int ltt_event_disable(struct ltt_event *event); | |
475 | ||
8020ceb5 MD |
476 | void ltt_transport_register(struct ltt_transport *transport); |
477 | void ltt_transport_unregister(struct ltt_transport *transport); | |
478 | ||
4b4de73e | 479 | void synchronize_trace(void); |
8020ceb5 MD |
480 | |
481 | int ltt_probe_register(struct lttng_probe_desc *desc); | |
482 | void ltt_probe_unregister(struct lttng_probe_desc *desc); | |
8165c8da | 483 | int pending_probe_fix_events(const struct lttng_event_desc *desc); |
8020ceb5 MD |
484 | const struct lttng_event_desc *ltt_event_get(const char *name); |
485 | void ltt_event_put(const struct lttng_event_desc *desc); | |
486 | int ltt_probes_init(void); | |
487 | void ltt_probes_exit(void); | |
8173ec7c MD |
488 | int lttng_find_context(struct lttng_ctx *ctx, const char *name); |
489 | struct lttng_ctx_field *lttng_append_context(struct lttng_ctx **ctx_p); | |
490 | void lttng_remove_context_field(struct lttng_ctx **ctx_p, | |
8020ceb5 MD |
491 | struct lttng_ctx_field *field); |
492 | void lttng_destroy_context(struct lttng_ctx *ctx); | |
3b402b40 | 493 | int lttng_add_vtid_to_ctx(struct lttng_ctx **ctx); |
c1ef86f0 | 494 | int lttng_add_vpid_to_ctx(struct lttng_ctx **ctx); |
8173ec7c | 495 | int lttng_add_pthread_id_to_ctx(struct lttng_ctx **ctx); |
4847e9bb | 496 | int lttng_add_procname_to_ctx(struct lttng_ctx **ctx); |
a93bfc45 | 497 | void lttng_context_vtid_reset(void); |
c1ef86f0 | 498 | void lttng_context_vpid_reset(void); |
9f3fdbc6 | 499 | |
5a821cd6 MD |
500 | extern const struct lttng_ust_lib_ring_buffer_client_cb *lttng_client_callbacks_metadata; |
501 | extern const struct lttng_ust_lib_ring_buffer_client_cb *lttng_client_callbacks_discard; | |
502 | extern const struct lttng_ust_lib_ring_buffer_client_cb *lttng_client_callbacks_overwrite; | |
c1fca457 | 503 | |
c1fca457 MD |
504 | struct ltt_transport *ltt_transport_find(const char *name); |
505 | ||
c8fcf224 MD |
506 | int ltt_probes_get_event_list(struct lttng_ust_tracepoint_list *list); |
507 | void ltt_probes_prune_event_list(struct lttng_ust_tracepoint_list *list); | |
508 | struct lttng_ust_tracepoint_iter * | |
509 | lttng_ust_tracepoint_list_get_iter_next(struct lttng_ust_tracepoint_list *list); | |
06d4f27e MD |
510 | int ltt_probes_get_field_list(struct lttng_ust_field_list *list); |
511 | void ltt_probes_prune_field_list(struct lttng_ust_field_list *list); | |
512 | struct lttng_ust_field_iter * | |
513 | lttng_ust_field_list_get_iter_next(struct lttng_ust_field_list *list); | |
c8fcf224 | 514 | |
e6c12e3d MD |
515 | int ltt_wildcard_enable(struct session_wildcard *wildcard); |
516 | int ltt_wildcard_disable(struct session_wildcard *wildcard); | |
517 | int ltt_wildcard_create(struct ltt_channel *chan, | |
518 | struct lttng_ust_event *event_param, | |
519 | struct session_wildcard **sl); | |
457a6b58 MD |
520 | int ltt_loglevel_match(const struct lttng_event_desc *desc, |
521 | enum lttng_ust_loglevel_type req_type, | |
522 | int req_loglevel); | |
523 | void ltt_probes_create_wildcard_events(struct wildcard_entry *entry, | |
524 | struct session_wildcard *wildcard); | |
2d78951a | 525 | int lttng_filter_event_attach_bytecode(struct ltt_event *event, |
f488575f | 526 | struct lttng_ust_filter_bytecode_node *filter); |
2d78951a | 527 | int lttng_filter_wildcard_attach_bytecode(struct session_wildcard *wildcard, |
f488575f MD |
528 | struct lttng_ust_filter_bytecode_node *filter); |
529 | void lttng_filter_event_link_bytecode(struct ltt_event *event); | |
530 | void lttng_filter_event_link_wildcard_bytecode(struct ltt_event *event, | |
531 | struct session_wildcard *wildcard); | |
2d78951a | 532 | void lttng_filter_wildcard_link_bytecode(struct session_wildcard *wildcard); |
f488575f MD |
533 | void lttng_free_event_filter_bytecode(struct ltt_event *event); |
534 | void lttng_free_wildcard_filter_bytecode(struct session_wildcard *wildcard); | |
535 | void lttng_free_event_filter_runtime(struct ltt_event *event); | |
e6c12e3d | 536 | |
51489cad | 537 | #endif /* _LTTNG_UST_EVENTS_H */ |