2 * SPDX-License-Identifier: MIT
4 * Copyright 2019 (c) Francis Deslauriers <francis.deslauriers@efficios.com>
7 #ifndef _LTTNG_UST_EVENTS_INTERNAL_H
8 #define _LTTNG_UST_EVENTS_INTERNAL_H
10 #include "common/events.h"
13 * Allocate and initialize a `struct lttng_event_enabler` object.
15 * On success, returns a `struct lttng_event_enabler`,
16 * On memory error, returns NULL.
18 struct lttng_event_enabler
*lttng_event_enabler_create(
19 enum lttng_enabler_format_type format_type
,
20 struct lttng_ust_abi_event
*event_param
,
21 struct lttng_ust_channel_buffer
*chan
)
22 __attribute__((visibility("hidden")));
25 * Destroy a `struct lttng_event_enabler` object.
27 void lttng_event_enabler_destroy(struct lttng_event_enabler
*enabler
)
28 __attribute__((visibility("hidden")));
31 * Enable a `struct lttng_event_enabler` object and all events related to this
34 int lttng_event_enabler_enable(struct lttng_event_enabler
*enabler
)
35 __attribute__((visibility("hidden")));
38 * Disable a `struct lttng_event_enabler` object and all events related to this
41 int lttng_event_enabler_disable(struct lttng_event_enabler
*enabler
)
42 __attribute__((visibility("hidden")));
45 * Attach filter bytecode program to `struct lttng_event_enabler` and all
46 * events related to this enabler.
48 int lttng_event_enabler_attach_filter_bytecode(
49 struct lttng_event_enabler
*enabler
,
50 struct lttng_ust_bytecode_node
**bytecode
)
51 __attribute__((visibility("hidden")));
54 * Attach an application context to an event enabler.
58 int lttng_event_enabler_attach_context(struct lttng_event_enabler
*enabler
,
59 struct lttng_ust_abi_context
*ctx
)
60 __attribute__((visibility("hidden")));
63 * Attach exclusion list to `struct lttng_event_enabler` and all
64 * events related to this enabler.
66 int lttng_event_enabler_attach_exclusion(struct lttng_event_enabler
*enabler
,
67 struct lttng_ust_excluder_node
**excluder
)
68 __attribute__((visibility("hidden")));
71 * Synchronize bytecodes for the enabler and the instance (event or
74 * This function goes over all bytecode programs of the enabler (event or
75 * event_notifier enabler) to ensure each is linked to the provided instance.
77 void lttng_enabler_link_bytecode(const struct lttng_ust_event_desc
*event_desc
,
78 struct lttng_ust_ctx
**ctx
,
79 struct cds_list_head
*instance_bytecode_runtime_head
,
80 struct cds_list_head
*enabler_bytecode_runtime_head
)
81 __attribute__((visibility("hidden")));
84 * Allocate and initialize a `struct lttng_event_notifier_group` object.
86 * On success, returns a `struct lttng_triggre_group`,
87 * on memory error, returns NULL.
89 struct lttng_event_notifier_group
*lttng_event_notifier_group_create(void)
90 __attribute__((visibility("hidden")));
93 * Destroy a `struct lttng_event_notifier_group` object.
95 void lttng_event_notifier_group_destroy(
96 struct lttng_event_notifier_group
*event_notifier_group
)
97 __attribute__((visibility("hidden")));
100 * Allocate and initialize a `struct lttng_event_notifier_enabler` object.
102 * On success, returns a `struct lttng_event_notifier_enabler`,
103 * On memory error, returns NULL.
105 struct lttng_event_notifier_enabler
*lttng_event_notifier_enabler_create(
106 struct lttng_event_notifier_group
*event_notifier_group
,
107 enum lttng_enabler_format_type format_type
,
108 struct lttng_ust_abi_event_notifier
*event_notifier_param
)
109 __attribute__((visibility("hidden")));
112 * Destroy a `struct lttng_event_notifier_enabler` object.
114 void lttng_event_notifier_enabler_destroy(
115 struct lttng_event_notifier_enabler
*event_notifier_enabler
)
116 __attribute__((visibility("hidden")));
119 * Enable a `struct lttng_event_notifier_enabler` object and all event
120 * notifiers related to this enabler.
122 int lttng_event_notifier_enabler_enable(
123 struct lttng_event_notifier_enabler
*event_notifier_enabler
)
124 __attribute__((visibility("hidden")));
127 * Disable a `struct lttng_event_notifier_enabler` object and all event
128 * notifiers related to this enabler.
130 int lttng_event_notifier_enabler_disable(
131 struct lttng_event_notifier_enabler
*event_notifier_enabler
)
132 __attribute__((visibility("hidden")));
135 * Attach filter bytecode program to `struct lttng_event_notifier_enabler` and
136 * all event notifiers related to this enabler.
138 int lttng_event_notifier_enabler_attach_filter_bytecode(
139 struct lttng_event_notifier_enabler
*event_notifier_enabler
,
140 struct lttng_ust_bytecode_node
**bytecode
)
141 __attribute__((visibility("hidden")));
144 * Attach capture bytecode program to `struct lttng_event_notifier_enabler` and
145 * all event_notifiers related to this enabler.
147 int lttng_event_notifier_enabler_attach_capture_bytecode(
148 struct lttng_event_notifier_enabler
*event_notifier_enabler
,
149 struct lttng_ust_bytecode_node
**bytecode
)
150 __attribute__((visibility("hidden")));
153 * Attach exclusion list to `struct lttng_event_notifier_enabler` and all
154 * event notifiers related to this enabler.
156 int lttng_event_notifier_enabler_attach_exclusion(
157 struct lttng_event_notifier_enabler
*event_notifier_enabler
,
158 struct lttng_ust_excluder_node
**excluder
)
159 __attribute__((visibility("hidden")));
161 void lttng_free_event_filter_runtime(struct lttng_ust_event_common
*event
)
162 __attribute__((visibility("hidden")));
165 * Connect the probe on all enablers matching this event description.
166 * Called on library load.
168 int lttng_fix_pending_event_notifiers(void)
169 __attribute__((visibility("hidden")));
171 struct lttng_counter
*lttng_ust_counter_create(
172 const char *counter_transport_name
,
173 size_t number_dimensions
, const struct lttng_counter_dimension
*dimensions
)
174 __attribute__((visibility("hidden")));
176 #ifdef HAVE_LINUX_PERF_EVENT_H
178 int lttng_add_perf_counter_to_ctx(uint32_t type
,
181 struct lttng_ust_ctx
**ctx
)
182 __attribute__((visibility("hidden")));
184 int lttng_perf_counter_init(void)
185 __attribute__((visibility("hidden")));
187 void lttng_perf_counter_exit(void)
188 __attribute__((visibility("hidden")));
190 #else /* #ifdef HAVE_LINUX_PERF_EVENT_H */
193 int lttng_add_perf_counter_to_ctx(uint32_t type
__attribute__((unused
)),
194 uint64_t config
__attribute__((unused
)),
195 const char *name
__attribute__((unused
)),
196 struct lttng_ust_ctx
**ctx
__attribute__((unused
)))
201 int lttng_perf_counter_init(void)
206 void lttng_perf_counter_exit(void)
209 #endif /* #else #ifdef HAVE_LINUX_PERF_EVENT_H */
211 int lttng_probes_get_event_list(struct lttng_ust_tracepoint_list
*list
)
212 __attribute__((visibility("hidden")));
214 void lttng_probes_prune_event_list(struct lttng_ust_tracepoint_list
*list
)
215 __attribute__((visibility("hidden")));
217 int lttng_probes_get_field_list(struct lttng_ust_field_list
*list
)
218 __attribute__((visibility("hidden")));
220 void lttng_probes_prune_field_list(struct lttng_ust_field_list
*list
)
221 __attribute__((visibility("hidden")));
223 struct lttng_ust_abi_tracepoint_iter
*
224 lttng_ust_tracepoint_list_get_iter_next(struct lttng_ust_tracepoint_list
*list
)
225 __attribute__((visibility("hidden")));
227 struct lttng_ust_abi_field_iter
*
228 lttng_ust_field_list_get_iter_next(struct lttng_ust_field_list
*list
)
229 __attribute__((visibility("hidden")));
231 struct lttng_ust_session
*lttng_session_create(void)
232 __attribute__((visibility("hidden")));
234 int lttng_session_enable(struct lttng_ust_session
*session
)
235 __attribute__((visibility("hidden")));
237 int lttng_session_disable(struct lttng_ust_session
*session
)
238 __attribute__((visibility("hidden")));
240 int lttng_session_statedump(struct lttng_ust_session
*session
)
241 __attribute__((visibility("hidden")));
243 void lttng_session_destroy(struct lttng_ust_session
*session
)
244 __attribute__((visibility("hidden")));
247 * Called with ust lock held.
249 int lttng_session_active(void)
250 __attribute__((visibility("hidden")));
252 struct cds_list_head
*lttng_get_sessions(void)
253 __attribute__((visibility("hidden")));
255 void lttng_handle_pending_statedump(void *owner
)
256 __attribute__((visibility("hidden")));
258 int lttng_channel_enable(struct lttng_ust_channel_common
*lttng_channel
)
259 __attribute__((visibility("hidden")));
261 int lttng_channel_disable(struct lttng_ust_channel_common
*lttng_channel
)
262 __attribute__((visibility("hidden")));
264 void lttng_probe_provider_unregister_events(const struct lttng_ust_probe_desc
*desc
)
265 __attribute__((visibility("hidden")));
267 int lttng_fix_pending_events(void)
268 __attribute__((visibility("hidden")));
270 struct cds_list_head
*lttng_get_probe_list_head(void)
271 __attribute__((visibility("hidden")));
273 int lttng_abi_create_root_handle(void)
274 __attribute__((visibility("hidden")));
276 const struct lttng_ust_abi_objd_ops
*lttng_ust_abi_objd_ops(int id
)
277 __attribute__((visibility("hidden")));
279 int lttng_ust_abi_objd_unref(int id
, int is_owner
)
280 __attribute__((visibility("hidden")));
282 void lttng_ust_abi_exit(void)
283 __attribute__((visibility("hidden")));
285 void lttng_ust_abi_events_exit(void)
286 __attribute__((visibility("hidden")));
288 void lttng_ust_abi_objd_table_owner_cleanup(void *owner
)
289 __attribute__((visibility("hidden")));
291 int lttng_ust_interpret_event_filter(const struct lttng_ust_event_common
*event
,
292 const char *interpreter_stack_data
,
293 struct lttng_ust_probe_ctx
*probe_ctx
,
295 __attribute__((visibility("hidden")));
297 int lttng_ust_session_uuid_validate(struct lttng_ust_session
*session
,
299 __attribute__((visibility("hidden")));
301 bool lttng_ust_validate_event_name(const struct lttng_ust_event_desc
*desc
)
302 __attribute__((visibility("hidden")));
304 void lttng_ust_format_event_name(const struct lttng_ust_event_desc
*desc
,
306 __attribute__((visibility("hidden")));
308 int lttng_ust_add_app_context_to_ctx_rcu(const char *name
, struct lttng_ust_ctx
**ctx
)
309 __attribute__((visibility("hidden")));
311 int lttng_ust_context_set_provider_rcu(struct lttng_ust_ctx
**_ctx
,
313 size_t (*get_size
)(void *priv
, struct lttng_ust_probe_ctx
*probe_ctx
,
315 void (*record
)(void *priv
, struct lttng_ust_probe_ctx
*probe_ctx
,
316 struct lttng_ust_ring_buffer_ctx
*ctx
,
317 struct lttng_ust_channel_buffer
*chan
),
318 void (*get_value
)(void *priv
, struct lttng_ust_probe_ctx
*probe_ctx
,
319 struct lttng_ust_ctx_value
*value
))
320 __attribute__((visibility("hidden")));
322 void lttng_ust_context_set_session_provider(const char *name
,
323 size_t (*get_size
)(void *priv
, struct lttng_ust_probe_ctx
*probe_ctx
,
325 void (*record
)(void *priv
, struct lttng_ust_probe_ctx
*probe_ctx
,
326 struct lttng_ust_ring_buffer_ctx
*ctx
,
327 struct lttng_ust_channel_buffer
*chan
),
328 void (*get_value
)(void *priv
, struct lttng_ust_probe_ctx
*probe_ctx
,
329 struct lttng_ust_ctx_value
*value
))
330 __attribute__((visibility("hidden")));
332 #endif /* _LTTNG_UST_EVENTS_INTERNAL_H */