Move 'enum lttng_client_types' to private headers
[lttng-ust.git] / include / lttng / ust-events.h
1 /*
2 * SPDX-License-Identifier: MIT
3 *
4 * Copyright (C) 2010-2012 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
5 *
6 * Holds LTTng per-session event registry.
7 */
8
9 #ifndef _LTTNG_UST_EVENTS_H
10 #define _LTTNG_UST_EVENTS_H
11
12 #include <urcu/list.h>
13 #include <urcu/hlist.h>
14 #include <stddef.h>
15 #include <stdint.h>
16 #include <lttng/ust-abi.h>
17 #include <lttng/ust-tracer.h>
18 #include <lttng/ust-endian.h>
19 #include <float.h>
20 #include <errno.h>
21 #include <urcu/ref.h>
22 #include <pthread.h>
23
24 #ifndef LTTNG_PACKED
25 #error "LTTNG_PACKED should be defined"
26 #endif
27
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31
32 #define LTTNG_UST_UUID_LEN 16
33
34 /*
35 * Tracepoint provider version. Compatibility based on the major number.
36 * Older tracepoint providers can always register to newer lttng-ust
37 * library, but the opposite is rejected: a newer tracepoint provider is
38 * rejected by an older lttng-ust library.
39 */
40 #define LTTNG_UST_PROVIDER_MAJOR 2
41 #define LTTNG_UST_PROVIDER_MINOR 0
42
43 struct lttng_channel;
44 struct lttng_session;
45 struct lttng_ust_lib_ring_buffer_ctx;
46 struct lttng_ust_context_app;
47 struct lttng_event_field;
48 struct lttng_event_notifier;
49 struct lttng_event_notifier_group;
50
51 /*
52 * Data structures used by tracepoint event declarations, and by the
53 * tracer. Those structures have padding for future extension.
54 */
55
56 /* Type description */
57
58 /* Update the astract_types name table in lttng-types.c along with this enum */
59 enum lttng_abstract_types {
60 atype_integer,
61 atype_enum, /* legacy */
62 atype_array, /* legacy */
63 atype_sequence, /* legacy */
64 atype_string,
65 atype_float,
66 atype_dynamic,
67 atype_struct, /* legacy */
68 atype_enum_nestable,
69 atype_array_nestable,
70 atype_sequence_nestable,
71 atype_struct_nestable,
72 NR_ABSTRACT_TYPES,
73 };
74
75 /* Update the string_encodings name table in lttng-types.c along with this enum */
76 enum lttng_string_encodings {
77 lttng_encode_none = 0,
78 lttng_encode_UTF8 = 1,
79 lttng_encode_ASCII = 2,
80 NR_STRING_ENCODINGS,
81 };
82
83 struct lttng_enum_value {
84 unsigned long long value;
85 unsigned int signedness:1;
86 };
87
88 enum lttng_enum_entry_options {
89 LTTNG_ENUM_ENTRY_OPTION_IS_AUTO = 1U << 0,
90 };
91
92 #define LTTNG_UST_ENUM_ENTRY_PADDING 16
93 struct lttng_enum_entry {
94 struct lttng_enum_value start, end; /* start and end are inclusive */
95 const char *string;
96 union {
97 struct {
98 unsigned int options;
99 } LTTNG_PACKED extra;
100 char padding[LTTNG_UST_ENUM_ENTRY_PADDING];
101 } u;
102 };
103
104 #define __type_integer(_type, _byte_order, _base, _encoding) \
105 { \
106 .atype = atype_integer, \
107 .u = \
108 { \
109 .integer = \
110 { \
111 .size = sizeof(_type) * CHAR_BIT, \
112 .alignment = lttng_alignof(_type) * CHAR_BIT, \
113 .signedness = lttng_is_signed_type(_type), \
114 .reverse_byte_order = _byte_order != BYTE_ORDER, \
115 .base = _base, \
116 .encoding = lttng_encode_##_encoding, \
117 } \
118 }, \
119 } \
120
121 #define LTTNG_UST_INTEGER_TYPE_PADDING 24
122 struct lttng_integer_type {
123 unsigned int size; /* in bits */
124 unsigned short alignment; /* in bits */
125 unsigned int signedness:1;
126 unsigned int reverse_byte_order:1;
127 unsigned int base; /* 2, 8, 10, 16, for pretty print */
128 enum lttng_string_encodings encoding;
129 char padding[LTTNG_UST_INTEGER_TYPE_PADDING];
130 };
131
132 /*
133 * Only float and double are supported. long double is not supported at
134 * the moment.
135 */
136 #define _float_mant_dig(_type) \
137 (sizeof(_type) == sizeof(float) ? FLT_MANT_DIG \
138 : (sizeof(_type) == sizeof(double) ? DBL_MANT_DIG \
139 : 0))
140
141 #define __type_float(_type) \
142 { \
143 .atype = atype_float, \
144 .u = \
145 { \
146 ._float = \
147 { \
148 .exp_dig = sizeof(_type) * CHAR_BIT \
149 - _float_mant_dig(_type), \
150 .mant_dig = _float_mant_dig(_type), \
151 .alignment = lttng_alignof(_type) * CHAR_BIT, \
152 .reverse_byte_order = BYTE_ORDER != FLOAT_WORD_ORDER, \
153 } \
154 } \
155 } \
156
157 #define LTTNG_UST_FLOAT_TYPE_PADDING 24
158 struct lttng_float_type {
159 unsigned int exp_dig; /* exponent digits, in bits */
160 unsigned int mant_dig; /* mantissa digits, in bits */
161 unsigned short alignment; /* in bits */
162 unsigned int reverse_byte_order:1;
163 char padding[LTTNG_UST_FLOAT_TYPE_PADDING];
164 };
165
166 /* legacy */
167 #define LTTNG_UST_BASIC_TYPE_PADDING 128
168 union _lttng_basic_type {
169 struct lttng_integer_type integer; /* legacy */
170 struct {
171 const struct lttng_enum_desc *desc; /* Enumeration mapping */
172 struct lttng_integer_type container_type;
173 } enumeration; /* legacy */
174 struct {
175 enum lttng_string_encodings encoding;
176 } string; /* legacy */
177 struct lttng_float_type _float; /* legacy */
178 char padding[LTTNG_UST_BASIC_TYPE_PADDING];
179 };
180
181 /* legacy */
182 struct lttng_basic_type {
183 enum lttng_abstract_types atype;
184 union {
185 union _lttng_basic_type basic;
186 } u;
187 };
188
189 #define LTTNG_UST_TYPE_PADDING 128
190 struct lttng_type {
191 enum lttng_abstract_types atype;
192 union {
193 /* provider ABI 2.0 */
194 struct lttng_integer_type integer;
195 struct lttng_float_type _float;
196 struct {
197 enum lttng_string_encodings encoding;
198 } string;
199 struct {
200 const struct lttng_enum_desc *desc; /* Enumeration mapping */
201 struct lttng_type *container_type;
202 } enum_nestable;
203 struct {
204 const struct lttng_type *elem_type;
205 unsigned int length; /* Num. elems. */
206 unsigned int alignment;
207 } array_nestable;
208 struct {
209 const char *length_name; /* Length field name. */
210 const struct lttng_type *elem_type;
211 unsigned int alignment; /* Alignment before elements. */
212 } sequence_nestable;
213 struct {
214 unsigned int nr_fields;
215 const struct lttng_event_field *fields; /* Array of fields. */
216 unsigned int alignment;
217 } struct_nestable;
218
219 union {
220 /* legacy provider ABI 1.0 */
221 union _lttng_basic_type basic; /* legacy */
222 struct {
223 struct lttng_basic_type elem_type;
224 unsigned int length; /* Num. elems. */
225 } array; /* legacy */
226 struct {
227 struct lttng_basic_type length_type;
228 struct lttng_basic_type elem_type;
229 } sequence; /* legacy */
230 struct {
231 unsigned int nr_fields;
232 struct lttng_event_field *fields; /* Array of fields. */
233 } _struct; /* legacy */
234 } legacy;
235 char padding[LTTNG_UST_TYPE_PADDING];
236 } u;
237 };
238
239 #define LTTNG_UST_ENUM_TYPE_PADDING 24
240 struct lttng_enum_desc {
241 const char *name;
242 const struct lttng_enum_entry *entries;
243 unsigned int nr_entries;
244 char padding[LTTNG_UST_ENUM_TYPE_PADDING];
245 };
246
247 /*
248 * Event field description
249 *
250 * IMPORTANT: this structure is part of the ABI between the probe and
251 * UST. Fields need to be only added at the end, never reordered, never
252 * removed.
253 */
254
255 #define LTTNG_UST_EVENT_FIELD_PADDING 28
256 struct lttng_event_field {
257 const char *name;
258 struct lttng_type type;
259 unsigned int nowrite; /* do not write into trace */
260 union {
261 struct {
262 unsigned int nofilter:1; /* do not consider for filter */
263 } ext;
264 char padding[LTTNG_UST_EVENT_FIELD_PADDING];
265 } u;
266 };
267
268 enum lttng_ust_dynamic_type {
269 LTTNG_UST_DYNAMIC_TYPE_NONE,
270 LTTNG_UST_DYNAMIC_TYPE_S8,
271 LTTNG_UST_DYNAMIC_TYPE_S16,
272 LTTNG_UST_DYNAMIC_TYPE_S32,
273 LTTNG_UST_DYNAMIC_TYPE_S64,
274 LTTNG_UST_DYNAMIC_TYPE_U8,
275 LTTNG_UST_DYNAMIC_TYPE_U16,
276 LTTNG_UST_DYNAMIC_TYPE_U32,
277 LTTNG_UST_DYNAMIC_TYPE_U64,
278 LTTNG_UST_DYNAMIC_TYPE_FLOAT,
279 LTTNG_UST_DYNAMIC_TYPE_DOUBLE,
280 LTTNG_UST_DYNAMIC_TYPE_STRING,
281 _NR_LTTNG_UST_DYNAMIC_TYPES,
282 };
283
284 struct lttng_ctx_value {
285 enum lttng_ust_dynamic_type sel;
286 union {
287 int64_t s64;
288 uint64_t u64;
289 const char *str;
290 double d;
291 } u;
292 };
293
294 struct lttng_perf_counter_field;
295
296 #define LTTNG_UST_CTX_FIELD_PADDING 40
297 struct lttng_ctx_field {
298 struct lttng_event_field event_field;
299 size_t (*get_size)(struct lttng_ctx_field *field, size_t offset);
300 void (*record)(struct lttng_ctx_field *field,
301 struct lttng_ust_lib_ring_buffer_ctx *ctx,
302 struct lttng_channel *chan);
303 void (*get_value)(struct lttng_ctx_field *field,
304 struct lttng_ctx_value *value);
305 union {
306 struct lttng_perf_counter_field *perf_counter;
307 char padding[LTTNG_UST_CTX_FIELD_PADDING];
308 } u;
309 void (*destroy)(struct lttng_ctx_field *field);
310 char *field_name; /* Has ownership, dynamically allocated. */
311 };
312
313 #define LTTNG_UST_CTX_PADDING 20
314 struct lttng_ctx {
315 struct lttng_ctx_field *fields;
316 unsigned int nr_fields;
317 unsigned int allocated_fields;
318 unsigned int largest_align;
319 char padding[LTTNG_UST_CTX_PADDING];
320 };
321
322 #define LTTNG_UST_EVENT_DESC_PADDING 40
323 struct lttng_event_desc {
324 const char *name;
325 void (*probe_callback)(void);
326 const struct lttng_event_ctx *ctx; /* context */
327 const struct lttng_event_field *fields; /* event payload */
328 unsigned int nr_fields;
329 const int **loglevel;
330 const char *signature; /* Argument types/names received */
331 union {
332 struct {
333 const char **model_emf_uri;
334 void (*event_notifier_callback)(void);
335 } ext;
336 char padding[LTTNG_UST_EVENT_DESC_PADDING];
337 } u;
338 };
339
340 #define LTTNG_UST_PROBE_DESC_PADDING 12
341 struct lttng_probe_desc {
342 const char *provider;
343 const struct lttng_event_desc **event_desc;
344 unsigned int nr_events;
345 struct cds_list_head head; /* chain registered probes */
346 struct cds_list_head lazy_init_head;
347 int lazy; /* lazy registration */
348 uint32_t major;
349 uint32_t minor;
350 char padding[LTTNG_UST_PROBE_DESC_PADDING];
351 };
352
353 /* Data structures used by the tracer. */
354
355 enum lttng_enabler_format_type {
356 LTTNG_ENABLER_FORMAT_STAR_GLOB,
357 LTTNG_ENABLER_FORMAT_EVENT,
358 };
359
360 /*
361 * Enabler field, within whatever object is enabling an event. Target of
362 * backward reference.
363 */
364 struct lttng_enabler {
365 enum lttng_enabler_format_type format_type;
366
367 /* head list of struct lttng_ust_filter_bytecode_node */
368 struct cds_list_head filter_bytecode_head;
369 /* head list of struct lttng_ust_excluder_node */
370 struct cds_list_head excluder_head;
371
372 struct lttng_ust_event event_param;
373 unsigned int enabled:1;
374 };
375
376 struct tp_list_entry {
377 struct lttng_ust_tracepoint_iter tp;
378 struct cds_list_head head;
379 };
380
381 struct lttng_ust_tracepoint_list {
382 struct tp_list_entry *iter;
383 struct cds_list_head head;
384 };
385
386 struct tp_field_list_entry {
387 struct lttng_ust_field_iter field;
388 struct cds_list_head head;
389 };
390
391 struct lttng_ust_field_list {
392 struct tp_field_list_entry *iter;
393 struct cds_list_head head;
394 };
395
396 struct ust_pending_probe;
397 struct lttng_event;
398
399 /*
400 * Bytecode interpreter return value masks.
401 */
402 enum lttng_bytecode_interpreter_ret {
403 LTTNG_INTERPRETER_DISCARD = 0,
404 LTTNG_INTERPRETER_RECORD_FLAG = (1ULL << 0),
405 /* Other bits are kept for future use. */
406 };
407
408 struct lttng_interpreter_output;
409
410 /*
411 * This structure is used in the probes. More specifically, the `filter` and
412 * `node` fields are explicity used in the probes. When modifying this
413 * structure we must not change the layout of these two fields as it is
414 * considered ABI.
415 */
416 struct lttng_bytecode_runtime {
417 /* Associated bytecode */
418 struct lttng_ust_bytecode_node *bc;
419 union {
420 uint64_t (*filter)(void *interpreter_data,
421 const char *interpreter_stack_data);
422 uint64_t (*capture)(void *interpreter_data,
423 const char *interpreter_stack_data,
424 struct lttng_interpreter_output *interpreter_output);
425 } interpreter_funcs;
426 int link_failed;
427 struct cds_list_head node; /* list of bytecode runtime in event */
428 /*
429 * Pointer to a URCU-protected pointer owned by an `struct
430 * lttng_session`or `struct lttng_event_notifier_group`.
431 */
432 struct lttng_ctx **pctx;
433 };
434
435 /*
436 * Objects in a linked-list of enablers, owned by an event or event_notifier.
437 * This is used because an event (or a event_notifier) can be enabled by more
438 * than one enabler and we want a quick way to iterate over all enablers of an
439 * object.
440 *
441 * For example, event rules "my_app:a*" and "my_app:ab*" will both match the
442 * event with the name "my_app:abc".
443 */
444 struct lttng_enabler_ref {
445 struct cds_list_head node; /* enabler ref list */
446 struct lttng_enabler *ref; /* backward ref */
447 };
448
449 /*
450 * lttng_event structure is referred to by the tracing fast path. It
451 * must be kept small.
452 *
453 * IMPORTANT: this structure is part of the ABI between the probe and
454 * UST. Fields need to be only added at the end, never reordered, never
455 * removed.
456 */
457 struct lttng_event {
458 unsigned int id;
459 struct lttng_channel *chan;
460 int enabled;
461 const struct lttng_event_desc *desc;
462 struct lttng_ctx *ctx;
463 enum lttng_ust_instrumentation instrumentation;
464 struct cds_list_head node; /* Event list in session */
465
466 /* list of struct lttng_bytecode_runtime, sorted by seqnum */
467 struct cds_list_head filter_bytecode_runtime_head;
468 int has_enablers_without_bytecode;
469 /* Backward references: list of lttng_enabler_ref (ref to enablers) */
470 struct cds_list_head enablers_ref_head;
471 struct cds_hlist_node hlist; /* session ht of events */
472 int registered; /* has reg'd tracepoint probe */
473 };
474
475 struct lttng_event_notifier {
476 uint64_t user_token;
477 uint64_t error_counter_index;
478 int enabled;
479 int registered; /* has reg'd tracepoint probe */
480 size_t num_captures; /* Needed to allocate the msgpack array. */
481 void (*notification_send)(struct lttng_event_notifier *event_notifier,
482 const char *stack_data);
483 struct cds_list_head filter_bytecode_runtime_head;
484 struct cds_list_head capture_bytecode_runtime_head;
485 int has_enablers_without_bytecode;
486 struct cds_list_head enablers_ref_head;
487 const struct lttng_event_desc *desc;
488 struct cds_hlist_node hlist; /* hashtable of event_notifiers */
489 struct cds_list_head node; /* event_notifier list in session */
490 struct lttng_event_notifier_group *group; /* weak ref */
491 };
492
493 struct lttng_enum {
494 const struct lttng_enum_desc *desc;
495 struct lttng_session *session;
496 struct cds_list_head node; /* Enum list in session */
497 struct cds_hlist_node hlist; /* Session ht of enums */
498 uint64_t id; /* Enumeration ID in sessiond */
499 };
500
501 struct channel;
502 struct lttng_ust_shm_handle;
503
504 /*
505 * IMPORTANT: this structure is part of the ABI between the probe and
506 * UST. Fields need to be only added at the end, never reordered, never
507 * removed.
508 */
509 struct lttng_channel_ops {
510 struct lttng_channel *(*channel_create)(const char *name,
511 void *buf_addr,
512 size_t subbuf_size, size_t num_subbuf,
513 unsigned int switch_timer_interval,
514 unsigned int read_timer_interval,
515 unsigned char *uuid,
516 uint32_t chan_id,
517 const int *stream_fds, int nr_stream_fds,
518 int64_t blocking_timeout);
519 void (*channel_destroy)(struct lttng_channel *chan);
520 int (*event_reserve)(struct lttng_ust_lib_ring_buffer_ctx *ctx,
521 uint32_t event_id);
522 void (*event_commit)(struct lttng_ust_lib_ring_buffer_ctx *ctx);
523 void (*event_write)(struct lttng_ust_lib_ring_buffer_ctx *ctx,
524 const void *src, size_t len);
525 /*
526 * packet_avail_size returns the available size in the current
527 * packet. Note that the size returned is only a hint, since it
528 * may change due to concurrent writes.
529 */
530 size_t (*packet_avail_size)(struct channel *chan,
531 struct lttng_ust_shm_handle *handle);
532 int (*is_finalized)(struct channel *chan);
533 int (*is_disabled)(struct channel *chan);
534 int (*flush_buffer)(struct channel *chan, struct lttng_ust_shm_handle *handle);
535 void (*event_strcpy)(struct lttng_ust_lib_ring_buffer_ctx *ctx,
536 const char *src, size_t len);
537 };
538
539 /*
540 * IMPORTANT: this structure is part of the ABI between the probe and
541 * UST. Fields need to be only added at the end, never reordered, never
542 * removed.
543 */
544 struct lttng_channel {
545 /*
546 * The pointers located in this private data are NOT safe to be
547 * dereferenced by the consumer. The only operations the
548 * consumer process is designed to be allowed to do is to read
549 * and perform subbuffer flush.
550 */
551 struct channel *chan; /* Channel buffers */
552 int enabled;
553 struct lttng_ctx *ctx;
554 /* Event ID management */
555 struct lttng_session *session;
556 int objd; /* Object associated to channel */
557 struct cds_list_head node; /* Channel list in session */
558 const struct lttng_channel_ops *ops;
559 int header_type; /* 0: unset, 1: compact, 2: large */
560 struct lttng_ust_shm_handle *handle; /* shared-memory handle */
561
562 /* Channel ID */
563 unsigned int id;
564 enum lttng_ust_chan_type type;
565 unsigned char uuid[LTTNG_UST_UUID_LEN]; /* Trace session unique ID */
566 int tstate:1; /* Transient enable state */
567 };
568
569 #define LTTNG_COUNTER_DIMENSION_MAX 8
570
571 struct lttng_counter_dimension {
572 uint64_t size;
573 uint64_t underflow_index;
574 uint64_t overflow_index;
575 uint8_t has_underflow;
576 uint8_t has_overflow;
577 };
578
579 struct lttng_counter_ops {
580 struct lib_counter *(*counter_create)(size_t nr_dimensions,
581 const struct lttng_counter_dimension *dimensions,
582 int64_t global_sum_step,
583 int global_counter_fd,
584 int nr_counter_cpu_fds,
585 const int *counter_cpu_fds,
586 bool is_daemon);
587 void (*counter_destroy)(struct lib_counter *counter);
588 int (*counter_add)(struct lib_counter *counter,
589 const size_t *dimension_indexes, int64_t v);
590 int (*counter_read)(struct lib_counter *counter,
591 const size_t *dimension_indexes, int cpu,
592 int64_t *value, bool *overflow, bool *underflow);
593 int (*counter_aggregate)(struct lib_counter *counter,
594 const size_t *dimension_indexes, int64_t *value,
595 bool *overflow, bool *underflow);
596 int (*counter_clear)(struct lib_counter *counter, const size_t *dimension_indexes);
597 };
598
599 #define LTTNG_UST_STACK_CTX_PADDING 32
600 struct lttng_stack_ctx {
601 struct lttng_event *event;
602 struct lttng_ctx *chan_ctx; /* RCU dereferenced. */
603 struct lttng_ctx *event_ctx; /* RCU dereferenced. */
604 char padding[LTTNG_UST_STACK_CTX_PADDING];
605 };
606
607 #define LTTNG_UST_EVENT_HT_BITS 12
608 #define LTTNG_UST_EVENT_HT_SIZE (1U << LTTNG_UST_EVENT_HT_BITS)
609
610 struct lttng_ust_event_ht {
611 struct cds_hlist_head table[LTTNG_UST_EVENT_HT_SIZE];
612 };
613
614 #define LTTNG_UST_EVENT_NOTIFIER_HT_BITS 12
615 #define LTTNG_UST_EVENT_NOTIFIER_HT_SIZE (1U << LTTNG_UST_EVENT_NOTIFIER_HT_BITS)
616 struct lttng_ust_event_notifier_ht {
617 struct cds_hlist_head table[LTTNG_UST_EVENT_NOTIFIER_HT_SIZE];
618 };
619
620 #define LTTNG_UST_ENUM_HT_BITS 12
621 #define LTTNG_UST_ENUM_HT_SIZE (1U << LTTNG_UST_ENUM_HT_BITS)
622
623 struct lttng_ust_enum_ht {
624 struct cds_hlist_head table[LTTNG_UST_ENUM_HT_SIZE];
625 };
626
627 /*
628 * IMPORTANT: this structure is part of the ABI between the probe and
629 * UST. Fields need to be only added at the end, never reordered, never
630 * removed.
631 */
632 struct lttng_session {
633 int active; /* Is trace session active ? */
634 int been_active; /* Been active ? */
635 int objd; /* Object associated */
636 struct cds_list_head chan_head; /* Channel list head */
637 struct cds_list_head events_head; /* list of events */
638 struct cds_list_head node; /* Session list */
639
640 /* New UST 2.1 */
641 /* List of enablers */
642 struct cds_list_head enablers_head;
643 struct lttng_ust_event_ht events_ht; /* ht of events */
644 void *owner; /* object owner */
645 int tstate:1; /* Transient enable state */
646
647 /* New UST 2.4 */
648 int statedump_pending:1;
649
650 /* New UST 2.8 */
651 struct lttng_ust_enum_ht enums_ht; /* ht of enumerations */
652 struct cds_list_head enums_head;
653 struct lttng_ctx *ctx; /* contexts for filters. */
654 };
655
656 struct lttng_counter {
657 int objd;
658 struct lttng_event_notifier_group *event_notifier_group; /* owner */
659 struct lttng_counter_transport *transport;
660 struct lib_counter *counter;
661 struct lttng_counter_ops *ops;
662 };
663
664 struct lttng_event_notifier_group {
665 int objd;
666 void *owner;
667 int notification_fd;
668 struct cds_list_head node; /* Event notifier group handle list */
669 struct cds_list_head enablers_head;
670 struct cds_list_head event_notifiers_head; /* list of event_notifiers */
671 struct lttng_ust_event_notifier_ht event_notifiers_ht; /* hashtable of event_notifiers */
672 struct lttng_ctx *ctx; /* contexts for filters. */
673
674 struct lttng_counter *error_counter;
675 size_t error_counter_len;
676 };
677
678 struct lttng_transport {
679 char *name;
680 struct cds_list_head node;
681 struct lttng_channel_ops ops;
682 const struct lttng_ust_lib_ring_buffer_config *client_config;
683 };
684
685 struct lttng_counter_transport {
686 char *name;
687 struct cds_list_head node;
688 struct lttng_counter_ops ops;
689 const struct lib_counter_config *client_config;
690 };
691
692 struct lttng_session *lttng_session_create(void);
693 int lttng_session_enable(struct lttng_session *session);
694 int lttng_session_disable(struct lttng_session *session);
695 int lttng_session_statedump(struct lttng_session *session);
696 void lttng_session_destroy(struct lttng_session *session);
697
698 struct lttng_channel *lttng_channel_create(struct lttng_session *session,
699 const char *transport_name,
700 void *buf_addr,
701 size_t subbuf_size, size_t num_subbuf,
702 unsigned int switch_timer_interval,
703 unsigned int read_timer_interval,
704 int **shm_fd, int **wait_fd,
705 uint64_t **memory_map_size,
706 struct lttng_channel *chan_priv_init);
707
708 int lttng_channel_enable(struct lttng_channel *channel);
709 int lttng_channel_disable(struct lttng_channel *channel);
710
711 void lttng_transport_register(struct lttng_transport *transport);
712 void lttng_transport_unregister(struct lttng_transport *transport);
713
714 int lttng_probe_register(struct lttng_probe_desc *desc);
715 void lttng_probe_unregister(struct lttng_probe_desc *desc);
716 void lttng_probe_provider_unregister_events(struct lttng_probe_desc *desc);
717 int lttng_fix_pending_events(void);
718 int lttng_probes_init(void);
719 void lttng_probes_exit(void);
720
721 /*
722 * Can be used by applications that change their procname to clear the ust cached value.
723 */
724 void lttng_context_procname_reset(void);
725
726 struct lttng_transport *lttng_transport_find(const char *name);
727
728 int lttng_probes_get_event_list(struct lttng_ust_tracepoint_list *list);
729 void lttng_probes_prune_event_list(struct lttng_ust_tracepoint_list *list);
730 struct lttng_ust_tracepoint_iter *
731 lttng_ust_tracepoint_list_get_iter_next(struct lttng_ust_tracepoint_list *list);
732 int lttng_probes_get_field_list(struct lttng_ust_field_list *list);
733 void lttng_probes_prune_field_list(struct lttng_ust_field_list *list);
734 struct lttng_ust_field_iter *
735 lttng_ust_field_list_get_iter_next(struct lttng_ust_field_list *list);
736
737 void lttng_free_event_filter_runtime(struct lttng_event *event);
738
739 struct cds_list_head *lttng_get_probe_list_head(void);
740 int lttng_session_active(void);
741
742 typedef int (*t_statedump_func_ptr)(struct lttng_session *session);
743 void lttng_handle_pending_statedump(void *owner);
744 struct cds_list_head *_lttng_get_sessions(void);
745
746 struct lttng_enum *lttng_ust_enum_get_from_desc(struct lttng_session *session,
747 const struct lttng_enum_desc *enum_desc);
748
749 void lttng_ust_dl_update(void *ip);
750
751 #ifdef __cplusplus
752 }
753 #endif
754
755 #endif /* _LTTNG_UST_EVENTS_H */
This page took 0.044785 seconds and 5 git commands to generate.