2 * Copyright (C) 2011 EfficiOS Inc.
3 * Copyright (C) 2011-2013 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
5 * SPDX-License-Identifier: GPL-2.0-only
9 #ifndef LTTNG_UST_CTL_INTERNAL_H
10 #define LTTNG_UST_CTL_INTERNAL_H
12 #include "lttng-ust-abi.hpp"
15 #include <sys/types.h>
17 #ifndef LTTNG_UST_UUID_LEN
18 #define LTTNG_UST_UUID_LEN 16
21 /* Default unix socket path */
22 #define LTTNG_UST_SOCK_FILENAME \
23 "lttng-ust-sock-" __ust_stringify(LTTNG_UST_ABI_MAJOR_VERSION_OLDEST_COMPATIBLE)
26 * Shared memory files path are automatically related to shm root, e.g.
27 * /dev/shm under linux.
29 #define LTTNG_UST_WAIT_FILENAME \
30 "lttng-ust-wait-" __ust_stringify(LTTNG_UST_ABI_MAJOR_VERSION_OLDEST_COMPATIBLE)
32 struct lttng_ust_shm_handle;
33 struct lttng_ust_lib_ring_buffer;
35 struct lttng_ust_ctl_consumer_channel_attr {
36 enum lttng_ust_abi_chan_type type;
37 uint64_t subbuf_size; /* bytes */
38 uint64_t num_subbuf; /* power of 2 */
39 int overwrite; /* 1: overwrite, 0: discard */
40 unsigned int switch_timer_interval; /* usec */
41 unsigned int read_timer_interval; /* usec */
42 enum lttng_ust_abi_output output; /* splice, mmap */
43 uint32_t chan_id; /* channel ID */
44 unsigned char uuid[LTTNG_UST_UUID_LEN]; /* Trace session unique ID */
45 int64_t blocking_timeout; /* Blocking timeout (usec) */
49 * API used by sessiond.
52 struct lttng_ust_context_attr {
53 enum lttng_ust_abi_context_type ctx;
55 struct lttng_ust_abi_perf_counter_ctx perf_counter;
64 * Error values: all the following functions return:
65 * >= 0: Success (LTTNG_UST_OK)
68 int lttng_ust_ctl_register_done(int sock);
69 int lttng_ust_ctl_create_session(int sock);
70 int lttng_ust_ctl_create_event(int sock,
71 struct lttng_ust_abi_event *ev,
72 struct lttng_ust_abi_object_data *channel_data,
73 struct lttng_ust_abi_object_data **event_data);
74 int lttng_ust_ctl_add_context(int sock,
75 struct lttng_ust_context_attr *ctx,
76 struct lttng_ust_abi_object_data *obj_data,
77 struct lttng_ust_abi_object_data **context_data);
78 int lttng_ust_ctl_set_filter(int sock,
79 struct lttng_ust_abi_filter_bytecode *bytecode,
80 struct lttng_ust_abi_object_data *obj_data);
81 int lttng_ust_ctl_set_capture(int sock,
82 struct lttng_ust_abi_capture_bytecode *bytecode,
83 struct lttng_ust_abi_object_data *obj_data);
84 int lttng_ust_ctl_set_exclusion(int sock,
85 struct lttng_ust_abi_event_exclusion *exclusion,
86 struct lttng_ust_abi_object_data *obj_data);
88 int lttng_ust_ctl_enable(int sock, struct lttng_ust_abi_object_data *object);
89 int lttng_ust_ctl_disable(int sock, struct lttng_ust_abi_object_data *object);
90 int lttng_ust_ctl_start_session(int sock, int handle);
91 int lttng_ust_ctl_stop_session(int sock, int handle);
94 * lttng_ust_ctl_create_event notifier_group creates a event notifier group. It
95 * establishes the connection with the application by providing a file
96 * descriptor of the pipe to be used by the application when a event notifier
97 * of that group is fired. It returns a handle to be used when creating event
98 * notifier in that group.
100 int lttng_ust_ctl_create_event_notifier_group(
101 int sock, int pipe_fd, struct lttng_ust_abi_object_data **event_notifier_group);
104 * lttng_ust_ctl_create_event notifier creates a event notifier in a event notifier
105 * group giving a event notifier description and a event notifier group handle.
106 * It returns a event notifier handle to be used when enabling the event
107 * notifier, attaching filter, attaching exclusion, and disabling the event
110 int lttng_ust_ctl_create_event_notifier(int sock,
111 struct lttng_ust_abi_event_notifier *event_notifier,
112 struct lttng_ust_abi_object_data *event_notifier_group,
113 struct lttng_ust_abi_object_data **event_notifier_data);
116 * lttng_ust_ctl_tracepoint_list returns a tracepoint list handle, or negative
119 int lttng_ust_ctl_tracepoint_list(int sock);
122 * lttng_ust_ctl_tracepoint_list_get is used to iterate on the tp list
123 * handle. End is iteration is reached when -LTTNG_UST_ERR_NOENT is
126 int lttng_ust_ctl_tracepoint_list_get(int sock,
128 struct lttng_ust_abi_tracepoint_iter *iter);
131 * lttng_ust_ctl_tracepoint_field_list returns a tracepoint field list handle,
132 * or negative error value.
134 int lttng_ust_ctl_tracepoint_field_list(int sock);
137 * lttng_ust_ctl_tracepoint_field_list_get is used to iterate on the tp field
138 * list handle. End is iteration is reached when -LTTNG_UST_ERR_NOENT is
141 int lttng_ust_ctl_tracepoint_field_list_get(int sock,
142 int tp_field_list_handle,
143 struct lttng_ust_abi_field_iter *iter);
145 int lttng_ust_ctl_tracer_version(int sock, struct lttng_ust_abi_tracer_version *v);
146 int lttng_ust_ctl_wait_quiescent(int sock);
148 int lttng_ust_ctl_sock_flush_buffer(int sock, struct lttng_ust_abi_object_data *object);
150 int lttng_ust_ctl_calibrate(int sock, struct lttng_ust_abi_calibrate *calibrate);
152 /* Release object created by members of this API. */
153 int lttng_ust_ctl_release_object(int sock, struct lttng_ust_abi_object_data *data);
154 /* Release handle returned by create session. */
155 int lttng_ust_ctl_release_handle(int sock, int handle);
157 int lttng_ust_ctl_recv_channel_from_consumer(int sock,
158 struct lttng_ust_abi_object_data **channel_data);
159 int lttng_ust_ctl_recv_stream_from_consumer(int sock,
160 struct lttng_ust_abi_object_data **stream_data);
161 int lttng_ust_ctl_send_channel_to_ust(int sock,
163 struct lttng_ust_abi_object_data *channel_data);
164 int lttng_ust_ctl_send_stream_to_ust(int sock,
165 struct lttng_ust_abi_object_data *channel_data,
166 struct lttng_ust_abi_object_data *stream_data);
169 * lttng_ust_ctl_duplicate_ust_object_data allocated a new object in "dest" if
170 * it succeeds (returns 0). It must be released using
171 * lttng_ust_ctl_release_object() and then freed with free().
173 int lttng_ust_ctl_duplicate_ust_object_data(struct lttng_ust_abi_object_data **dest,
174 struct lttng_ust_abi_object_data *src);
177 * API used by consumer.
180 struct lttng_ust_ctl_consumer_channel;
181 struct lttng_ust_ctl_consumer_stream;
182 struct lttng_ust_ctl_consumer_channel_attr;
184 int lttng_ust_ctl_get_nr_stream_per_channel(void);
186 struct lttng_ust_ctl_consumer_channel *lttng_ust_ctl_create_channel(
187 struct lttng_ust_ctl_consumer_channel_attr *attr, const int *stream_fds, int nr_stream_fds);
189 * Each stream created needs to be destroyed before calling
190 * lttng_ust_ctl_destroy_channel().
192 void lttng_ust_ctl_destroy_channel(struct lttng_ust_ctl_consumer_channel *chan);
194 int lttng_ust_ctl_send_channel_to_sessiond(int sock,
195 struct lttng_ust_ctl_consumer_channel *channel);
196 int lttng_ust_ctl_channel_close_wait_fd(struct lttng_ust_ctl_consumer_channel *consumer_chan);
197 int lttng_ust_ctl_channel_close_wakeup_fd(struct lttng_ust_ctl_consumer_channel *consumer_chan);
198 int lttng_ust_ctl_channel_get_wait_fd(struct lttng_ust_ctl_consumer_channel *consumer_chan);
199 int lttng_ust_ctl_channel_get_wakeup_fd(struct lttng_ust_ctl_consumer_channel *consumer_chan);
201 int lttng_ust_ctl_write_metadata_to_channel(struct lttng_ust_ctl_consumer_channel *channel,
202 const char *metadata_str, /* NOT null-terminated */
203 size_t len); /* metadata length */
204 ssize_t lttng_ust_ctl_write_one_packet_to_channel(struct lttng_ust_ctl_consumer_channel *channel,
205 const char *metadata_str, /* NOT null-terminated
207 size_t len); /* metadata length */
210 * Send a NULL stream to finish iteration over all streams of a given
213 int lttng_ust_ctl_send_stream_to_sessiond(int sock, struct lttng_ust_ctl_consumer_stream *stream);
214 int lttng_ust_ctl_stream_close_wait_fd(struct lttng_ust_ctl_consumer_stream *stream);
215 int lttng_ust_ctl_stream_close_wakeup_fd(struct lttng_ust_ctl_consumer_stream *stream);
216 int lttng_ust_ctl_stream_get_wait_fd(struct lttng_ust_ctl_consumer_stream *stream);
217 int lttng_ust_ctl_stream_get_wakeup_fd(struct lttng_ust_ctl_consumer_stream *stream);
219 /* Create/destroy stream buffers for read */
220 struct lttng_ust_ctl_consumer_stream *
221 lttng_ust_ctl_create_stream(struct lttng_ust_ctl_consumer_channel *channel, int cpu);
222 void lttng_ust_ctl_destroy_stream(struct lttng_ust_ctl_consumer_stream *stream);
224 /* For mmap mode, readable without "get" operation */
225 int lttng_ust_ctl_get_mmap_len(struct lttng_ust_ctl_consumer_stream *stream, unsigned long *len);
226 int lttng_ust_ctl_get_max_subbuf_size(struct lttng_ust_ctl_consumer_stream *stream,
230 * For mmap mode, operate on the current packet (between get/put or
231 * get_next/put_next).
233 void *lttng_ust_ctl_get_mmap_base(struct lttng_ust_ctl_consumer_stream *stream);
234 int lttng_ust_ctl_get_mmap_read_offset(struct lttng_ust_ctl_consumer_stream *stream,
236 int lttng_ust_ctl_get_subbuf_size(struct lttng_ust_ctl_consumer_stream *stream, unsigned long *len);
237 int lttng_ust_ctl_get_padded_subbuf_size(struct lttng_ust_ctl_consumer_stream *stream,
239 int lttng_ust_ctl_get_next_subbuf(struct lttng_ust_ctl_consumer_stream *stream);
240 int lttng_ust_ctl_put_next_subbuf(struct lttng_ust_ctl_consumer_stream *stream);
244 int lttng_ust_ctl_snapshot(struct lttng_ust_ctl_consumer_stream *stream);
245 int lttng_ust_ctl_snapshot_sample_positions(struct lttng_ust_ctl_consumer_stream *stream);
246 int lttng_ust_ctl_snapshot_get_consumed(struct lttng_ust_ctl_consumer_stream *stream,
248 int lttng_ust_ctl_snapshot_get_produced(struct lttng_ust_ctl_consumer_stream *stream,
250 int lttng_ust_ctl_get_subbuf(struct lttng_ust_ctl_consumer_stream *stream, unsigned long *pos);
251 int lttng_ust_ctl_put_subbuf(struct lttng_ust_ctl_consumer_stream *stream);
253 int lttng_ust_ctl_flush_buffer(struct lttng_ust_ctl_consumer_stream *stream, int producer_active);
254 int lttng_ust_ctl_clear_buffer(struct lttng_ust_ctl_consumer_stream *stream);
259 * Getters which need to be used on the current packet (between get/put
260 * or get_next/put_next.
263 int lttng_ust_ctl_get_timestamp_begin(struct lttng_ust_ctl_consumer_stream *stream,
264 uint64_t *timestamp_begin);
265 int lttng_ust_ctl_get_timestamp_end(struct lttng_ust_ctl_consumer_stream *stream,
266 uint64_t *timestamp_end);
267 int lttng_ust_ctl_get_events_discarded(struct lttng_ust_ctl_consumer_stream *stream,
268 uint64_t *events_discarded);
269 int lttng_ust_ctl_get_content_size(struct lttng_ust_ctl_consumer_stream *stream,
270 uint64_t *content_size);
271 int lttng_ust_ctl_get_packet_size(struct lttng_ust_ctl_consumer_stream *stream,
272 uint64_t *packet_size);
273 int lttng_ust_ctl_get_sequence_number(struct lttng_ust_ctl_consumer_stream *stream, uint64_t *seq);
276 * Getter returning state invariant for the stream, which can be used
277 * without "get" operation.
280 int lttng_ust_ctl_get_stream_id(struct lttng_ust_ctl_consumer_stream *stream, uint64_t *stream_id);
281 int lttng_ust_ctl_get_instance_id(struct lttng_ust_ctl_consumer_stream *stream, uint64_t *id);
284 * Getter returning the current timestamp as perceived from the
287 int lttng_ust_ctl_get_current_timestamp(struct lttng_ust_ctl_consumer_stream *stream, uint64_t *ts);
289 /* returns whether UST has perf counters support. */
290 int lttng_ust_ctl_has_perf_counters(void);
292 /* Regenerate the statedump. */
293 int lttng_ust_ctl_regenerate_statedump(int sock, int handle);
295 /* event registry management */
297 enum lttng_ust_ctl_socket_type {
298 LTTNG_UST_CTL_SOCKET_CMD = 0,
299 LTTNG_UST_CTL_SOCKET_NOTIFY = 1,
302 enum lttng_ust_ctl_notify_cmd {
303 LTTNG_UST_CTL_NOTIFY_CMD_EVENT = 0,
304 LTTNG_UST_CTL_NOTIFY_CMD_CHANNEL = 1,
305 LTTNG_UST_CTL_NOTIFY_CMD_ENUM = 2,
308 enum lttng_ust_ctl_channel_header {
309 LTTNG_UST_CTL_CHANNEL_HEADER_UNKNOWN = 0,
310 LTTNG_UST_CTL_CHANNEL_HEADER_COMPACT = 1,
311 LTTNG_UST_CTL_CHANNEL_HEADER_LARGE = 2,
314 /* event type structures */
316 enum lttng_ust_ctl_abstract_types {
317 lttng_ust_ctl_atype_integer,
318 lttng_ust_ctl_atype_enum, /* legacy */
319 lttng_ust_ctl_atype_array, /* legacy */
320 lttng_ust_ctl_atype_sequence, /* legacy */
321 lttng_ust_ctl_atype_string,
322 lttng_ust_ctl_atype_float,
323 lttng_ust_ctl_atype_variant, /* legacy */
324 lttng_ust_ctl_atype_struct, /* legacy */
325 lttng_ust_ctl_atype_enum_nestable,
326 lttng_ust_ctl_atype_array_nestable,
327 lttng_ust_ctl_atype_sequence_nestable,
328 lttng_ust_ctl_atype_struct_nestable,
329 lttng_ust_ctl_atype_variant_nestable,
330 NR_LTTNG_UST_CTL_ABSTRACT_TYPES,
333 enum lttng_ust_ctl_string_encodings {
334 lttng_ust_ctl_encode_none = 0,
335 lttng_ust_ctl_encode_UTF8 = 1,
336 lttng_ust_ctl_encode_ASCII = 2,
337 NR_LTTNG_UST_CTL_STRING_ENCODINGS,
340 #define LTTNG_UST_CTL_UST_INTEGER_TYPE_PADDING 24
341 struct lttng_ust_ctl_integer_type {
342 uint32_t size; /* in bits */
344 uint32_t reverse_byte_order;
345 uint32_t base; /* 2, 8, 10, 16, for pretty print */
346 int32_t encoding; /* enum lttng_ust_ctl_string_encodings */
347 uint16_t alignment; /* in bits */
348 char padding[LTTNG_UST_CTL_UST_INTEGER_TYPE_PADDING];
351 #define LTTNG_UST_CTL_UST_FLOAT_TYPE_PADDING 24
352 struct lttng_ust_ctl_float_type {
353 uint32_t exp_dig; /* exponent digits, in bits */
354 uint32_t mant_dig; /* mantissa digits, in bits */
355 uint32_t reverse_byte_order;
356 uint16_t alignment; /* in bits */
357 char padding[LTTNG_UST_CTL_UST_FLOAT_TYPE_PADDING];
360 #define LTTNG_UST_CTL_UST_ENUM_VALUE_PADDING 15
361 struct lttng_ust_ctl_enum_value {
364 char padding[LTTNG_UST_CTL_UST_ENUM_VALUE_PADDING];
367 enum lttng_ust_ctl_ust_enum_entry_options {
368 LTTNG_UST_CTL_UST_ENUM_ENTRY_OPTION_IS_AUTO = 1U << 0,
371 #define LTTNG_UST_CTL_UST_ENUM_ENTRY_PADDING 32
372 struct lttng_ust_ctl_enum_entry {
373 struct lttng_ust_ctl_enum_value start, end; /* start and end are inclusive */
374 char string[LTTNG_UST_ABI_SYM_NAME_LEN];
378 } LTTNG_PACKED extra;
379 char padding[LTTNG_UST_CTL_UST_ENUM_ENTRY_PADDING];
384 #define LTTNG_UST_CTL_UST_BASIC_TYPE_PADDING 296
385 union _lttng_ust_ctl_basic_type {
386 struct lttng_ust_ctl_integer_type integer;
388 char name[LTTNG_UST_ABI_SYM_NAME_LEN];
389 struct lttng_ust_ctl_integer_type container_type;
390 uint64_t id; /* enum ID in sessiond. */
393 int32_t encoding; /* enum lttng_ust_ctl_string_encodings */
395 struct lttng_ust_ctl_float_type _float;
396 char padding[LTTNG_UST_CTL_UST_BASIC_TYPE_PADDING];
400 struct lttng_ust_ctl_basic_type {
401 enum lttng_ust_ctl_abstract_types atype;
403 union _lttng_ust_ctl_basic_type basic;
408 * Padding is derived from largest member: u.legacy.sequence which
409 * contains two basic types, each with LTTNG_UST_CTL_UST_BASIC_TYPE_PADDING.
411 #define LTTNG_UST_CTL_UST_TYPE_PADDING (2 * LTTNG_UST_CTL_UST_BASIC_TYPE_PADDING)
412 struct lttng_ust_ctl_type {
413 enum lttng_ust_ctl_abstract_types atype;
415 struct lttng_ust_ctl_integer_type integer;
416 struct lttng_ust_ctl_float_type _float;
418 int32_t encoding; /* enum lttng_ust_ctl_string_encodings */
421 char name[LTTNG_UST_ABI_SYM_NAME_LEN];
422 uint64_t id; /* enum ID in sessiond. */
423 /* container_type follows after this struct lttng_ust_ctl_field. */
426 uint32_t length; /* num. elems. */
428 /* elem_type follows after this struct lttng_ust_ctl_field. */
431 char length_name[LTTNG_UST_ABI_SYM_NAME_LEN];
432 uint32_t alignment; /* Alignment before elements. */
433 /* elem_type follows after the length_type. */
438 /* Followed by nr_fields struct lttng_ust_ctl_field. */
442 char tag_name[LTTNG_UST_ABI_SYM_NAME_LEN];
444 /* Followed by nr_choices struct lttng_ust_ctl_field. */
449 union _lttng_ust_ctl_basic_type basic;
451 struct lttng_ust_ctl_basic_type elem_type;
452 uint32_t length; /* num. elems. */
455 struct lttng_ust_ctl_basic_type length_type;
456 struct lttng_ust_ctl_basic_type elem_type;
460 /* Followed by nr_fields struct lttng_ust_ctl_field. */
464 char tag_name[LTTNG_UST_ABI_SYM_NAME_LEN];
465 /* Followed by nr_choices struct lttng_ust_ctl_field. */
468 char padding[LTTNG_UST_CTL_UST_TYPE_PADDING];
472 #define LTTNG_UST_CTL_UST_FIELD_PADDING 28
473 struct lttng_ust_ctl_field {
474 char name[LTTNG_UST_ABI_SYM_NAME_LEN];
475 struct lttng_ust_ctl_type type;
476 char padding[LTTNG_UST_CTL_UST_FIELD_PADDING];
480 * Returns 0 on success, negative error value on error.
481 * If an error other than -LTTNG_UST_ERR_UNSUP_MAJOR is returned,
482 * the output fields are not populated.
484 int lttng_ust_ctl_recv_reg_msg(int sock,
485 enum lttng_ust_ctl_socket_type *type,
492 uint32_t *bits_per_long,
493 uint32_t *uint8_t_alignment,
494 uint32_t *uint16_t_alignment,
495 uint32_t *uint32_t_alignment,
496 uint32_t *uint64_t_alignment,
497 uint32_t *long_alignment,
499 char *name); /* size LTTNG_UST_ABI_PROCNAME_LEN */
502 * Returns 0 on success, negative UST or system error value on error.
503 * Receive the notification command. The "notify_cmd" can then be used
504 * by the caller to find out which lttng_ust_ctl_recv_* function should be
505 * called to receive the notification, and which lttng_ust_ctl_reply_* is
508 int lttng_ust_ctl_recv_notify(int sock, enum lttng_ust_ctl_notify_cmd *notify_cmd);
511 * Returns 0 on success, negative UST or system error value on error.
513 int lttng_ust_ctl_recv_register_event(int sock,
514 int *session_objd, /* session descriptor (output) */
515 int *channel_objd, /* channel descriptor (output) */
517 * event name (output,
518 * size LTTNG_UST_ABI_SYM_NAME_LEN)
523 * (output, dynamically
524 * allocated, must be free(3)'d
525 * by the caller if function
529 struct lttng_ust_ctl_field **fields,
530 char **model_emf_uri);
533 * Returns 0 on success, negative error value on error.
535 int lttng_ust_ctl_reply_register_event(int sock,
536 uint32_t id, /* event id (input) */
537 int ret_code); /* return code. 0 ok, negative error */
540 * Returns 0 on success, negative UST or system error value on error.
542 int lttng_ust_ctl_recv_register_enum(int sock,
545 struct lttng_ust_ctl_enum_entry **entries,
549 * Returns 0 on success, negative error value on error.
551 int lttng_ust_ctl_reply_register_enum(int sock,
552 uint64_t id, /* enum id (input) */
556 * Returns 0 on success, negative UST or system error value on error.
558 int lttng_ust_ctl_recv_register_channel(int sock,
559 int *session_objd, /* session descriptor (output) */
560 int *channel_objd, /* channel descriptor (output) */
561 size_t *nr_fields, /* context fields */
562 struct lttng_ust_ctl_field **fields);
565 * Returns 0 on success, negative error value on error.
567 int lttng_ust_ctl_reply_register_channel(int sock,
569 enum lttng_ust_ctl_channel_header header_type,
570 int ret_code); /* return code. 0 ok, negative error */
576 enum lttng_ust_ctl_counter_bitness {
577 LTTNG_UST_CTL_COUNTER_BITNESS_32 = 0,
578 LTTNG_UST_CTL_COUNTER_BITNESS_64 = 1,
581 enum lttng_ust_ctl_counter_arithmetic {
582 LTTNG_UST_CTL_COUNTER_ARITHMETIC_MODULAR = 0,
583 LTTNG_UST_CTL_COUNTER_ARITHMETIC_SATURATION = 1,
586 /* Used as alloc flags. */
587 enum lttng_ust_ctl_counter_alloc {
588 LTTNG_UST_CTL_COUNTER_ALLOC_PER_CPU = (1 << 0),
589 LTTNG_UST_CTL_COUNTER_ALLOC_GLOBAL = (1 << 1),
592 struct lttng_ust_ctl_daemon_counter;
594 int lttng_ust_ctl_get_nr_cpu_per_counter(void);
596 struct lttng_ust_ctl_counter_dimension {
598 uint64_t underflow_index;
599 uint64_t overflow_index;
600 uint8_t has_underflow;
601 uint8_t has_overflow;
604 struct lttng_ust_ctl_daemon_counter *
605 lttng_ust_ctl_create_counter(size_t nr_dimensions,
606 const struct lttng_ust_ctl_counter_dimension *dimensions,
607 int64_t global_sum_step,
608 int global_counter_fd,
609 int nr_counter_cpu_fds,
610 const int *counter_cpu_fds,
611 enum lttng_ust_ctl_counter_bitness bitness,
612 enum lttng_ust_ctl_counter_arithmetic arithmetic,
613 uint32_t alloc_flags,
616 int lttng_ust_ctl_create_counter_data(struct lttng_ust_ctl_daemon_counter *counter,
617 struct lttng_ust_abi_object_data **counter_data);
619 int lttng_ust_ctl_create_counter_global_data(struct lttng_ust_ctl_daemon_counter *counter,
620 struct lttng_ust_abi_object_data **counter_global_data);
621 int lttng_ust_ctl_create_counter_cpu_data(struct lttng_ust_ctl_daemon_counter *counter,
623 struct lttng_ust_abi_object_data **counter_cpu_data);
626 * Each counter data and counter cpu data created need to be destroyed
627 * before calling lttng_ust_ctl_destroy_counter().
629 void lttng_ust_ctl_destroy_counter(struct lttng_ust_ctl_daemon_counter *counter);
631 int lttng_ust_ctl_send_counter_data_to_ust(int sock,
633 struct lttng_ust_abi_object_data *counter_data);
634 int lttng_ust_ctl_send_counter_global_data_to_ust(
636 struct lttng_ust_abi_object_data *counter_data,
637 struct lttng_ust_abi_object_data *counter_global_data);
638 int lttng_ust_ctl_send_counter_cpu_data_to_ust(int sock,
639 struct lttng_ust_abi_object_data *counter_data,
640 struct lttng_ust_abi_object_data *counter_cpu_data);
642 int lttng_ust_ctl_counter_read(struct lttng_ust_ctl_daemon_counter *counter,
643 const size_t *dimension_indexes,
648 int lttng_ust_ctl_counter_aggregate(struct lttng_ust_ctl_daemon_counter *counter,
649 const size_t *dimension_indexes,
653 int lttng_ust_ctl_counter_clear(struct lttng_ust_ctl_daemon_counter *counter,
654 const size_t *dimension_indexes);
656 void lttng_ust_ctl_sigbus_handle(void *addr);
658 #endif /* LTTNG_UST_CTL_INTERNAL_H */