1 /* SPDX-License-Identifier: (GPL-2.0 or LGPL-2.1)
5 * Holds LTTng per-session event registry.
7 * Copyright (C) 2010-2012 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 #ifndef _LTTNG_EVENTS_H
11 #define _LTTNG_EVENTS_H
13 #include <linux/version.h>
14 #include <linux/list.h>
15 #include <linux/kprobes.h>
16 #include <linux/kref.h>
17 #include <lttng-cpuhotplug.h>
18 #include <wrapper/uuid.h>
19 #include <lttng-tracer.h>
20 #include <lttng-abi.h>
21 #include <lttng-abi-old.h>
23 #define lttng_is_signed_type(type) (((type)(-1)) < 0)
27 struct lttng_metadata_cache
;
28 struct lib_ring_buffer_ctx
;
30 struct perf_event_attr
;
31 struct lib_ring_buffer_config
;
33 /* Type description */
42 atype_array_compound
, /* Array of compound types. */
43 atype_sequence_compound
, /* Sequence of compound types. */
46 atype_sequence_bitfield
,
50 enum lttng_string_encodings
{
51 lttng_encode_none
= 0,
52 lttng_encode_UTF8
= 1,
53 lttng_encode_ASCII
= 2,
62 struct lttng_enum_value
{
63 unsigned long long value
;
64 unsigned int signedness
:1;
67 struct lttng_enum_entry
{
68 struct lttng_enum_value start
, end
; /* start and end are inclusive */
71 unsigned int is_auto
:1;
75 #define __type_integer(_type, _size, _alignment, _signedness, \
76 _byte_order, _base, _encoding) \
78 .atype = atype_integer, \
81 .size = (_size) ? : sizeof(_type) * CHAR_BIT, \
82 .alignment = (_alignment) ? : lttng_alignof(_type) * CHAR_BIT, \
83 .signedness = (_signedness) >= 0 ? (_signedness) : lttng_is_signed_type(_type), \
84 .reverse_byte_order = _byte_order != __BYTE_ORDER, \
86 .encoding = lttng_encode_##_encoding, \
90 struct lttng_integer_type {
91 unsigned int size
; /* in bits */
92 unsigned short alignment
; /* in bits */
93 unsigned int signedness
:1,
95 unsigned int base
; /* 2, 8, 10, 16, for pretty print */
96 enum lttng_string_encodings encoding
;
99 union _lttng_basic_type
{
100 struct lttng_integer_type integer
;
102 const struct lttng_enum_desc
*desc
; /* Enumeration mapping */
103 struct lttng_integer_type container_type
;
106 enum lttng_string_encodings encoding
;
110 struct lttng_basic_type
{
111 enum abstract_types atype
;
113 union _lttng_basic_type basic
;
118 enum abstract_types atype
;
120 union _lttng_basic_type basic
;
122 struct lttng_basic_type elem_type
;
123 unsigned int length
; /* num. elems. */
124 unsigned int elem_alignment
; /* alignment override */
127 struct lttng_basic_type length_type
;
128 struct lttng_basic_type elem_type
;
129 unsigned int elem_alignment
; /* alignment override */
133 struct lttng_event_field
*fields
; /* Array of fields. */
136 struct lttng_type
*elem_type
;
137 unsigned int length
; /* num. elems. */
140 struct lttng_type
*elem_type
;
141 const char *length_name
;
144 const char *tag_name
;
145 struct lttng_event_field
*choices
; /* Array of fields. */
151 struct lttng_enum_desc
{
153 const struct lttng_enum_entry
*entries
;
154 unsigned int nr_entries
;
157 /* Event field description */
159 struct lttng_event_field
{
161 struct lttng_type type
;
162 unsigned int nowrite
:1, /* do not write into trace */
163 user
:1; /* fetch from user-space */
166 union lttng_ctx_value
{
173 * We need to keep this perf counter field separately from struct
174 * lttng_ctx_field because cpu hotplug needs fixed-location addresses.
176 struct lttng_perf_counter_field
{
177 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0))
178 struct lttng_cpuhp_node cpuhp_prepare
;
179 struct lttng_cpuhp_node cpuhp_online
;
181 struct notifier_block nb
;
184 struct perf_event_attr
*attr
;
185 struct perf_event
**e
; /* per-cpu array */
188 struct lttng_probe_ctx
{
189 struct lttng_event
*event
;
190 uint8_t interruptible
;
193 struct lttng_ctx_field
{
194 struct lttng_event_field event_field
;
195 size_t (*get_size
)(size_t offset
);
196 size_t (*get_size_arg
)(size_t offset
, struct lttng_ctx_field
*field
,
197 struct lib_ring_buffer_ctx
*ctx
,
198 struct lttng_channel
*chan
);
199 void (*record
)(struct lttng_ctx_field
*field
,
200 struct lib_ring_buffer_ctx
*ctx
,
201 struct lttng_channel
*chan
);
202 void (*get_value
)(struct lttng_ctx_field
*field
,
203 struct lttng_probe_ctx
*lttng_probe_ctx
,
204 union lttng_ctx_value
*value
);
206 struct lttng_perf_counter_field
*perf_counter
;
208 void (*destroy
)(struct lttng_ctx_field
*field
);
210 * Private data to keep state between get_size and record.
211 * User must perform its own synchronization to protect against
212 * concurrent and reentrant contexts.
218 struct lttng_ctx_field
*fields
;
219 unsigned int nr_fields
;
220 unsigned int allocated_fields
;
221 size_t largest_align
; /* in bytes */
224 struct lttng_event_desc
{
225 const char *name
; /* lttng-modules name */
226 const char *kname
; /* Linux kernel name (tracepoints) */
227 void *probe_callback
;
228 const struct lttng_event_ctx
*ctx
; /* context */
229 const struct lttng_event_field
*fields
; /* event payload */
230 unsigned int nr_fields
;
231 struct module
*owner
;
234 struct lttng_probe_desc
{
235 const char *provider
;
236 const struct lttng_event_desc
**event_desc
;
237 unsigned int nr_events
;
238 struct list_head head
; /* chain registered probes */
239 struct list_head lazy_init_head
;
240 int lazy
; /* lazy registration */
243 struct lttng_krp
; /* Kretprobe handling */
245 enum lttng_event_type
{
246 LTTNG_TYPE_EVENT
= 0,
247 LTTNG_TYPE_ENABLER
= 1,
250 struct lttng_filter_bytecode_node
{
251 struct list_head node
;
252 struct lttng_enabler
*enabler
;
254 * struct lttng_kernel_filter_bytecode has var. sized array, must be
257 struct lttng_kernel_filter_bytecode bc
;
261 * Filter return value masks.
263 enum lttng_filter_ret
{
264 LTTNG_FILTER_DISCARD
= 0,
265 LTTNG_FILTER_RECORD_FLAG
= (1ULL << 0),
266 /* Other bits are kept for future use. */
269 struct lttng_bytecode_runtime
{
270 /* Associated bytecode */
271 struct lttng_filter_bytecode_node
*bc
;
272 uint64_t (*filter
)(void *filter_data
, struct lttng_probe_ctx
*lttng_probe_ctx
,
273 const char *filter_stack_data
);
275 struct list_head node
; /* list of bytecode runtime in event */
276 struct lttng_event
*event
;
280 * Objects in a linked-list of enablers, owned by an event.
282 struct lttng_enabler_ref
{
283 struct list_head node
; /* enabler ref list */
284 struct lttng_enabler
*ref
; /* backward ref */
288 * lttng_event structure is referred to by the tracing fast path. It must be
292 enum lttng_event_type evtype
; /* First field. */
294 struct lttng_channel
*chan
;
296 const struct lttng_event_desc
*desc
;
298 struct lttng_ctx
*ctx
;
299 enum lttng_kernel_instrumentation instrumentation
;
306 struct lttng_krp
*lttng_krp
;
313 struct list_head list
; /* Event list in session */
314 unsigned int metadata_dumped
:1;
316 /* Backward references: list of lttng_enabler_ref (ref to enablers) */
317 struct list_head enablers_ref_head
;
318 struct hlist_node hlist
; /* session ht of events */
319 int registered
; /* has reg'd tracepoint probe */
320 /* list of struct lttng_bytecode_runtime, sorted by seqnum */
321 struct list_head bytecode_runtime_head
;
322 int has_enablers_without_bytecode
;
325 enum lttng_enabler_type
{
326 LTTNG_ENABLER_STAR_GLOB
,
331 * Enabler field, within whatever object is enabling an event. Target of
332 * backward reference.
334 struct lttng_enabler
{
335 enum lttng_event_type evtype
; /* First field. */
337 enum lttng_enabler_type type
;
339 struct list_head node
; /* per-session list of enablers */
340 /* head list of struct lttng_ust_filter_bytecode_node */
341 struct list_head filter_bytecode_head
;
343 struct lttng_kernel_event event_param
;
344 struct lttng_channel
*chan
;
345 struct lttng_ctx
*ctx
;
346 unsigned int enabled
:1;
349 struct lttng_channel_ops
{
350 struct channel
*(*channel_create
)(const char *name
,
351 struct lttng_channel
*lttng_chan
,
353 size_t subbuf_size
, size_t num_subbuf
,
354 unsigned int switch_timer_interval
,
355 unsigned int read_timer_interval
);
356 void (*channel_destroy
)(struct channel
*chan
);
357 struct lib_ring_buffer
*(*buffer_read_open
)(struct channel
*chan
);
358 int (*buffer_has_read_closed_stream
)(struct channel
*chan
);
359 void (*buffer_read_close
)(struct lib_ring_buffer
*buf
);
360 int (*event_reserve
)(struct lib_ring_buffer_ctx
*ctx
,
362 void (*event_commit
)(struct lib_ring_buffer_ctx
*ctx
);
363 void (*event_write
)(struct lib_ring_buffer_ctx
*ctx
, const void *src
,
365 void (*event_write_from_user
)(struct lib_ring_buffer_ctx
*ctx
,
366 const void *src
, size_t len
);
367 void (*event_memset
)(struct lib_ring_buffer_ctx
*ctx
,
369 void (*event_strcpy
)(struct lib_ring_buffer_ctx
*ctx
, const char *src
,
371 void (*event_strcpy_from_user
)(struct lib_ring_buffer_ctx
*ctx
,
372 const char __user
*src
, size_t len
);
374 * packet_avail_size returns the available size in the current
375 * packet. Note that the size returned is only a hint, since it
376 * may change due to concurrent writes.
378 size_t (*packet_avail_size
)(struct channel
*chan
);
379 wait_queue_head_t
*(*get_writer_buf_wait_queue
)(struct channel
*chan
, int cpu
);
380 wait_queue_head_t
*(*get_hp_wait_queue
)(struct channel
*chan
);
381 int (*is_finalized
)(struct channel
*chan
);
382 int (*is_disabled
)(struct channel
*chan
);
383 int (*timestamp_begin
) (const struct lib_ring_buffer_config
*config
,
384 struct lib_ring_buffer
*bufb
,
385 uint64_t *timestamp_begin
);
386 int (*timestamp_end
) (const struct lib_ring_buffer_config
*config
,
387 struct lib_ring_buffer
*bufb
,
388 uint64_t *timestamp_end
);
389 int (*events_discarded
) (const struct lib_ring_buffer_config
*config
,
390 struct lib_ring_buffer
*bufb
,
391 uint64_t *events_discarded
);
392 int (*content_size
) (const struct lib_ring_buffer_config
*config
,
393 struct lib_ring_buffer
*bufb
,
394 uint64_t *content_size
);
395 int (*packet_size
) (const struct lib_ring_buffer_config
*config
,
396 struct lib_ring_buffer
*bufb
,
397 uint64_t *packet_size
);
398 int (*stream_id
) (const struct lib_ring_buffer_config
*config
,
399 struct lib_ring_buffer
*bufb
,
400 uint64_t *stream_id
);
401 int (*current_timestamp
) (const struct lib_ring_buffer_config
*config
,
402 struct lib_ring_buffer
*bufb
,
404 int (*sequence_number
) (const struct lib_ring_buffer_config
*config
,
405 struct lib_ring_buffer
*bufb
,
407 int (*instance_id
) (const struct lib_ring_buffer_config
*config
,
408 struct lib_ring_buffer
*bufb
,
412 struct lttng_transport
{
414 struct module
*owner
;
415 struct list_head node
;
416 struct lttng_channel_ops ops
;
419 struct lttng_syscall_filter
;
421 #define LTTNG_EVENT_HT_BITS 12
422 #define LTTNG_EVENT_HT_SIZE (1U << LTTNG_EVENT_HT_BITS)
424 struct lttng_event_ht
{
425 struct hlist_head table
[LTTNG_EVENT_HT_SIZE
];
428 struct lttng_channel
{
430 struct channel
*chan
; /* Channel buffers */
432 struct lttng_ctx
*ctx
;
433 /* Event ID management */
434 struct lttng_session
*session
;
435 struct file
*file
; /* File associated to channel */
436 unsigned int free_event_id
; /* Next event ID to allocate */
437 struct list_head list
; /* Channel list */
438 struct lttng_channel_ops
*ops
;
439 struct lttng_transport
*transport
;
440 struct lttng_event
**sc_table
; /* for syscall tracing */
441 struct lttng_event
**compat_sc_table
;
442 struct lttng_event
**sc_exit_table
; /* for syscall exit tracing */
443 struct lttng_event
**compat_sc_exit_table
;
444 struct lttng_event
*sc_unknown
; /* for unknown syscalls */
445 struct lttng_event
*sc_compat_unknown
;
446 struct lttng_event
*sc_exit_unknown
;
447 struct lttng_event
*compat_sc_exit_unknown
;
448 struct lttng_syscall_filter
*sc_filter
;
449 int header_type
; /* 0: unset, 1: compact, 2: large */
450 enum channel_type channel_type
;
451 unsigned int metadata_dumped
:1,
452 sys_enter_registered
:1,
453 sys_exit_registered
:1,
455 tstate
:1; /* Transient enable state */
458 struct lttng_metadata_stream
{
459 void *priv
; /* Ring buffer private data */
460 struct lttng_metadata_cache
*metadata_cache
;
461 unsigned int metadata_in
; /* Bytes read from the cache */
462 unsigned int metadata_out
; /* Bytes consumed from stream */
463 int finalized
; /* Has channel been finalized */
464 wait_queue_head_t read_wait
; /* Reader buffer-level wait queue */
465 struct list_head list
; /* Stream list */
466 struct lttng_transport
*transport
;
467 uint64_t version
; /* Current version of the metadata cache */
470 #define LTTNG_DYNAMIC_LEN_STACK_SIZE 128
472 struct lttng_dynamic_len_stack
{
473 size_t stack
[LTTNG_DYNAMIC_LEN_STACK_SIZE
];
477 DECLARE_PER_CPU(struct lttng_dynamic_len_stack
, lttng_dynamic_len_stack
);
480 * struct lttng_pid_tracker declared in header due to deferencing of *v
481 * in RCU_INITIALIZER(v).
483 #define LTTNG_PID_HASH_BITS 6
484 #define LTTNG_PID_TABLE_SIZE (1 << LTTNG_PID_HASH_BITS)
486 struct lttng_pid_tracker
{
487 struct hlist_head pid_hash
[LTTNG_PID_TABLE_SIZE
];
490 struct lttng_pid_hash_node
{
491 struct hlist_node hlist
;
495 struct lttng_session
{
496 int active
; /* Is trace session active ? */
497 int been_active
; /* Has trace session been active ? */
498 struct file
*file
; /* File associated to session */
499 struct list_head chan
; /* Channel list head */
500 struct list_head events
; /* Event list head */
501 struct list_head list
; /* Session list */
502 unsigned int free_chan_id
; /* Next chan ID to allocate */
503 uuid_le uuid
; /* Trace session unique ID */
504 struct lttng_metadata_cache
*metadata_cache
;
505 struct lttng_pid_tracker
*pid_tracker
;
506 unsigned int metadata_dumped
:1,
507 tstate
:1; /* Transient enable state */
508 /* List of enablers */
509 struct list_head enablers_head
;
510 /* Hash table of events */
511 struct lttng_event_ht events_ht
;
514 struct lttng_metadata_cache
{
515 char *data
; /* Metadata cache */
516 unsigned int cache_alloc
; /* Metadata allocated size (bytes) */
517 unsigned int metadata_written
; /* Number of bytes written in metadata cache */
518 struct kref refcount
; /* Metadata cache usage */
519 struct list_head metadata_stream
; /* Metadata stream list */
520 uuid_le uuid
; /* Trace session unique ID (copy) */
521 struct mutex lock
; /* Produce/consume lock */
522 uint64_t version
; /* Current version of the metadata */
525 void lttng_lock_sessions(void);
526 void lttng_unlock_sessions(void);
528 struct list_head
*lttng_get_probe_list_head(void);
530 struct lttng_enabler
*lttng_enabler_create(enum lttng_enabler_type type
,
531 struct lttng_kernel_event
*event_param
,
532 struct lttng_channel
*chan
);
534 int lttng_enabler_enable(struct lttng_enabler
*enabler
);
535 int lttng_enabler_disable(struct lttng_enabler
*enabler
);
536 int lttng_fix_pending_events(void);
537 int lttng_session_active(void);
539 struct lttng_session
*lttng_session_create(void);
540 int lttng_session_enable(struct lttng_session
*session
);
541 int lttng_session_disable(struct lttng_session
*session
);
542 void lttng_session_destroy(struct lttng_session
*session
);
543 int lttng_session_metadata_regenerate(struct lttng_session
*session
);
544 int lttng_session_statedump(struct lttng_session
*session
);
545 void metadata_cache_destroy(struct kref
*kref
);
547 struct lttng_channel
*lttng_channel_create(struct lttng_session
*session
,
548 const char *transport_name
,
550 size_t subbuf_size
, size_t num_subbuf
,
551 unsigned int switch_timer_interval
,
552 unsigned int read_timer_interval
,
553 enum channel_type channel_type
);
554 struct lttng_channel
*lttng_global_channel_create(struct lttng_session
*session
,
555 int overwrite
, void *buf_addr
,
556 size_t subbuf_size
, size_t num_subbuf
,
557 unsigned int switch_timer_interval
,
558 unsigned int read_timer_interval
);
560 void lttng_metadata_channel_destroy(struct lttng_channel
*chan
);
561 struct lttng_event
*lttng_event_create(struct lttng_channel
*chan
,
562 struct lttng_kernel_event
*event_param
,
564 const struct lttng_event_desc
*event_desc
,
565 enum lttng_kernel_instrumentation itype
);
566 struct lttng_event
*_lttng_event_create(struct lttng_channel
*chan
,
567 struct lttng_kernel_event
*event_param
,
569 const struct lttng_event_desc
*event_desc
,
570 enum lttng_kernel_instrumentation itype
);
571 struct lttng_event
*lttng_event_compat_old_create(struct lttng_channel
*chan
,
572 struct lttng_kernel_old_event
*old_event_param
,
574 const struct lttng_event_desc
*internal_desc
);
576 int lttng_channel_enable(struct lttng_channel
*channel
);
577 int lttng_channel_disable(struct lttng_channel
*channel
);
578 int lttng_event_enable(struct lttng_event
*event
);
579 int lttng_event_disable(struct lttng_event
*event
);
581 void lttng_transport_register(struct lttng_transport
*transport
);
582 void lttng_transport_unregister(struct lttng_transport
*transport
);
584 void synchronize_trace(void);
585 int lttng_abi_init(void);
586 int lttng_abi_compat_old_init(void);
587 void lttng_abi_exit(void);
588 void lttng_abi_compat_old_exit(void);
590 int lttng_probe_register(struct lttng_probe_desc
*desc
);
591 void lttng_probe_unregister(struct lttng_probe_desc
*desc
);
592 const struct lttng_event_desc
*lttng_event_get(const char *name
);
593 void lttng_event_put(const struct lttng_event_desc
*desc
);
594 int lttng_probes_init(void);
595 void lttng_probes_exit(void);
597 int lttng_metadata_output_channel(struct lttng_metadata_stream
*stream
,
598 struct channel
*chan
);
600 int lttng_pid_tracker_get_node_pid(const struct lttng_pid_hash_node
*node
);
601 struct lttng_pid_tracker
*lttng_pid_tracker_create(void);
602 void lttng_pid_tracker_destroy(struct lttng_pid_tracker
*lpf
);
603 bool lttng_pid_tracker_lookup(struct lttng_pid_tracker
*lpf
, int pid
);
604 int lttng_pid_tracker_add(struct lttng_pid_tracker
*lpf
, int pid
);
605 int lttng_pid_tracker_del(struct lttng_pid_tracker
*lpf
, int pid
);
607 int lttng_session_track_pid(struct lttng_session
*session
, int pid
);
608 int lttng_session_untrack_pid(struct lttng_session
*session
, int pid
);
610 int lttng_session_list_tracker_pids(struct lttng_session
*session
);
612 void lttng_clock_ref(void);
613 void lttng_clock_unref(void);
615 #if defined(CONFIG_HAVE_SYSCALL_TRACEPOINTS)
616 int lttng_syscalls_register(struct lttng_channel
*chan
, void *filter
);
617 int lttng_syscalls_unregister(struct lttng_channel
*chan
);
618 int lttng_syscall_filter_enable(struct lttng_channel
*chan
,
620 int lttng_syscall_filter_disable(struct lttng_channel
*chan
,
622 long lttng_channel_syscall_mask(struct lttng_channel
*channel
,
623 struct lttng_kernel_syscall_mask __user
*usyscall_mask
);
625 static inline int lttng_syscalls_register(struct lttng_channel
*chan
, void *filter
)
630 static inline int lttng_syscalls_unregister(struct lttng_channel
*chan
)
635 static inline int lttng_syscall_filter_enable(struct lttng_channel
*chan
,
641 static inline int lttng_syscall_filter_disable(struct lttng_channel
*chan
,
647 static inline long lttng_channel_syscall_mask(struct lttng_channel
*channel
,
648 struct lttng_kernel_syscall_mask __user
*usyscall_mask
)
654 void lttng_filter_sync_state(struct lttng_bytecode_runtime
*runtime
);
655 int lttng_enabler_attach_bytecode(struct lttng_enabler
*enabler
,
656 struct lttng_kernel_filter_bytecode __user
*bytecode
);
657 void lttng_enabler_event_link_bytecode(struct lttng_event
*event
,
658 struct lttng_enabler
*enabler
);
660 int lttng_probes_init(void);
662 extern struct lttng_ctx
*lttng_static_ctx
;
664 int lttng_context_init(void);
665 void lttng_context_exit(void);
666 struct lttng_ctx_field
*lttng_append_context(struct lttng_ctx
**ctx
);
667 void lttng_context_update(struct lttng_ctx
*ctx
);
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 void lttng_remove_context_field(struct lttng_ctx
**ctx
,
671 struct lttng_ctx_field
*field
);
672 void lttng_destroy_context(struct lttng_ctx
*ctx
);
673 int lttng_add_pid_to_ctx(struct lttng_ctx
**ctx
);
674 int lttng_add_cpu_id_to_ctx(struct lttng_ctx
**ctx
);
675 int lttng_add_procname_to_ctx(struct lttng_ctx
**ctx
);
676 int lttng_add_prio_to_ctx(struct lttng_ctx
**ctx
);
677 int lttng_add_nice_to_ctx(struct lttng_ctx
**ctx
);
678 int lttng_add_vpid_to_ctx(struct lttng_ctx
**ctx
);
679 int lttng_add_tid_to_ctx(struct lttng_ctx
**ctx
);
680 int lttng_add_vtid_to_ctx(struct lttng_ctx
**ctx
);
681 int lttng_add_ppid_to_ctx(struct lttng_ctx
**ctx
);
682 int lttng_add_vppid_to_ctx(struct lttng_ctx
**ctx
);
683 int lttng_add_hostname_to_ctx(struct lttng_ctx
**ctx
);
684 int lttng_add_interruptible_to_ctx(struct lttng_ctx
**ctx
);
685 int lttng_add_need_reschedule_to_ctx(struct lttng_ctx
**ctx
);
686 #if defined(CONFIG_PREEMPT_RT_FULL) || defined(CONFIG_PREEMPT)
687 int lttng_add_preemptible_to_ctx(struct lttng_ctx
**ctx
);
690 int lttng_add_preemptible_to_ctx(struct lttng_ctx
**ctx
)
695 #ifdef CONFIG_PREEMPT_RT_FULL
696 int lttng_add_migratable_to_ctx(struct lttng_ctx
**ctx
);
699 int lttng_add_migratable_to_ctx(struct lttng_ctx
**ctx
)
705 int lttng_add_callstack_to_ctx(struct lttng_ctx
**ctx
, int type
);
707 #if defined(CONFIG_PERF_EVENTS) && (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33))
708 int lttng_add_perf_counter_to_ctx(uint32_t type
,
711 struct lttng_ctx
**ctx
);
712 int lttng_cpuhp_perf_counter_online(unsigned int cpu
,
713 struct lttng_cpuhp_node
*node
);
714 int lttng_cpuhp_perf_counter_dead(unsigned int cpu
,
715 struct lttng_cpuhp_node
*node
);
718 int lttng_add_perf_counter_to_ctx(uint32_t type
,
721 struct lttng_ctx
**ctx
)
726 int lttng_cpuhp_perf_counter_online(unsigned int cpu
,
727 struct lttng_cpuhp_node
*node
)
732 int lttng_cpuhp_perf_counter_dead(unsigned int cpu
,
733 struct lttng_cpuhp_node
*node
)
739 int lttng_logger_init(void);
740 void lttng_logger_exit(void);
742 extern int lttng_statedump_start(struct lttng_session
*session
);
744 #ifdef CONFIG_KPROBES
745 int lttng_kprobes_register(const char *name
,
746 const char *symbol_name
,
749 struct lttng_event
*event
);
750 void lttng_kprobes_unregister(struct lttng_event
*event
);
751 void lttng_kprobes_destroy_private(struct lttng_event
*event
);
754 int lttng_kprobes_register(const char *name
,
755 const char *symbol_name
,
758 struct lttng_event
*event
)
764 void lttng_kprobes_unregister(struct lttng_event
*event
)
769 void lttng_kprobes_destroy_private(struct lttng_event
*event
)
774 #ifdef CONFIG_KRETPROBES
775 int lttng_kretprobes_register(const char *name
,
776 const char *symbol_name
,
779 struct lttng_event
*event_entry
,
780 struct lttng_event
*event_exit
);
781 void lttng_kretprobes_unregister(struct lttng_event
*event
);
782 void lttng_kretprobes_destroy_private(struct lttng_event
*event
);
783 int lttng_kretprobes_event_enable_state(struct lttng_event
*event
,
787 int lttng_kretprobes_register(const char *name
,
788 const char *symbol_name
,
791 struct lttng_event
*event_entry
,
792 struct lttng_event
*event_exit
)
798 void lttng_kretprobes_unregister(struct lttng_event
*event
)
803 void lttng_kretprobes_destroy_private(struct lttng_event
*event
)
808 int lttng_kretprobes_event_enable_state(struct lttng_event
*event
,
815 #if defined(CONFIG_DYNAMIC_FTRACE) && !defined(LTTNG_FTRACE_MISSING_HEADER)
816 int lttng_ftrace_register(const char *name
,
817 const char *symbol_name
,
818 struct lttng_event
*event
);
819 void lttng_ftrace_unregister(struct lttng_event
*event
);
820 void lttng_ftrace_destroy_private(struct lttng_event
*event
);
823 int lttng_ftrace_register(const char *name
,
824 const char *symbol_name
,
825 struct lttng_event
*event
)
831 void lttng_ftrace_unregister(struct lttng_event
*event
)
836 void lttng_ftrace_destroy_private(struct lttng_event
*event
)
841 int lttng_calibrate(struct lttng_kernel_calibrate
*calibrate
);
843 extern const struct file_operations lttng_tracepoint_list_fops
;
844 extern const struct file_operations lttng_syscall_list_fops
;
846 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
847 #define TRACEPOINT_HAS_DATA_ARG
850 #endif /* _LTTNG_EVENTS_H */