Commit | Line | Data |
---|---|---|
d871c65b | 1 | /* |
c0c0989a | 2 | * SPDX-License-Identifier: MIT |
d871c65b | 3 | * |
c0c0989a | 4 | * Copyright 2019 (c) Francis Deslauriers <francis.deslauriers@efficios.com> |
d871c65b FD |
5 | */ |
6 | ||
c0c0989a MJ |
7 | #ifndef _LTTNG_UST_EVENTS_INTERNAL_H |
8 | #define _LTTNG_UST_EVENTS_INTERNAL_H | |
9 | ||
d871c65b FD |
10 | #include <stdint.h> |
11 | ||
12 | #include <urcu/list.h> | |
13 | #include <urcu/hlist.h> | |
14 | ||
d871c65b FD |
15 | #include <lttng/ust-events.h> |
16 | ||
fa194c41 | 17 | #include "ust-context-provider.h" |
fd17d7ce MD |
18 | |
19 | struct lttng_ust_abi_obj; | |
20 | ||
21 | union lttng_ust_abi_args { | |
22 | struct { | |
23 | void *chan_data; | |
24 | int wakeup_fd; | |
25 | } channel; | |
26 | struct { | |
27 | int shm_fd; | |
28 | int wakeup_fd; | |
29 | } stream; | |
30 | struct { | |
31 | struct lttng_ust_abi_field_iter entry; | |
32 | } field_list; | |
33 | struct { | |
34 | char *ctxname; | |
35 | } app_context; | |
36 | struct { | |
37 | int event_notifier_notif_fd; | |
38 | } event_notifier_handle; | |
39 | struct { | |
40 | void *counter_data; | |
41 | } counter; | |
42 | struct { | |
43 | int shm_fd; | |
44 | } counter_shm; | |
45 | }; | |
46 | ||
47 | struct lttng_ust_abi_objd_ops { | |
48 | long (*cmd)(int objd, unsigned int cmd, unsigned long arg, | |
49 | union lttng_ust_abi_args *args, void *owner); | |
50 | int (*release)(int objd); | |
51 | }; | |
52 | ||
8665f6a4 MJ |
53 | enum lttng_enabler_format_type { |
54 | LTTNG_ENABLER_FORMAT_STAR_GLOB, | |
55 | LTTNG_ENABLER_FORMAT_EVENT, | |
56 | }; | |
57 | ||
58 | /* | |
59 | * Enabler field, within whatever object is enabling an event. Target of | |
60 | * backward reference. | |
61 | */ | |
62 | struct lttng_enabler { | |
63 | enum lttng_enabler_format_type format_type; | |
64 | ||
65 | /* head list of struct lttng_ust_filter_bytecode_node */ | |
66 | struct cds_list_head filter_bytecode_head; | |
67 | /* head list of struct lttng_ust_excluder_node */ | |
68 | struct cds_list_head excluder_head; | |
69 | ||
fd17d7ce | 70 | struct lttng_ust_abi_event event_param; |
8665f6a4 MJ |
71 | unsigned int enabled:1; |
72 | }; | |
73 | ||
d871c65b FD |
74 | struct lttng_event_enabler { |
75 | struct lttng_enabler base; | |
76 | struct cds_list_head node; /* per-session list of enablers */ | |
77 | struct lttng_channel *chan; | |
78 | /* | |
79 | * Unused, but kept around to make it explicit that the tracer can do | |
80 | * it. | |
81 | */ | |
daacdbfc | 82 | struct lttng_ust_ctx *ctx; |
d871c65b FD |
83 | }; |
84 | ||
d8d2416d FD |
85 | struct lttng_event_notifier_enabler { |
86 | struct lttng_enabler base; | |
6566528b | 87 | uint64_t error_counter_index; |
d37ecb3f FD |
88 | struct cds_list_head node; /* per-app list of event_notifier enablers */ |
89 | struct cds_list_head capture_bytecode_head; | |
d8d2416d FD |
90 | struct lttng_event_notifier_group *group; /* weak ref */ |
91 | uint64_t user_token; /* User-provided token */ | |
d37ecb3f | 92 | uint64_t num_captures; |
d8d2416d FD |
93 | }; |
94 | ||
ab249ecf FD |
95 | enum lttng_ust_bytecode_node_type { |
96 | LTTNG_UST_BYTECODE_NODE_TYPE_FILTER, | |
d37ecb3f | 97 | LTTNG_UST_BYTECODE_NODE_TYPE_CAPTURE, |
ab249ecf FD |
98 | }; |
99 | ||
100 | struct lttng_ust_bytecode_node { | |
101 | enum lttng_ust_bytecode_node_type type; | |
92495593 FD |
102 | struct cds_list_head node; |
103 | struct lttng_enabler *enabler; | |
ab249ecf FD |
104 | struct { |
105 | uint32_t len; | |
106 | uint32_t reloc_offset; | |
107 | uint64_t seqnum; | |
108 | char data[]; | |
109 | } bc; | |
92495593 FD |
110 | }; |
111 | ||
112 | struct lttng_ust_excluder_node { | |
113 | struct cds_list_head node; | |
114 | struct lttng_enabler *enabler; | |
115 | /* | |
116 | * struct lttng_ust_event_exclusion had variable sized array, | |
117 | * must be last field. | |
118 | */ | |
fd17d7ce | 119 | struct lttng_ust_abi_event_exclusion excluder; |
92495593 FD |
120 | }; |
121 | ||
bb7ad29d MJ |
122 | /* Data structures used by the tracer. */ |
123 | ||
124 | struct tp_list_entry { | |
fd17d7ce | 125 | struct lttng_ust_abi_tracepoint_iter tp; |
bb7ad29d MJ |
126 | struct cds_list_head head; |
127 | }; | |
128 | ||
129 | struct lttng_ust_tracepoint_list { | |
130 | struct tp_list_entry *iter; | |
131 | struct cds_list_head head; | |
132 | }; | |
133 | ||
134 | struct tp_field_list_entry { | |
fd17d7ce | 135 | struct lttng_ust_abi_field_iter field; |
bb7ad29d MJ |
136 | struct cds_list_head head; |
137 | }; | |
138 | ||
139 | struct lttng_ust_field_list { | |
140 | struct tp_field_list_entry *iter; | |
141 | struct cds_list_head head; | |
142 | }; | |
143 | ||
144 | /* | |
145 | * Objects in a linked-list of enablers, owned by an event or event_notifier. | |
146 | * This is used because an event (or a event_notifier) can be enabled by more | |
147 | * than one enabler and we want a quick way to iterate over all enablers of an | |
148 | * object. | |
149 | * | |
150 | * For example, event rules "my_app:a*" and "my_app:ab*" will both match the | |
151 | * event with the name "my_app:abc". | |
152 | */ | |
153 | struct lttng_enabler_ref { | |
154 | struct cds_list_head node; /* enabler ref list */ | |
155 | struct lttng_enabler *ref; /* backward ref */ | |
156 | }; | |
157 | ||
158 | #define LTTNG_COUNTER_DIMENSION_MAX 8 | |
159 | struct lttng_counter_dimension { | |
160 | uint64_t size; | |
161 | uint64_t underflow_index; | |
162 | uint64_t overflow_index; | |
163 | uint8_t has_underflow; | |
164 | uint8_t has_overflow; | |
165 | }; | |
166 | ||
b5863ea7 MD |
167 | struct lttng_counter_ops { |
168 | struct lib_counter *(*counter_create)(size_t nr_dimensions, | |
169 | const struct lttng_counter_dimension *dimensions, | |
170 | int64_t global_sum_step, | |
171 | int global_counter_fd, | |
172 | int nr_counter_cpu_fds, | |
173 | const int *counter_cpu_fds, | |
174 | bool is_daemon); | |
175 | void (*counter_destroy)(struct lib_counter *counter); | |
176 | int (*counter_add)(struct lib_counter *counter, | |
177 | const size_t *dimension_indexes, int64_t v); | |
178 | int (*counter_read)(struct lib_counter *counter, | |
179 | const size_t *dimension_indexes, int cpu, | |
180 | int64_t *value, bool *overflow, bool *underflow); | |
181 | int (*counter_aggregate)(struct lib_counter *counter, | |
182 | const size_t *dimension_indexes, int64_t *value, | |
183 | bool *overflow, bool *underflow); | |
184 | int (*counter_clear)(struct lib_counter *counter, const size_t *dimension_indexes); | |
185 | }; | |
186 | ||
bb7ad29d MJ |
187 | struct lttng_counter { |
188 | int objd; | |
189 | struct lttng_event_notifier_group *event_notifier_group; /* owner */ | |
190 | struct lttng_counter_transport *transport; | |
191 | struct lib_counter *counter; | |
192 | struct lttng_counter_ops *ops; | |
193 | }; | |
194 | ||
681f6001 MD |
195 | #define LTTNG_UST_EVENT_HT_BITS 12 |
196 | #define LTTNG_UST_EVENT_HT_SIZE (1U << LTTNG_UST_EVENT_HT_BITS) | |
197 | ||
198 | struct lttng_ust_event_ht { | |
199 | struct cds_hlist_head table[LTTNG_UST_EVENT_HT_SIZE]; | |
200 | }; | |
201 | ||
202 | #define LTTNG_UST_EVENT_NOTIFIER_HT_BITS 12 | |
203 | #define LTTNG_UST_EVENT_NOTIFIER_HT_SIZE (1U << LTTNG_UST_EVENT_NOTIFIER_HT_BITS) | |
204 | struct lttng_ust_event_notifier_ht { | |
205 | struct cds_hlist_head table[LTTNG_UST_EVENT_NOTIFIER_HT_SIZE]; | |
206 | }; | |
207 | ||
208 | #define LTTNG_UST_ENUM_HT_BITS 12 | |
209 | #define LTTNG_UST_ENUM_HT_SIZE (1U << LTTNG_UST_ENUM_HT_BITS) | |
210 | ||
211 | struct lttng_ust_enum_ht { | |
212 | struct cds_hlist_head table[LTTNG_UST_ENUM_HT_SIZE]; | |
213 | }; | |
214 | ||
bb7ad29d MJ |
215 | struct lttng_event_notifier_group { |
216 | int objd; | |
217 | void *owner; | |
218 | int notification_fd; | |
219 | struct cds_list_head node; /* Event notifier group handle list */ | |
220 | struct cds_list_head enablers_head; | |
221 | struct cds_list_head event_notifiers_head; /* list of event_notifiers */ | |
222 | struct lttng_ust_event_notifier_ht event_notifiers_ht; /* hashtable of event_notifiers */ | |
daacdbfc | 223 | struct lttng_ust_ctx *ctx; /* contexts for filters. */ |
bb7ad29d MJ |
224 | |
225 | struct lttng_counter *error_counter; | |
226 | size_t error_counter_len; | |
227 | }; | |
228 | ||
229 | struct lttng_transport { | |
230 | char *name; | |
231 | struct cds_list_head node; | |
49926dbd | 232 | struct lttng_ust_channel_ops ops; |
bb7ad29d MJ |
233 | const struct lttng_ust_lib_ring_buffer_config *client_config; |
234 | }; | |
235 | ||
236 | struct lttng_counter_transport { | |
237 | char *name; | |
238 | struct cds_list_head node; | |
239 | struct lttng_counter_ops ops; | |
240 | const struct lib_counter_config *client_config; | |
241 | }; | |
242 | ||
80333dfa | 243 | struct lttng_ust_event_common_private { |
7ee76145 | 244 | struct lttng_ust_event_common *pub; /* Public event interface */ |
68bb7559 | 245 | |
dc11f93f | 246 | const struct lttng_ust_event_desc *desc; |
68bb7559 MD |
247 | /* Backward references: list of lttng_enabler_ref (ref to enablers) */ |
248 | struct cds_list_head enablers_ref_head; | |
68bb7559 | 249 | int registered; /* has reg'd tracepoint probe */ |
115db533 | 250 | uint64_t user_token; |
68bb7559 MD |
251 | }; |
252 | ||
2e70391c | 253 | struct lttng_ust_event_recorder_private { |
80333dfa MD |
254 | struct lttng_ust_event_common_private parent; |
255 | ||
2e70391c | 256 | struct lttng_ust_event_recorder *pub; /* Public event interface */ |
ba99fbe2 MD |
257 | struct cds_list_head node; /* Event recorder list */ |
258 | struct cds_hlist_node hlist; /* Hash table of event recorders */ | |
80333dfa MD |
259 | }; |
260 | ||
115db533 MD |
261 | struct lttng_ust_event_notifier_private { |
262 | struct lttng_ust_event_common_private parent; | |
263 | ||
d7d45c0d | 264 | struct lttng_ust_event_notifier *pub; /* Public event notifier interface */ |
115db533 MD |
265 | struct lttng_event_notifier_group *group; /* weak ref */ |
266 | size_t num_captures; /* Needed to allocate the msgpack array. */ | |
267 | uint64_t error_counter_index; | |
ba99fbe2 MD |
268 | struct cds_list_head node; /* Event notifier list */ |
269 | struct cds_hlist_node hlist; /* Hash table of event notifiers */ | |
115db533 MD |
270 | }; |
271 | ||
362a65de MD |
272 | struct lttng_ust_bytecode_runtime_private { |
273 | struct bytecode_runtime *pub; /* Public bytecode runtime interface */ | |
274 | ||
275 | struct lttng_ust_bytecode_node *bc; | |
276 | int link_failed; | |
277 | /* | |
278 | * Pointer to a URCU-protected pointer owned by an `struct | |
279 | * lttng_session`or `struct lttng_event_notifier_group`. | |
280 | */ | |
daacdbfc | 281 | struct lttng_ust_ctx **pctx; |
362a65de MD |
282 | }; |
283 | ||
bdb12629 MD |
284 | struct lttng_ust_session_private { |
285 | struct lttng_session *pub; /* Public session interface */ | |
286 | ||
287 | int been_active; /* Been active ? */ | |
288 | int objd; /* Object associated */ | |
289 | struct cds_list_head chan_head; /* Channel list head */ | |
290 | struct cds_list_head events_head; /* list of events */ | |
291 | struct cds_list_head node; /* Session list */ | |
292 | ||
293 | /* New UST 2.1 */ | |
294 | /* List of enablers */ | |
295 | struct cds_list_head enablers_head; | |
296 | struct lttng_ust_event_ht events_ht; /* ht of events */ | |
297 | void *owner; /* object owner */ | |
298 | int tstate:1; /* Transient enable state */ | |
299 | ||
300 | /* New UST 2.4 */ | |
301 | int statedump_pending:1; | |
302 | ||
303 | /* New UST 2.8 */ | |
304 | struct lttng_ust_enum_ht enums_ht; /* ht of enumerations */ | |
305 | struct cds_list_head enums_head; | |
daacdbfc | 306 | struct lttng_ust_ctx *ctx; /* contexts for filters. */ |
bdb12629 MD |
307 | }; |
308 | ||
036d17fb MD |
309 | struct lttng_enum { |
310 | const struct lttng_ust_enum_desc *desc; | |
311 | struct lttng_session *session; | |
312 | struct cds_list_head node; /* Enum list in session */ | |
313 | struct cds_hlist_node hlist; /* Session ht of enums */ | |
314 | uint64_t id; /* Enumeration ID in sessiond */ | |
315 | }; | |
316 | ||
d871c65b FD |
317 | static inline |
318 | struct lttng_enabler *lttng_event_enabler_as_enabler( | |
319 | struct lttng_event_enabler *event_enabler) | |
320 | { | |
321 | return &event_enabler->base; | |
322 | } | |
323 | ||
d8d2416d FD |
324 | static inline |
325 | struct lttng_enabler *lttng_event_notifier_enabler_as_enabler( | |
326 | struct lttng_event_notifier_enabler *event_notifier_enabler) | |
327 | { | |
328 | return &event_notifier_enabler->base; | |
329 | } | |
d871c65b FD |
330 | |
331 | /* | |
332 | * Allocate and initialize a `struct lttng_event_enabler` object. | |
333 | * | |
334 | * On success, returns a `struct lttng_event_enabler`, | |
335 | * On memory error, returns NULL. | |
336 | */ | |
ddabe860 | 337 | __attribute__((visibility("hidden"))) |
d871c65b FD |
338 | struct lttng_event_enabler *lttng_event_enabler_create( |
339 | enum lttng_enabler_format_type format_type, | |
fd17d7ce | 340 | struct lttng_ust_abi_event *event_param, |
d871c65b FD |
341 | struct lttng_channel *chan); |
342 | ||
343 | /* | |
344 | * Destroy a `struct lttng_event_enabler` object. | |
345 | */ | |
ddabe860 | 346 | __attribute__((visibility("hidden"))) |
d871c65b FD |
347 | void lttng_event_enabler_destroy(struct lttng_event_enabler *enabler); |
348 | ||
349 | /* | |
350 | * Enable a `struct lttng_event_enabler` object and all events related to this | |
351 | * enabler. | |
352 | */ | |
ddabe860 | 353 | __attribute__((visibility("hidden"))) |
d871c65b FD |
354 | int lttng_event_enabler_enable(struct lttng_event_enabler *enabler); |
355 | ||
356 | /* | |
357 | * Disable a `struct lttng_event_enabler` object and all events related to this | |
358 | * enabler. | |
359 | */ | |
ddabe860 | 360 | __attribute__((visibility("hidden"))) |
d871c65b FD |
361 | int lttng_event_enabler_disable(struct lttng_event_enabler *enabler); |
362 | ||
363 | /* | |
364 | * Attach filter bytecode program to `struct lttng_event_enabler` and all | |
365 | * events related to this enabler. | |
366 | */ | |
ddabe860 | 367 | __attribute__((visibility("hidden"))) |
a56fd376 FD |
368 | int lttng_event_enabler_attach_filter_bytecode( |
369 | struct lttng_event_enabler *enabler, | |
ab89263e | 370 | struct lttng_ust_bytecode_node **bytecode); |
d871c65b FD |
371 | |
372 | /* | |
373 | * Attach an application context to an event enabler. | |
374 | * | |
375 | * Not implemented. | |
376 | */ | |
ddabe860 | 377 | __attribute__((visibility("hidden"))) |
d871c65b | 378 | int lttng_event_enabler_attach_context(struct lttng_event_enabler *enabler, |
fd17d7ce | 379 | struct lttng_ust_abi_context *ctx); |
d871c65b FD |
380 | |
381 | /* | |
382 | * Attach exclusion list to `struct lttng_event_enabler` and all | |
383 | * events related to this enabler. | |
384 | */ | |
ddabe860 | 385 | __attribute__((visibility("hidden"))) |
d871c65b | 386 | int lttng_event_enabler_attach_exclusion(struct lttng_event_enabler *enabler, |
e9fe6aad | 387 | struct lttng_ust_excluder_node **excluder); |
d871c65b FD |
388 | |
389 | /* | |
d37ecb3f FD |
390 | * Synchronize bytecodes for the enabler and the instance (event or |
391 | * event_notifier). | |
d871c65b | 392 | * |
621c07fc | 393 | * This function goes over all bytecode programs of the enabler (event or |
d37ecb3f | 394 | * event_notifier enabler) to ensure each is linked to the provided instance. |
d871c65b | 395 | */ |
ddabe860 | 396 | __attribute__((visibility("hidden"))) |
dc11f93f | 397 | void lttng_enabler_link_bytecode(const struct lttng_ust_event_desc *event_desc, |
daacdbfc | 398 | struct lttng_ust_ctx **ctx, |
621c07fc FD |
399 | struct cds_list_head *instance_bytecode_runtime_head, |
400 | struct cds_list_head *enabler_bytecode_runtime_head); | |
d871c65b | 401 | |
d8d2416d FD |
402 | /* |
403 | * Allocate and initialize a `struct lttng_event_notifier_group` object. | |
404 | * | |
405 | * On success, returns a `struct lttng_triggre_group`, | |
406 | * on memory error, returns NULL. | |
407 | */ | |
ddabe860 | 408 | __attribute__((visibility("hidden"))) |
d8d2416d FD |
409 | struct lttng_event_notifier_group *lttng_event_notifier_group_create(void); |
410 | ||
411 | /* | |
412 | * Destroy a `struct lttng_event_notifier_group` object. | |
413 | */ | |
ddabe860 | 414 | __attribute__((visibility("hidden"))) |
d8d2416d FD |
415 | void lttng_event_notifier_group_destroy( |
416 | struct lttng_event_notifier_group *event_notifier_group); | |
417 | ||
418 | /* | |
419 | * Allocate and initialize a `struct lttng_event_notifier_enabler` object. | |
420 | * | |
421 | * On success, returns a `struct lttng_event_notifier_enabler`, | |
422 | * On memory error, returns NULL. | |
423 | */ | |
ddabe860 | 424 | __attribute__((visibility("hidden"))) |
d8d2416d FD |
425 | struct lttng_event_notifier_enabler *lttng_event_notifier_enabler_create( |
426 | struct lttng_event_notifier_group *event_notifier_group, | |
427 | enum lttng_enabler_format_type format_type, | |
fd17d7ce | 428 | struct lttng_ust_abi_event_notifier *event_notifier_param); |
d8d2416d FD |
429 | |
430 | /* | |
431 | * Destroy a `struct lttng_event_notifier_enabler` object. | |
432 | */ | |
ddabe860 | 433 | __attribute__((visibility("hidden"))) |
d8d2416d FD |
434 | void lttng_event_notifier_enabler_destroy( |
435 | struct lttng_event_notifier_enabler *event_notifier_enabler); | |
436 | ||
437 | /* | |
438 | * Enable a `struct lttng_event_notifier_enabler` object and all event | |
439 | * notifiers related to this enabler. | |
440 | */ | |
ddabe860 | 441 | __attribute__((visibility("hidden"))) |
d8d2416d FD |
442 | int lttng_event_notifier_enabler_enable( |
443 | struct lttng_event_notifier_enabler *event_notifier_enabler); | |
444 | ||
445 | /* | |
446 | * Disable a `struct lttng_event_notifier_enabler` object and all event | |
447 | * notifiers related to this enabler. | |
448 | */ | |
ddabe860 | 449 | __attribute__((visibility("hidden"))) |
d8d2416d FD |
450 | int lttng_event_notifier_enabler_disable( |
451 | struct lttng_event_notifier_enabler *event_notifier_enabler); | |
452 | ||
453 | /* | |
454 | * Attach filter bytecode program to `struct lttng_event_notifier_enabler` and | |
455 | * all event notifiers related to this enabler. | |
456 | */ | |
ddabe860 | 457 | __attribute__((visibility("hidden"))) |
a56fd376 | 458 | int lttng_event_notifier_enabler_attach_filter_bytecode( |
d8d2416d | 459 | struct lttng_event_notifier_enabler *event_notifier_enabler, |
ab89263e | 460 | struct lttng_ust_bytecode_node **bytecode); |
d8d2416d | 461 | |
d37ecb3f FD |
462 | /* |
463 | * Attach capture bytecode program to `struct lttng_event_notifier_enabler` and | |
464 | * all event_notifiers related to this enabler. | |
465 | */ | |
ddabe860 | 466 | __attribute__((visibility("hidden"))) |
d37ecb3f FD |
467 | int lttng_event_notifier_enabler_attach_capture_bytecode( |
468 | struct lttng_event_notifier_enabler *event_notifier_enabler, | |
49cde654 | 469 | struct lttng_ust_bytecode_node **bytecode); |
d37ecb3f | 470 | |
d8d2416d FD |
471 | /* |
472 | * Attach exclusion list to `struct lttng_event_notifier_enabler` and all | |
473 | * event notifiers related to this enabler. | |
474 | */ | |
ddabe860 | 475 | __attribute__((visibility("hidden"))) |
d8d2416d FD |
476 | int lttng_event_notifier_enabler_attach_exclusion( |
477 | struct lttng_event_notifier_enabler *event_notifier_enabler, | |
e9fe6aad | 478 | struct lttng_ust_excluder_node **excluder); |
d8d2416d | 479 | |
ddabe860 | 480 | __attribute__((visibility("hidden"))) |
b1f720f0 | 481 | void lttng_free_event_filter_runtime(struct lttng_ust_event_common *event); |
d8d2416d FD |
482 | |
483 | /* | |
484 | * Connect the probe on all enablers matching this event description. | |
485 | * Called on library load. | |
486 | */ | |
ddabe860 | 487 | __attribute__((visibility("hidden"))) |
d8d2416d FD |
488 | int lttng_fix_pending_event_notifiers(void); |
489 | ||
ddabe860 | 490 | __attribute__((visibility("hidden"))) |
67d4e8f5 MJ |
491 | struct lttng_counter *lttng_ust_counter_create( |
492 | const char *counter_transport_name, | |
493 | size_t number_dimensions, const struct lttng_counter_dimension *dimensions); | |
494 | ||
bd8c1787 MJ |
495 | #ifdef HAVE_PERF_EVENT |
496 | ||
ddabe860 | 497 | __attribute__((visibility("hidden"))) |
bd8c1787 MJ |
498 | int lttng_add_perf_counter_to_ctx(uint32_t type, |
499 | uint64_t config, | |
500 | const char *name, | |
daacdbfc | 501 | struct lttng_ust_ctx **ctx); |
ddabe860 MJ |
502 | |
503 | __attribute__((visibility("hidden"))) | |
bd8c1787 | 504 | int lttng_perf_counter_init(void); |
ddabe860 MJ |
505 | |
506 | __attribute__((visibility("hidden"))) | |
bd8c1787 MJ |
507 | void lttng_perf_counter_exit(void); |
508 | ||
509 | #else /* #ifdef HAVE_PERF_EVENT */ | |
510 | ||
511 | static inline | |
512 | int lttng_add_perf_counter_to_ctx(uint32_t type, | |
513 | uint64_t config, | |
514 | const char *name, | |
daacdbfc | 515 | struct lttng_ust_ctx **ctx) |
bd8c1787 MJ |
516 | { |
517 | return -ENOSYS; | |
518 | } | |
519 | static inline | |
520 | int lttng_perf_counter_init(void) | |
521 | { | |
522 | return 0; | |
523 | } | |
524 | static inline | |
525 | void lttng_perf_counter_exit(void) | |
526 | { | |
527 | } | |
528 | #endif /* #else #ifdef HAVE_PERF_EVENT */ | |
529 | ||
ddabe860 | 530 | __attribute__((visibility("hidden"))) |
7753d283 | 531 | int lttng_probes_get_event_list(struct lttng_ust_tracepoint_list *list); |
ddabe860 MJ |
532 | |
533 | __attribute__((visibility("hidden"))) | |
7753d283 MJ |
534 | void lttng_probes_prune_event_list(struct lttng_ust_tracepoint_list *list); |
535 | ||
ddabe860 | 536 | __attribute__((visibility("hidden"))) |
7753d283 | 537 | int lttng_probes_get_field_list(struct lttng_ust_field_list *list); |
ddabe860 MJ |
538 | |
539 | __attribute__((visibility("hidden"))) | |
7753d283 MJ |
540 | void lttng_probes_prune_field_list(struct lttng_ust_field_list *list); |
541 | ||
ddabe860 | 542 | __attribute__((visibility("hidden"))) |
fd17d7ce | 543 | struct lttng_ust_abi_tracepoint_iter * |
7753d283 | 544 | lttng_ust_tracepoint_list_get_iter_next(struct lttng_ust_tracepoint_list *list); |
ddabe860 MJ |
545 | |
546 | __attribute__((visibility("hidden"))) | |
fd17d7ce | 547 | struct lttng_ust_abi_field_iter * |
7753d283 MJ |
548 | lttng_ust_field_list_get_iter_next(struct lttng_ust_field_list *list); |
549 | ||
ddabe860 | 550 | __attribute__((visibility("hidden"))) |
7753d283 | 551 | struct lttng_session *lttng_session_create(void); |
ddabe860 MJ |
552 | |
553 | __attribute__((visibility("hidden"))) | |
7753d283 | 554 | int lttng_session_enable(struct lttng_session *session); |
ddabe860 MJ |
555 | |
556 | __attribute__((visibility("hidden"))) | |
7753d283 | 557 | int lttng_session_disable(struct lttng_session *session); |
ddabe860 MJ |
558 | |
559 | __attribute__((visibility("hidden"))) | |
7753d283 | 560 | int lttng_session_statedump(struct lttng_session *session); |
ddabe860 MJ |
561 | |
562 | __attribute__((visibility("hidden"))) | |
7753d283 MJ |
563 | void lttng_session_destroy(struct lttng_session *session); |
564 | ||
a5ae46cc MJ |
565 | /* |
566 | * Called with ust lock held. | |
567 | */ | |
568 | __attribute__((visibility("hidden"))) | |
569 | int lttng_session_active(void); | |
570 | ||
ddabe860 | 571 | __attribute__((visibility("hidden"))) |
7753d283 MJ |
572 | struct cds_list_head *lttng_get_sessions(void); |
573 | ||
ddabe860 | 574 | __attribute__((visibility("hidden"))) |
7753d283 MJ |
575 | void lttng_handle_pending_statedump(void *owner); |
576 | ||
ddabe860 | 577 | __attribute__((visibility("hidden"))) |
7753d283 MJ |
578 | struct lttng_channel *lttng_channel_create(struct lttng_session *session, |
579 | const char *transport_name, | |
580 | void *buf_addr, | |
581 | size_t subbuf_size, size_t num_subbuf, | |
582 | unsigned int switch_timer_interval, | |
583 | unsigned int read_timer_interval, | |
584 | int **shm_fd, int **wait_fd, | |
585 | uint64_t **memory_map_size, | |
586 | struct lttng_channel *chan_priv_init); | |
587 | ||
ddabe860 | 588 | __attribute__((visibility("hidden"))) |
7753d283 | 589 | int lttng_channel_enable(struct lttng_channel *channel); |
ddabe860 MJ |
590 | |
591 | __attribute__((visibility("hidden"))) | |
7753d283 MJ |
592 | int lttng_channel_disable(struct lttng_channel *channel); |
593 | ||
ddabe860 | 594 | __attribute__((visibility("hidden"))) |
7753d283 | 595 | void lttng_transport_register(struct lttng_transport *transport); |
ddabe860 MJ |
596 | |
597 | __attribute__((visibility("hidden"))) | |
7753d283 MJ |
598 | void lttng_transport_unregister(struct lttng_transport *transport); |
599 | ||
65c48d6a MJ |
600 | /* This is ABI between liblttng-ust and liblttng-ust-ctl */ |
601 | struct lttng_transport *lttng_ust_transport_find(const char *name); | |
602 | ||
cbba5e04 MJ |
603 | /* This is ABI between liblttng-ust and liblttng-ust-dl */ |
604 | void lttng_ust_dl_update(void *ip); | |
605 | ||
ddabe860 | 606 | __attribute__((visibility("hidden"))) |
dc11f93f | 607 | void lttng_probe_provider_unregister_events(struct lttng_ust_probe_desc *desc); |
7753d283 | 608 | |
ddabe860 | 609 | __attribute__((visibility("hidden"))) |
7753d283 MJ |
610 | int lttng_fix_pending_events(void); |
611 | ||
ddabe860 | 612 | __attribute__((visibility("hidden"))) |
7753d283 MJ |
613 | struct cds_list_head *lttng_get_probe_list_head(void); |
614 | ||
ddabe860 | 615 | __attribute__((visibility("hidden"))) |
7753d283 | 616 | struct lttng_enum *lttng_ust_enum_get_from_desc(struct lttng_session *session, |
891d6b55 | 617 | const struct lttng_ust_enum_desc *enum_desc); |
7753d283 | 618 | |
ddabe860 | 619 | __attribute__((visibility("hidden"))) |
fd17d7ce MD |
620 | int lttng_abi_create_root_handle(void); |
621 | ||
ddabe860 | 622 | __attribute__((visibility("hidden"))) |
fd17d7ce | 623 | const struct lttng_ust_abi_objd_ops *lttng_ust_abi_objd_ops(int id); |
ddabe860 MJ |
624 | |
625 | __attribute__((visibility("hidden"))) | |
fd17d7ce | 626 | int lttng_ust_abi_objd_unref(int id, int is_owner); |
ddabe860 MJ |
627 | |
628 | __attribute__((visibility("hidden"))) | |
fd17d7ce | 629 | void lttng_ust_abi_exit(void); |
ddabe860 MJ |
630 | |
631 | __attribute__((visibility("hidden"))) | |
fd17d7ce | 632 | void lttng_ust_abi_events_exit(void); |
ddabe860 MJ |
633 | |
634 | __attribute__((visibility("hidden"))) | |
fd17d7ce MD |
635 | void lttng_ust_abi_objd_table_owner_cleanup(void *owner); |
636 | ||
d871c65b | 637 | #endif /* _LTTNG_UST_EVENTS_INTERNAL_H */ |