1 #ifndef _LTTNG_UST_EVENTS_H
2 #define _LTTNG_UST_EVENTS_H
7 * Copyright 2010-2012 (c) - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 * Holds LTTng per-session event registry.
11 * Permission is hereby granted, free of charge, to any person obtaining a copy
12 * of this software and associated documentation files (the "Software"), to deal
13 * in the Software without restriction, including without limitation the rights
14 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15 * copies of the Software, and to permit persons to whom the Software is
16 * furnished to do so, subject to the following conditions:
18 * The above copyright notice and this permission notice shall be included in
19 * all copies or substantial portions of the Software.
21 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30 #include <urcu/list.h>
31 #include <urcu/hlist.h>
33 #include <lttng/ust-config.h>
34 #include <lttng/ust-abi.h>
35 #include <lttng/ust-tracer.h>
36 #include <lttng/ust-endian.h>
43 #error "LTTNG_PACKED should be defined"
50 #define LTTNG_UST_UUID_LEN 16
53 * Tracepoint provider version. Compatibility based on the major number.
54 * Older tracepoint providers can always register to newer lttng-ust
55 * library, but the opposite is rejected: a newer tracepoint provider is
56 * rejected by an older lttng-ust library.
58 #define LTTNG_UST_PROVIDER_MAJOR 1
59 #define LTTNG_UST_PROVIDER_MINOR 0
63 struct lttng_ust_lib_ring_buffer_ctx
;
64 struct lttng_ust_context_app
;
65 struct lttng_event_field
;
68 * Data structures used by tracepoint event declarations, and by the
69 * tracer. Those structures have padding for future extension.
73 * LTTng client type enumeration. Used by the consumer to map the
74 * callbacks from its own address space.
76 enum lttng_client_types
{
77 LTTNG_CLIENT_METADATA
= 0,
78 LTTNG_CLIENT_DISCARD
= 1,
79 LTTNG_CLIENT_OVERWRITE
= 2,
80 LTTNG_CLIENT_DISCARD_RT
= 3,
81 LTTNG_CLIENT_OVERWRITE_RT
= 4,
82 LTTNG_NR_CLIENT_TYPES
,
85 /* Type description */
87 /* Update the astract_types name table in lttng-types.c along with this enum */
88 enum lttng_abstract_types
{
100 /* Update the string_encodings name table in lttng-types.c along with this enum */
101 enum lttng_string_encodings
{
102 lttng_encode_none
= 0,
103 lttng_encode_UTF8
= 1,
104 lttng_encode_ASCII
= 2,
108 struct lttng_enum_value
{
109 unsigned long long value
;
110 unsigned int signedness
:1;
113 enum lttng_enum_entry_options
{
114 LTTNG_ENUM_ENTRY_OPTION_IS_AUTO
= 1U << 0,
117 #define LTTNG_UST_ENUM_ENTRY_PADDING 16
118 struct lttng_enum_entry
{
119 struct lttng_enum_value start
, end
; /* start and end are inclusive */
123 unsigned int options
;
124 } LTTNG_PACKED extra
;
125 char padding
[LTTNG_UST_ENUM_ENTRY_PADDING
];
129 #define __type_integer(_type, _byte_order, _base, _encoding) \
131 .atype = atype_integer, \
138 .size = sizeof(_type) * CHAR_BIT, \
139 .alignment = lttng_alignof(_type) * CHAR_BIT, \
140 .signedness = lttng_is_signed_type(_type), \
141 .reverse_byte_order = _byte_order != BYTE_ORDER, \
143 .encoding = lttng_encode_##_encoding, \
149 #define LTTNG_UST_INTEGER_TYPE_PADDING 24
150 struct lttng_integer_type
{
151 unsigned int size
; /* in bits */
152 unsigned short alignment
; /* in bits */
153 unsigned int signedness
:1;
154 unsigned int reverse_byte_order
:1;
155 unsigned int base
; /* 2, 8, 10, 16, for pretty print */
156 enum lttng_string_encodings encoding
;
157 char padding
[LTTNG_UST_INTEGER_TYPE_PADDING
];
161 * Only float and double are supported. long double is not supported at
164 #define _float_mant_dig(_type) \
165 (sizeof(_type) == sizeof(float) ? FLT_MANT_DIG \
166 : (sizeof(_type) == sizeof(double) ? DBL_MANT_DIG \
169 #define __type_float(_type) \
171 .atype = atype_float, \
178 .exp_dig = sizeof(_type) * CHAR_BIT \
179 - _float_mant_dig(_type), \
180 .mant_dig = _float_mant_dig(_type), \
181 .alignment = lttng_alignof(_type) * CHAR_BIT, \
182 .reverse_byte_order = BYTE_ORDER != FLOAT_WORD_ORDER, \
188 #define LTTNG_UST_FLOAT_TYPE_PADDING 24
189 struct lttng_float_type
{
190 unsigned int exp_dig
; /* exponent digits, in bits */
191 unsigned int mant_dig
; /* mantissa digits, in bits */
192 unsigned short alignment
; /* in bits */
193 unsigned int reverse_byte_order
:1;
194 char padding
[LTTNG_UST_FLOAT_TYPE_PADDING
];
197 #define LTTNG_UST_BASIC_TYPE_PADDING 128
198 union _lttng_basic_type
{
199 struct lttng_integer_type integer
;
201 const struct lttng_enum_desc
*desc
; /* Enumeration mapping */
202 struct lttng_integer_type container_type
;
205 enum lttng_string_encodings encoding
;
207 struct lttng_float_type _float
;
208 char padding
[LTTNG_UST_BASIC_TYPE_PADDING
];
211 struct lttng_basic_type
{
212 enum lttng_abstract_types atype
;
214 union _lttng_basic_type basic
;
218 #define LTTNG_UST_TYPE_PADDING 128
220 enum lttng_abstract_types atype
;
222 union _lttng_basic_type basic
;
224 struct lttng_basic_type elem_type
;
225 unsigned int length
; /* num. elems. */
228 struct lttng_basic_type length_type
;
229 struct lttng_basic_type elem_type
;
233 struct lttng_event_field
*fields
; /* Array of fields. */
235 char padding
[LTTNG_UST_TYPE_PADDING
];
239 #define LTTNG_UST_ENUM_TYPE_PADDING 24
240 struct lttng_enum_desc
{
242 const struct lttng_enum_entry
*entries
;
243 unsigned int nr_entries
;
244 char padding
[LTTNG_UST_ENUM_TYPE_PADDING
];
248 * Event field description
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
255 #define LTTNG_UST_EVENT_FIELD_PADDING 28
256 struct lttng_event_field
{
258 struct lttng_type type
;
259 unsigned int nowrite
; /* do not write into trace */
260 char padding
[LTTNG_UST_EVENT_FIELD_PADDING
];
263 enum lttng_ust_dynamic_type
{
264 LTTNG_UST_DYNAMIC_TYPE_NONE
,
265 LTTNG_UST_DYNAMIC_TYPE_S8
,
266 LTTNG_UST_DYNAMIC_TYPE_S16
,
267 LTTNG_UST_DYNAMIC_TYPE_S32
,
268 LTTNG_UST_DYNAMIC_TYPE_S64
,
269 LTTNG_UST_DYNAMIC_TYPE_U8
,
270 LTTNG_UST_DYNAMIC_TYPE_U16
,
271 LTTNG_UST_DYNAMIC_TYPE_U32
,
272 LTTNG_UST_DYNAMIC_TYPE_U64
,
273 LTTNG_UST_DYNAMIC_TYPE_FLOAT
,
274 LTTNG_UST_DYNAMIC_TYPE_DOUBLE
,
275 LTTNG_UST_DYNAMIC_TYPE_STRING
,
276 _NR_LTTNG_UST_DYNAMIC_TYPES
,
279 struct lttng_ctx_value
{
280 enum lttng_ust_dynamic_type sel
;
288 struct lttng_perf_counter_field
;
290 #define LTTNG_UST_CTX_FIELD_PADDING 40
291 struct lttng_ctx_field
{
292 struct lttng_event_field event_field
;
293 size_t (*get_size
)(struct lttng_ctx_field
*field
, size_t offset
);
294 void (*record
)(struct lttng_ctx_field
*field
,
295 struct lttng_ust_lib_ring_buffer_ctx
*ctx
,
296 struct lttng_channel
*chan
);
297 void (*get_value
)(struct lttng_ctx_field
*field
,
298 struct lttng_ctx_value
*value
);
300 struct lttng_perf_counter_field
*perf_counter
;
301 char padding
[LTTNG_UST_CTX_FIELD_PADDING
];
303 void (*destroy
)(struct lttng_ctx_field
*field
);
304 char *field_name
; /* Has ownership, dynamically allocated. */
307 #define LTTNG_UST_CTX_PADDING 20
309 struct lttng_ctx_field
*fields
;
310 unsigned int nr_fields
;
311 unsigned int allocated_fields
;
312 unsigned int largest_align
;
313 char padding
[LTTNG_UST_CTX_PADDING
];
316 #define LTTNG_UST_EVENT_DESC_PADDING 40
317 struct lttng_event_desc
{
319 void (*probe_callback
)(void);
320 const struct lttng_event_ctx
*ctx
; /* context */
321 const struct lttng_event_field
*fields
; /* event payload */
322 unsigned int nr_fields
;
323 const int **loglevel
;
324 const char *signature
; /* Argument types/names received */
327 const char **model_emf_uri
;
329 char padding
[LTTNG_UST_EVENT_DESC_PADDING
];
333 #define LTTNG_UST_PROBE_DESC_PADDING 12
334 struct lttng_probe_desc
{
335 const char *provider
;
336 const struct lttng_event_desc
**event_desc
;
337 unsigned int nr_events
;
338 struct cds_list_head head
; /* chain registered probes */
339 struct cds_list_head lazy_init_head
;
340 int lazy
; /* lazy registration */
343 char padding
[LTTNG_UST_PROBE_DESC_PADDING
];
346 /* Data structures used by the tracer. */
348 enum lttng_enabler_type
{
349 LTTNG_ENABLER_STAR_GLOB
,
354 * Enabler field, within whatever object is enabling an event. Target of
355 * backward reference.
357 struct lttng_enabler
{
358 enum lttng_enabler_type type
;
360 /* head list of struct lttng_ust_filter_bytecode_node */
361 struct cds_list_head filter_bytecode_head
;
362 /* head list of struct lttng_ust_excluder_node */
363 struct cds_list_head excluder_head
;
364 struct cds_list_head node
; /* per-session list of enablers */
366 struct lttng_ust_event event_param
;
367 struct lttng_channel
*chan
;
368 struct lttng_ctx
*ctx
;
369 unsigned int enabled
:1;
372 struct tp_list_entry
{
373 struct lttng_ust_tracepoint_iter tp
;
374 struct cds_list_head head
;
377 struct lttng_ust_tracepoint_list
{
378 struct tp_list_entry
*iter
;
379 struct cds_list_head head
;
382 struct tp_field_list_entry
{
383 struct lttng_ust_field_iter field
;
384 struct cds_list_head head
;
387 struct lttng_ust_field_list
{
388 struct tp_field_list_entry
*iter
;
389 struct cds_list_head head
;
392 struct ust_pending_probe
;
395 struct lttng_ust_filter_bytecode_node
{
396 struct cds_list_head node
;
397 struct lttng_enabler
*enabler
;
399 * struct lttng_ust_filter_bytecode has var. sized array, must
402 struct lttng_ust_filter_bytecode bc
;
405 struct lttng_ust_excluder_node
{
406 struct cds_list_head node
;
407 struct lttng_enabler
*enabler
;
409 * struct lttng_ust_event_exclusion had variable sized array,
410 * must be last field.
412 struct lttng_ust_event_exclusion excluder
;
415 * Filter return value masks.
417 enum lttng_filter_ret
{
418 LTTNG_FILTER_DISCARD
= 0,
419 LTTNG_FILTER_RECORD_FLAG
= (1ULL << 0),
420 /* Other bits are kept for future use. */
423 struct lttng_bytecode_runtime
{
424 /* Associated bytecode */
425 struct lttng_ust_filter_bytecode_node
*bc
;
426 uint64_t (*filter
)(void *filter_data
, const char *filter_stack_data
);
428 struct cds_list_head node
; /* list of bytecode runtime in event */
429 struct lttng_session
*session
;
430 struct lttng_event
*event
;
434 * Objects in a linked-list of enablers, owned by an event.
436 struct lttng_enabler_ref
{
437 struct cds_list_head node
; /* enabler ref list */
438 struct lttng_enabler
*ref
; /* backward ref */
442 * lttng_event structure is referred to by the tracing fast path. It
443 * must be kept small.
445 * IMPORTANT: this structure is part of the ABI between the probe and
446 * UST. Fields need to be only added at the end, never reordered, never
450 /* LTTng-UST 2.0 starts here */
452 struct lttng_channel
*chan
;
454 const struct lttng_event_desc
*desc
;
456 struct lttng_ctx
*ctx
;
457 enum lttng_ust_instrumentation instrumentation
;
458 struct cds_list_head node
; /* Event list in session */
459 struct cds_list_head _deprecated2
;
461 unsigned int _deprecated4
:1;
463 /* LTTng-UST 2.1 starts here */
464 /* list of struct lttng_bytecode_runtime, sorted by seqnum */
465 struct cds_list_head bytecode_runtime_head
;
466 int has_enablers_without_bytecode
;
467 /* Backward references: list of lttng_enabler_ref (ref to enablers) */
468 struct cds_list_head enablers_ref_head
;
469 struct cds_hlist_node hlist
; /* session ht of events */
470 int registered
; /* has reg'd tracepoint probe */
474 const struct lttng_enum_desc
*desc
;
475 struct lttng_session
*session
;
476 struct cds_list_head node
; /* Enum list in session */
477 struct cds_hlist_node hlist
; /* Session ht of enums */
478 uint64_t id
; /* Enumeration ID in sessiond */
482 struct lttng_ust_shm_handle
;
485 * IMPORTANT: this structure is part of the ABI between the probe and
486 * UST. Fields need to be only added at the end, never reordered, never
489 struct lttng_channel_ops
{
490 struct lttng_channel
*(*channel_create
)(const char *name
,
492 size_t subbuf_size
, size_t num_subbuf
,
493 unsigned int switch_timer_interval
,
494 unsigned int read_timer_interval
,
497 const int *stream_fds
, int nr_stream_fds
,
498 int64_t blocking_timeout
);
499 void (*channel_destroy
)(struct lttng_channel
*chan
);
502 unsigned long has_strcpy
:1; /* ABI has strcpy */
505 int (*event_reserve
)(struct lttng_ust_lib_ring_buffer_ctx
*ctx
,
507 void (*event_commit
)(struct lttng_ust_lib_ring_buffer_ctx
*ctx
);
508 void (*event_write
)(struct lttng_ust_lib_ring_buffer_ctx
*ctx
,
509 const void *src
, size_t len
);
511 * packet_avail_size returns the available size in the current
512 * packet. Note that the size returned is only a hint, since it
513 * may change due to concurrent writes.
515 size_t (*packet_avail_size
)(struct channel
*chan
,
516 struct lttng_ust_shm_handle
*handle
);
517 //wait_queue_head_t *(*get_reader_wait_queue)(struct channel *chan);
518 //wait_queue_head_t *(*get_hp_wait_queue)(struct channel *chan);
519 int (*is_finalized
)(struct channel
*chan
);
520 int (*is_disabled
)(struct channel
*chan
);
521 int (*flush_buffer
)(struct channel
*chan
, struct lttng_ust_shm_handle
*handle
);
522 void (*event_strcpy
)(struct lttng_ust_lib_ring_buffer_ctx
*ctx
,
523 const char *src
, size_t len
);
527 * IMPORTANT: this structure is part of the ABI between the probe and
528 * UST. Fields need to be only added at the end, never reordered, never
531 struct lttng_channel
{
533 * The pointers located in this private data are NOT safe to be
534 * dereferenced by the consumer. The only operations the
535 * consumer process is designed to be allowed to do is to read
536 * and perform subbuffer flush.
538 struct channel
*chan
; /* Channel buffers */
540 struct lttng_ctx
*ctx
;
541 /* Event ID management */
542 struct lttng_session
*session
;
543 int objd
; /* Object associated to channel */
544 unsigned int _deprecated1
;
545 unsigned int _deprecated2
;
546 struct cds_list_head node
; /* Channel list in session */
547 const struct lttng_channel_ops
*ops
;
548 int header_type
; /* 0: unset, 1: compact, 2: large */
549 struct lttng_ust_shm_handle
*handle
; /* shared-memory handle */
550 unsigned int _deprecated3
:1;
554 enum lttng_ust_chan_type type
;
555 unsigned char uuid
[LTTNG_UST_UUID_LEN
]; /* Trace session unique ID */
556 int tstate
:1; /* Transient enable state */
559 #define LTTNG_UST_STACK_CTX_PADDING 32
560 struct lttng_stack_ctx
{
561 struct lttng_event
*event
;
562 struct lttng_ctx
*chan_ctx
; /* RCU dereferenced. */
563 struct lttng_ctx
*event_ctx
; /* RCU dereferenced. */
564 char padding
[LTTNG_UST_STACK_CTX_PADDING
];
567 #define LTTNG_UST_EVENT_HT_BITS 12
568 #define LTTNG_UST_EVENT_HT_SIZE (1U << LTTNG_UST_EVENT_HT_BITS)
570 struct lttng_ust_event_ht
{
571 struct cds_hlist_head table
[LTTNG_UST_EVENT_HT_SIZE
];
574 #define LTTNG_UST_ENUM_HT_BITS 12
575 #define LTTNG_UST_ENUM_HT_SIZE (1U << LTTNG_UST_ENUM_HT_BITS)
577 struct lttng_ust_enum_ht
{
578 struct cds_hlist_head table
[LTTNG_UST_ENUM_HT_SIZE
];
582 * IMPORTANT: this structure is part of the ABI between the probe and
583 * UST. Fields need to be only added at the end, never reordered, never
586 struct lttng_session
{
587 int active
; /* Is trace session active ? */
588 int been_active
; /* Been active ? */
589 int objd
; /* Object associated */
591 struct cds_list_head chan_head
; /* Channel list head */
592 struct cds_list_head events_head
; /* list of events */
593 struct cds_list_head _deprecated2
;
594 struct cds_list_head node
; /* Session list */
596 unsigned int _deprecated4
:1;
599 /* List of enablers */
600 struct cds_list_head enablers_head
;
601 struct lttng_ust_event_ht events_ht
; /* ht of events */
602 void *owner
; /* object owner */
603 int tstate
:1; /* Transient enable state */
606 int statedump_pending
:1;
609 struct lttng_ust_enum_ht enums_ht
; /* ht of enumerations */
610 struct cds_list_head enums_head
;
611 struct lttng_ctx
*ctx
; /* contexts for filters. */
614 struct lttng_transport
{
616 struct cds_list_head node
;
617 struct lttng_channel_ops ops
;
618 const struct lttng_ust_lib_ring_buffer_config
*client_config
;
621 struct lttng_session
*lttng_session_create(void);
622 int lttng_session_enable(struct lttng_session
*session
);
623 int lttng_session_disable(struct lttng_session
*session
);
624 int lttng_session_statedump(struct lttng_session
*session
);
625 void lttng_session_destroy(struct lttng_session
*session
);
627 struct lttng_channel
*lttng_channel_create(struct lttng_session
*session
,
628 const char *transport_name
,
630 size_t subbuf_size
, size_t num_subbuf
,
631 unsigned int switch_timer_interval
,
632 unsigned int read_timer_interval
,
633 int **shm_fd
, int **wait_fd
,
634 uint64_t **memory_map_size
,
635 struct lttng_channel
*chan_priv_init
);
637 int lttng_channel_enable(struct lttng_channel
*channel
);
638 int lttng_channel_disable(struct lttng_channel
*channel
);
640 struct lttng_enabler
*lttng_enabler_create(enum lttng_enabler_type type
,
641 struct lttng_ust_event
*event_param
,
642 struct lttng_channel
*chan
);
643 int lttng_enabler_enable(struct lttng_enabler
*enabler
);
644 int lttng_enabler_disable(struct lttng_enabler
*enabler
);
645 int lttng_enabler_attach_bytecode(struct lttng_enabler
*enabler
,
646 struct lttng_ust_filter_bytecode_node
*bytecode
);
647 int lttng_enabler_attach_context(struct lttng_enabler
*enabler
,
648 struct lttng_ust_context
*ctx
);
649 int lttng_enabler_attach_exclusion(struct lttng_enabler
*enabler
,
650 struct lttng_ust_excluder_node
*excluder
);
652 int lttng_attach_context(struct lttng_ust_context
*context_param
,
653 union ust_args
*uargs
,
654 struct lttng_ctx
**ctx
, struct lttng_session
*session
);
655 int lttng_session_context_init(struct lttng_ctx
**ctx
);
657 void lttng_transport_register(struct lttng_transport
*transport
);
658 void lttng_transport_unregister(struct lttng_transport
*transport
);
660 void synchronize_trace(void);
662 int lttng_probe_register(struct lttng_probe_desc
*desc
);
663 void lttng_probe_unregister(struct lttng_probe_desc
*desc
);
664 void lttng_probe_provider_unregister_events(struct lttng_probe_desc
*desc
);
665 int lttng_fix_pending_events(void);
666 int lttng_probes_init(void);
667 void lttng_probes_exit(void);
668 int lttng_find_context(struct lttng_ctx
*ctx
, const char *name
);
669 int lttng_get_context_index(struct lttng_ctx
*ctx
, const char *name
);
670 struct lttng_ctx_field
*lttng_append_context(struct lttng_ctx
**ctx_p
);
671 void lttng_context_update(struct lttng_ctx
*ctx
);
672 void lttng_remove_context_field(struct lttng_ctx
**ctx_p
,
673 struct lttng_ctx_field
*field
);
674 void lttng_destroy_context(struct lttng_ctx
*ctx
);
675 int lttng_add_vtid_to_ctx(struct lttng_ctx
**ctx
);
676 int lttng_add_vpid_to_ctx(struct lttng_ctx
**ctx
);
677 int lttng_add_pthread_id_to_ctx(struct lttng_ctx
**ctx
);
678 int lttng_add_procname_to_ctx(struct lttng_ctx
**ctx
);
679 int lttng_add_ip_to_ctx(struct lttng_ctx
**ctx
);
680 int lttng_add_cpu_id_to_ctx(struct lttng_ctx
**ctx
);
681 int lttng_add_dyntest_to_ctx(struct lttng_ctx
**ctx
);
682 int lttng_add_cgroup_ns_to_ctx(struct lttng_ctx
**ctx
);
683 int lttng_add_ipc_ns_to_ctx(struct lttng_ctx
**ctx
);
684 int lttng_add_mnt_ns_to_ctx(struct lttng_ctx
**ctx
);
685 int lttng_add_net_ns_to_ctx(struct lttng_ctx
**ctx
);
686 int lttng_add_pid_ns_to_ctx(struct lttng_ctx
**ctx
);
687 int lttng_add_user_ns_to_ctx(struct lttng_ctx
**ctx
);
688 int lttng_add_uts_ns_to_ctx(struct lttng_ctx
**ctx
);
689 void lttng_context_vtid_reset(void);
690 void lttng_context_vpid_reset(void);
691 void lttng_context_procname_reset(void);
692 void lttng_context_cgroup_ns_reset(void);
693 void lttng_context_ipc_ns_reset(void);
694 void lttng_context_mnt_ns_reset(void);
695 void lttng_context_net_ns_reset(void);
696 void lttng_context_pid_ns_reset(void);
697 void lttng_context_user_ns_reset(void);
698 void lttng_context_uts_ns_reset(void);
700 #ifdef LTTNG_UST_HAVE_PERF_EVENT
701 int lttng_add_perf_counter_to_ctx(uint32_t type
,
704 struct lttng_ctx
**ctx
);
705 int lttng_perf_counter_init(void);
706 void lttng_perf_counter_exit(void);
707 #else /* #ifdef LTTNG_UST_HAVE_PERF_EVENT */
709 int lttng_add_perf_counter_to_ctx(uint32_t type
,
712 struct lttng_ctx
**ctx
)
717 int lttng_perf_counter_init(void)
722 void lttng_perf_counter_exit(void)
725 #endif /* #else #ifdef LTTNG_UST_HAVE_PERF_EVENT */
727 extern const struct lttng_ust_client_lib_ring_buffer_client_cb
*lttng_client_callbacks_metadata
;
728 extern const struct lttng_ust_client_lib_ring_buffer_client_cb
*lttng_client_callbacks_discard
;
729 extern const struct lttng_ust_client_lib_ring_buffer_client_cb
*lttng_client_callbacks_overwrite
;
731 struct lttng_transport
*lttng_transport_find(const char *name
);
733 int lttng_probes_get_event_list(struct lttng_ust_tracepoint_list
*list
);
734 void lttng_probes_prune_event_list(struct lttng_ust_tracepoint_list
*list
);
735 struct lttng_ust_tracepoint_iter
*
736 lttng_ust_tracepoint_list_get_iter_next(struct lttng_ust_tracepoint_list
*list
);
737 int lttng_probes_get_field_list(struct lttng_ust_field_list
*list
);
738 void lttng_probes_prune_field_list(struct lttng_ust_field_list
*list
);
739 struct lttng_ust_field_iter
*
740 lttng_ust_field_list_get_iter_next(struct lttng_ust_field_list
*list
);
742 void lttng_filter_event_link_bytecode(struct lttng_event
*event
);
743 void lttng_enabler_event_link_bytecode(struct lttng_event
*event
,
744 struct lttng_enabler
*enabler
);
745 void lttng_free_event_filter_runtime(struct lttng_event
*event
);
746 void lttng_filter_sync_state(struct lttng_bytecode_runtime
*runtime
);
748 struct cds_list_head
*lttng_get_probe_list_head(void);
749 int lttng_session_active(void);
751 typedef int (*t_statedump_func_ptr
)(struct lttng_session
*session
);
752 void lttng_handle_pending_statedump(void *owner
);
753 struct cds_list_head
*_lttng_get_sessions(void);
755 struct lttng_enum
*lttng_ust_enum_get_from_desc(struct lttng_session
*session
,
756 const struct lttng_enum_desc
*enum_desc
);
758 void lttng_ust_dl_update(void *ip
);
759 void lttng_ust_fixup_fd_tracker_tls(void);
761 /* For backward compatibility. Leave those exported symbols in place. */
762 extern struct lttng_ctx
*lttng_static_ctx
;
763 void lttng_context_init(void);
764 void lttng_context_exit(void);
770 #endif /* _LTTNG_UST_EVENTS_H */