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_recorder_enabler` object.
15 * On success, returns a `struct lttng_event_recorder_enabler`,
16 * On memory error, returns NULL.
18 struct lttng_event_recorder_enabler
*lttng_event_recorder_enabler_create(
19 enum lttng_enabler_format_type format_type
,
20 const struct lttng_ust_abi_event
*event_param
,
21 struct lttng_ust_channel_buffer
*chan
)
22 __attribute__((visibility("hidden")));
25 * Allocate and initialize a `struct lttng_event_counter_enabler` object.
27 * On success, returns a `struct lttng_event_counter_enabler`,
28 * On memory error, returns NULL.
30 struct lttng_event_counter_enabler
*lttng_event_counter_enabler_create(
31 enum lttng_enabler_format_type format_type
,
32 const struct lttng_ust_abi_counter_event
*counter_event
,
33 const struct lttng_counter_key
*key
,
34 struct lttng_ust_channel_counter
*chan
)
35 __attribute__((visibility("hidden")));
38 * Destroy a `struct lttng_event_enabler_common` object.
40 void lttng_event_enabler_destroy(struct lttng_event_enabler_common
*event_enabler
)
41 __attribute__((visibility("hidden")));
44 * Enable a `struct lttng_event_enabler_common` object and all events related to this
47 int lttng_event_enabler_enable(struct lttng_event_enabler_common
*enabler
)
48 __attribute__((visibility("hidden")));
51 * Disable a `struct lttng_event_enabler_common` object and all events related to this
54 int lttng_event_enabler_disable(struct lttng_event_enabler_common
*enabler
)
55 __attribute__((visibility("hidden")));
58 * Attach filter bytecode program to `struct lttng_event_enabler_common` and all
59 * events related to this enabler.
61 int lttng_event_enabler_attach_filter_bytecode(
62 struct lttng_event_enabler_common
*enabler
,
63 struct lttng_ust_bytecode_node
**bytecode
)
64 __attribute__((visibility("hidden")));
67 * Attach an application context to an event enabler.
71 int lttng_event_enabler_attach_context(struct lttng_event_enabler_session_common
*enabler
,
72 struct lttng_ust_abi_context
*ctx
)
73 __attribute__((visibility("hidden")));
76 * Attach exclusion list to `struct lttng_event_enabler_common` and all
77 * events related to this enabler.
79 int lttng_event_enabler_attach_exclusion(struct lttng_event_enabler_common
*enabler
,
80 struct lttng_ust_excluder_node
**excluder
)
81 __attribute__((visibility("hidden")));
84 * Synchronize bytecodes for the enabler and the instance (event or
87 * This function goes over all bytecode programs of the enabler (event or
88 * event_notifier enabler) to ensure each is linked to the provided instance.
90 void lttng_enabler_link_bytecode(const struct lttng_ust_event_desc
*event_desc
,
91 struct lttng_ust_ctx
**ctx
,
92 struct cds_list_head
*instance_bytecode_runtime_head
,
93 struct cds_list_head
*enabler_bytecode_runtime_head
)
94 __attribute__((visibility("hidden")));
97 * Allocate and initialize a `struct lttng_event_notifier_group` object.
99 * On success, returns a `struct lttng_triggre_group`,
100 * on memory error, returns NULL.
102 struct lttng_event_notifier_group
*lttng_event_notifier_group_create(void)
103 __attribute__((visibility("hidden")));
106 * Destroy a `struct lttng_event_notifier_group` object.
108 void lttng_event_notifier_group_destroy(
109 struct lttng_event_notifier_group
*event_notifier_group
)
110 __attribute__((visibility("hidden")));
113 * Allocate and initialize a `struct lttng_event_notifier_enabler` object.
115 * On success, returns a `struct lttng_event_notifier_enabler`,
116 * On memory error, returns NULL.
118 struct lttng_event_notifier_enabler
*lttng_event_notifier_enabler_create(
119 struct lttng_event_notifier_group
*event_notifier_group
,
120 enum lttng_enabler_format_type format_type
,
121 struct lttng_ust_abi_event_notifier
*event_notifier_param
)
122 __attribute__((visibility("hidden")));
125 * Attach capture bytecode program to `struct lttng_event_notifier_enabler` and
126 * all event_notifiers related to this enabler.
128 int lttng_event_notifier_enabler_attach_capture_bytecode(
129 struct lttng_event_notifier_enabler
*event_notifier_enabler
,
130 struct lttng_ust_bytecode_node
**bytecode
)
131 __attribute__((visibility("hidden")));
133 void lttng_free_event_filter_runtime(struct lttng_ust_event_common
*event
)
134 __attribute__((visibility("hidden")));
137 * Connect the probe on all enablers matching this event description.
138 * Called on library load.
140 int lttng_fix_pending_event_notifiers(void)
141 __attribute__((visibility("hidden")));
143 struct lttng_ust_channel_counter
*lttng_ust_counter_create(
144 const char *counter_transport_name
,
145 size_t number_dimensions
,
146 const struct lttng_counter_dimension
*dimensions
,
147 int64_t global_sum_step
,
149 __attribute__((visibility("hidden")));
151 #ifdef HAVE_LINUX_PERF_EVENT_H
153 int lttng_add_perf_counter_to_ctx(uint32_t type
,
156 struct lttng_ust_ctx
**ctx
)
157 __attribute__((visibility("hidden")));
159 int lttng_perf_counter_init(void)
160 __attribute__((visibility("hidden")));
162 void lttng_perf_counter_exit(void)
163 __attribute__((visibility("hidden")));
165 #else /* #ifdef HAVE_LINUX_PERF_EVENT_H */
168 int lttng_add_perf_counter_to_ctx(uint32_t type
__attribute__((unused
)),
169 uint64_t config
__attribute__((unused
)),
170 const char *name
__attribute__((unused
)),
171 struct lttng_ust_ctx
**ctx
__attribute__((unused
)))
176 int lttng_perf_counter_init(void)
181 void lttng_perf_counter_exit(void)
184 #endif /* #else #ifdef HAVE_LINUX_PERF_EVENT_H */
186 int lttng_probes_get_event_list(struct lttng_ust_tracepoint_list
*list
)
187 __attribute__((visibility("hidden")));
189 void lttng_probes_prune_event_list(struct lttng_ust_tracepoint_list
*list
)
190 __attribute__((visibility("hidden")));
192 int lttng_probes_get_field_list(struct lttng_ust_field_list
*list
)
193 __attribute__((visibility("hidden")));
195 void lttng_probes_prune_field_list(struct lttng_ust_field_list
*list
)
196 __attribute__((visibility("hidden")));
198 struct lttng_ust_abi_tracepoint_iter
*
199 lttng_ust_tracepoint_list_get_iter_next(struct lttng_ust_tracepoint_list
*list
)
200 __attribute__((visibility("hidden")));
202 struct lttng_ust_abi_field_iter
*
203 lttng_ust_field_list_get_iter_next(struct lttng_ust_field_list
*list
)
204 __attribute__((visibility("hidden")));
206 struct lttng_ust_session
*lttng_session_create(void)
207 __attribute__((visibility("hidden")));
209 int lttng_session_enable(struct lttng_ust_session
*session
)
210 __attribute__((visibility("hidden")));
212 int lttng_session_disable(struct lttng_ust_session
*session
)
213 __attribute__((visibility("hidden")));
215 int lttng_session_statedump(struct lttng_ust_session
*session
)
216 __attribute__((visibility("hidden")));
218 void lttng_session_destroy(struct lttng_ust_session
*session
)
219 __attribute__((visibility("hidden")));
222 * Called with ust lock held.
224 int lttng_session_active(void)
225 __attribute__((visibility("hidden")));
227 struct cds_list_head
*lttng_get_sessions(void)
228 __attribute__((visibility("hidden")));
230 void lttng_handle_pending_statedump(void *owner
)
231 __attribute__((visibility("hidden")));
233 int lttng_channel_enable(struct lttng_ust_channel_common
*lttng_channel
)
234 __attribute__((visibility("hidden")));
236 int lttng_channel_disable(struct lttng_ust_channel_common
*lttng_channel
)
237 __attribute__((visibility("hidden")));
239 void lttng_probe_provider_unregister_events(const struct lttng_ust_probe_desc
*desc
)
240 __attribute__((visibility("hidden")));
242 int lttng_fix_pending_events(void)
243 __attribute__((visibility("hidden")));
245 struct cds_list_head
*lttng_get_probe_list_head(void)
246 __attribute__((visibility("hidden")));
248 int lttng_abi_create_root_handle(void)
249 __attribute__((visibility("hidden")));
251 const struct lttng_ust_abi_objd_ops
*lttng_ust_abi_objd_ops(int id
)
252 __attribute__((visibility("hidden")));
254 int lttng_ust_abi_objd_unref(int id
, int is_owner
)
255 __attribute__((visibility("hidden")));
257 void lttng_ust_abi_exit(void)
258 __attribute__((visibility("hidden")));
260 void lttng_ust_abi_events_exit(void)
261 __attribute__((visibility("hidden")));
263 void lttng_ust_abi_objd_table_owner_cleanup(void *owner
)
264 __attribute__((visibility("hidden")));
266 int lttng_ust_interpret_event_filter(const struct lttng_ust_event_common
*event
,
267 const char *interpreter_stack_data
,
268 struct lttng_ust_probe_ctx
*probe_ctx
,
270 __attribute__((visibility("hidden")));
272 int lttng_ust_session_uuid_validate(struct lttng_ust_session
*session
,
274 __attribute__((visibility("hidden")));
276 bool lttng_ust_validate_event_name(const struct lttng_ust_event_desc
*desc
)
277 __attribute__((visibility("hidden")));
279 void lttng_ust_format_event_name(const struct lttng_ust_event_desc
*desc
,
281 __attribute__((visibility("hidden")));
283 int lttng_ust_add_app_context_to_ctx_rcu(const char *name
, struct lttng_ust_ctx
**ctx
)
284 __attribute__((visibility("hidden")));
286 int lttng_ust_context_set_provider_rcu(struct lttng_ust_ctx
**_ctx
,
288 size_t (*get_size
)(void *priv
, struct lttng_ust_probe_ctx
*probe_ctx
,
290 void (*record
)(void *priv
, struct lttng_ust_probe_ctx
*probe_ctx
,
291 struct lttng_ust_ring_buffer_ctx
*ctx
,
292 struct lttng_ust_channel_buffer
*chan
),
293 void (*get_value
)(void *priv
, struct lttng_ust_probe_ctx
*probe_ctx
,
294 struct lttng_ust_ctx_value
*value
))
295 __attribute__((visibility("hidden")));
297 void lttng_ust_context_set_session_provider(const char *name
,
298 size_t (*get_size
)(void *priv
, struct lttng_ust_probe_ctx
*probe_ctx
,
300 void (*record
)(void *priv
, struct lttng_ust_probe_ctx
*probe_ctx
,
301 struct lttng_ust_ring_buffer_ctx
*ctx
,
302 struct lttng_ust_channel_buffer
*chan
),
303 void (*get_value
)(void *priv
, struct lttng_ust_probe_ctx
*probe_ctx
,
304 struct lttng_ust_ctx_value
*value
))
305 __attribute__((visibility("hidden")));
307 #endif /* _LTTNG_UST_EVENTS_INTERNAL_H */