1 /* SPDX-License-Identifier: (GPL-2.0-only or LGPL-2.1-only)
3 * lttng/events-internal.h
5 * Copyright (C) 2010-2012 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
8 #ifndef _LTTNG_EVENTS_INTERNAL_H
9 #define _LTTNG_EVENTS_INTERNAL_H
11 #include <lttng/events.h>
13 enum lttng_enabler_format_type
{
14 LTTNG_ENABLER_FORMAT_STAR_GLOB
,
15 LTTNG_ENABLER_FORMAT_NAME
,
19 * Objects in a linked-list of enablers, owned by an event.
21 struct lttng_enabler_ref
{
22 struct list_head node
; /* enabler ref list */
23 struct lttng_enabler
*ref
; /* backward ref */
26 struct lttng_kernel_event_common_private
{
27 struct lttng_kernel_event_common
*pub
; /* Public event interface */
29 const struct lttng_kernel_event_desc
*desc
;
30 /* Backward references: list of lttng_enabler_ref (ref to enablers) */
31 struct list_head enablers_ref_head
;
32 int registered
; /* has reg'd tracepoint probe */
35 int has_enablers_without_filter_bytecode
;
36 /* list of struct lttng_kernel_bytecode_runtime, sorted by seqnum */
37 struct list_head filter_bytecode_runtime_head
;
38 enum lttng_kernel_abi_instrumentation instrumentation
;
39 /* Selected by instrumentation */
41 struct lttng_kprobe kprobe
;
42 struct lttng_uprobe uprobe
;
44 struct lttng_krp
*lttng_krp
;
48 enum lttng_syscall_entryexit entryexit
;
49 enum lttng_syscall_abi abi
;
50 struct hlist_node node
; /* chain registered syscall event_notifier */
51 unsigned int syscall_id
;
56 struct lttng_kernel_event_recorder_private
{
57 struct lttng_kernel_event_common_private parent
;
59 struct lttng_kernel_event_recorder
*pub
; /* Public event interface */
60 struct list_head node
; /* Event recorder list */
61 struct hlist_node hlist
; /* Hash table of event recorders */
62 struct lttng_kernel_ctx
*ctx
;
64 unsigned int metadata_dumped
:1;
67 struct lttng_kernel_event_notifier_private
{
68 struct lttng_kernel_event_common_private parent
;
70 struct lttng_kernel_event_notifier
*pub
; /* Public event notifier interface */
71 struct lttng_event_notifier_group
*group
; /* weak ref */
72 size_t num_captures
; /* Needed to allocate the msgpack array. */
73 uint64_t error_counter_index
;
74 struct list_head node
; /* Event notifier list */
75 struct hlist_node hlist
; /* Hash table of event notifiers */
76 struct list_head capture_bytecode_runtime_head
;
80 enum lttng_kernel_bytecode_interpreter_ret
{
81 LTTNG_KERNEL_BYTECODE_INTERPRETER_ERROR
= -1,
82 LTTNG_KERNEL_BYTECODE_INTERPRETER_OK
= 0,
85 enum lttng_kernel_bytecode_filter_result
{
86 LTTNG_KERNEL_BYTECODE_FILTER_ACCEPT
= 0,
87 LTTNG_KERNEL_BYTECODE_FILTER_REJECT
= 1,
90 struct lttng_kernel_bytecode_filter_ctx
{
91 enum lttng_kernel_bytecode_filter_result result
;
94 struct lttng_interpreter_output
;
96 enum lttng_kernel_bytecode_type
{
97 LTTNG_KERNEL_BYTECODE_TYPE_FILTER
,
98 LTTNG_KERNEL_BYTECODE_TYPE_CAPTURE
,
101 struct lttng_kernel_bytecode_node
{
102 enum lttng_kernel_bytecode_type type
;
103 struct list_head node
;
104 struct lttng_enabler
*enabler
;
107 uint32_t reloc_offset
;
113 struct lttng_kernel_bytecode_runtime
{
114 /* Associated bytecode */
115 enum lttng_kernel_bytecode_type type
;
116 struct lttng_kernel_bytecode_node
*bc
;
117 int (*interpreter_func
)(struct lttng_kernel_bytecode_runtime
*kernel_bytecode
,
118 const char *interpreter_stack_data
,
119 struct lttng_kernel_probe_ctx
*lttng_probe_ctx
,
122 struct list_head node
; /* list of bytecode runtime in event */
123 struct lttng_kernel_ctx
*ctx
;
127 * Enabler field, within whatever object is enabling an event. Target of
128 * backward reference.
130 struct lttng_enabler
{
131 enum lttng_enabler_format_type format_type
;
133 /* head list of struct lttng_kernel_bytecode_node */
134 struct list_head filter_bytecode_head
;
136 struct lttng_kernel_abi_event event_param
;
137 unsigned int enabled
:1;
139 uint64_t user_token
; /* User-provided token. */
142 struct lttng_event_enabler
{
143 struct lttng_enabler base
;
144 struct list_head node
; /* per-session list of enablers */
145 struct lttng_channel
*chan
;
148 struct lttng_event_notifier_enabler
{
149 struct lttng_enabler base
;
150 uint64_t error_counter_index
;
151 struct list_head node
; /* List of event_notifier enablers */
152 struct lttng_event_notifier_group
*group
;
154 /* head list of struct lttng_kernel_bytecode_node */
155 struct list_head capture_bytecode_head
;
156 uint64_t num_captures
;
159 struct lttng_ctx_value
{
168 * We need to keep this perf counter field separately from struct
169 * lttng_kernel_ctx_field because cpu hotplug needs fixed-location addresses.
171 struct lttng_perf_counter_field
{
172 #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0))
173 struct lttng_cpuhp_node cpuhp_prepare
;
174 struct lttng_cpuhp_node cpuhp_online
;
176 struct notifier_block nb
;
179 struct perf_event_attr
*attr
;
180 struct perf_event
**e
; /* per-cpu array */
182 struct lttng_kernel_event_field
*event_field
;
185 struct lttng_kernel_ctx_field
{
186 const struct lttng_kernel_event_field
*event_field
;
187 size_t (*get_size
)(void *priv
, struct lttng_kernel_probe_ctx
*probe_ctx
,
189 void (*record
)(void *priv
, struct lttng_kernel_probe_ctx
*probe_ctx
,
190 struct lib_ring_buffer_ctx
*ctx
,
191 struct lttng_channel
*chan
);
192 void (*get_value
)(void *priv
, struct lttng_kernel_probe_ctx
*probe_ctx
,
193 struct lttng_ctx_value
*value
);
194 void (*destroy
)(void *priv
);
198 struct lttng_kernel_ctx
{
199 struct lttng_kernel_ctx_field
*fields
;
200 unsigned int nr_fields
;
201 unsigned int allocated_fields
;
202 size_t largest_align
; /* in bytes */
205 extern struct lttng_kernel_ctx
*lttng_static_ctx
;
208 const struct lttng_kernel_type_integer
*lttng_kernel_get_type_integer(const struct lttng_kernel_type_common
*type
)
210 if (type
->type
!= lttng_kernel_type_integer
)
212 return container_of(type
, const struct lttng_kernel_type_integer
, parent
);
216 const struct lttng_kernel_type_string
*lttng_kernel_get_type_string(const struct lttng_kernel_type_common
*type
)
218 if (type
->type
!= lttng_kernel_type_string
)
220 return container_of(type
, const struct lttng_kernel_type_string
, parent
);
224 const struct lttng_kernel_type_enum
*lttng_kernel_get_type_enum(const struct lttng_kernel_type_common
*type
)
226 if (type
->type
!= lttng_kernel_type_enum
)
228 return container_of(type
, const struct lttng_kernel_type_enum
, parent
);
232 const struct lttng_kernel_type_array
*lttng_kernel_get_type_array(const struct lttng_kernel_type_common
*type
)
234 if (type
->type
!= lttng_kernel_type_array
)
236 return container_of(type
, const struct lttng_kernel_type_array
, parent
);
240 const struct lttng_kernel_type_sequence
*lttng_kernel_get_type_sequence(const struct lttng_kernel_type_common
*type
)
242 if (type
->type
!= lttng_kernel_type_sequence
)
244 return container_of(type
, const struct lttng_kernel_type_sequence
, parent
);
248 const struct lttng_kernel_type_struct
*lttng_kernel_get_type_struct(const struct lttng_kernel_type_common
*type
)
250 if (type
->type
!= lttng_kernel_type_struct
)
252 return container_of(type
, const struct lttng_kernel_type_struct
, parent
);
256 const struct lttng_kernel_type_variant
*lttng_kernel_get_type_variant(const struct lttng_kernel_type_common
*type
)
258 if (type
->type
!= lttng_kernel_type_variant
)
260 return container_of(type
, const struct lttng_kernel_type_variant
, parent
);
263 static inline bool lttng_kernel_type_is_bytewise_integer(const struct lttng_kernel_type_common
*type
)
265 const struct lttng_kernel_type_integer
*type_integer
= lttng_kernel_get_type_integer(type
);
269 switch (type_integer
->size
) {
270 case 8: /* Fall-through. */
271 case 16: /* Fall-through. */
272 case 32: /* Fall-through. */
281 int lttng_kernel_interpret_event_filter(const struct lttng_kernel_event_common
*event
,
282 const char *interpreter_stack_data
,
283 struct lttng_kernel_probe_ctx
*probe_ctx
,
284 void *event_filter_ctx
);
287 struct lttng_enabler
*lttng_event_enabler_as_enabler(
288 struct lttng_event_enabler
*event_enabler
)
290 return &event_enabler
->base
;
294 struct lttng_enabler
*lttng_event_notifier_enabler_as_enabler(
295 struct lttng_event_notifier_enabler
*event_notifier_enabler
)
297 return &event_notifier_enabler
->base
;
300 int lttng_context_init(void);
301 void lttng_context_exit(void);
302 int lttng_kernel_context_append(struct lttng_kernel_ctx
**ctx_p
,
303 const struct lttng_kernel_ctx_field
*f
);
304 void lttng_kernel_context_remove_last(struct lttng_kernel_ctx
**ctx_p
);
305 struct lttng_kernel_ctx_field
*lttng_kernel_get_context_field_from_index(struct lttng_kernel_ctx
*ctx
,
307 int lttng_kernel_find_context(struct lttng_kernel_ctx
*ctx
, const char *name
);
308 int lttng_kernel_get_context_index(struct lttng_kernel_ctx
*ctx
, const char *name
);
309 void lttng_kernel_destroy_context(struct lttng_kernel_ctx
*ctx
);
310 int lttng_add_pid_to_ctx(struct lttng_kernel_ctx
**ctx
);
311 int lttng_add_cpu_id_to_ctx(struct lttng_kernel_ctx
**ctx
);
312 int lttng_add_procname_to_ctx(struct lttng_kernel_ctx
**ctx
);
313 int lttng_add_prio_to_ctx(struct lttng_kernel_ctx
**ctx
);
314 int lttng_add_nice_to_ctx(struct lttng_kernel_ctx
**ctx
);
315 int lttng_add_vpid_to_ctx(struct lttng_kernel_ctx
**ctx
);
316 int lttng_add_tid_to_ctx(struct lttng_kernel_ctx
**ctx
);
317 int lttng_add_vtid_to_ctx(struct lttng_kernel_ctx
**ctx
);
318 int lttng_add_ppid_to_ctx(struct lttng_kernel_ctx
**ctx
);
319 int lttng_add_vppid_to_ctx(struct lttng_kernel_ctx
**ctx
);
320 int lttng_add_hostname_to_ctx(struct lttng_kernel_ctx
**ctx
);
321 int lttng_add_interruptible_to_ctx(struct lttng_kernel_ctx
**ctx
);
322 int lttng_add_need_reschedule_to_ctx(struct lttng_kernel_ctx
**ctx
);
323 #if defined(CONFIG_PREEMPT_RT_FULL) || defined(CONFIG_PREEMPT)
324 int lttng_add_preemptible_to_ctx(struct lttng_kernel_ctx
**ctx
);
327 int lttng_add_preemptible_to_ctx(struct lttng_kernel_ctx
**ctx
)
332 #ifdef CONFIG_PREEMPT_RT_FULL
333 int lttng_add_migratable_to_ctx(struct lttng_kernel_ctx
**ctx
);
336 int lttng_add_migratable_to_ctx(struct lttng_kernel_ctx
**ctx
)
342 int lttng_add_callstack_to_ctx(struct lttng_kernel_ctx
**ctx
, int type
);
344 #if defined(CONFIG_CGROUPS) && \
345 ((LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,6,0)) || \
346 LTTNG_UBUNTU_KERNEL_RANGE(4,4,0,0, 4,5,0,0))
347 int lttng_add_cgroup_ns_to_ctx(struct lttng_kernel_ctx
**ctx
);
350 int lttng_add_cgroup_ns_to_ctx(struct lttng_kernel_ctx
**ctx
)
356 #if defined(CONFIG_IPC_NS) && \
357 (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,8,0))
358 int lttng_add_ipc_ns_to_ctx(struct lttng_kernel_ctx
**ctx
);
361 int lttng_add_ipc_ns_to_ctx(struct lttng_kernel_ctx
**ctx
)
367 #if !defined(LTTNG_MNT_NS_MISSING_HEADER) && \
368 (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,8,0))
369 int lttng_add_mnt_ns_to_ctx(struct lttng_kernel_ctx
**ctx
);
372 int lttng_add_mnt_ns_to_ctx(struct lttng_kernel_ctx
**ctx
)
378 #if defined(CONFIG_NET_NS) && \
379 (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,8,0))
380 int lttng_add_net_ns_to_ctx(struct lttng_kernel_ctx
**ctx
);
383 int lttng_add_net_ns_to_ctx(struct lttng_kernel_ctx
**ctx
)
389 #if defined(CONFIG_PID_NS) && \
390 (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,8,0))
391 int lttng_add_pid_ns_to_ctx(struct lttng_kernel_ctx
**ctx
);
394 int lttng_add_pid_ns_to_ctx(struct lttng_kernel_ctx
**ctx
)
400 #if defined(CONFIG_USER_NS) && \
401 (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,8,0))
402 int lttng_add_user_ns_to_ctx(struct lttng_kernel_ctx
**ctx
);
405 int lttng_add_user_ns_to_ctx(struct lttng_kernel_ctx
**ctx
)
411 #if defined(CONFIG_UTS_NS) && \
412 (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,8,0))
413 int lttng_add_uts_ns_to_ctx(struct lttng_kernel_ctx
**ctx
);
416 int lttng_add_uts_ns_to_ctx(struct lttng_kernel_ctx
**ctx
)
422 #if defined(CONFIG_TIME_NS) && \
423 (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,6,0))
424 int lttng_add_time_ns_to_ctx(struct lttng_kernel_ctx
**ctx
);
427 int lttng_add_time_ns_to_ctx(struct lttng_kernel_ctx
**ctx
)
433 int lttng_add_uid_to_ctx(struct lttng_kernel_ctx
**ctx
);
434 int lttng_add_euid_to_ctx(struct lttng_kernel_ctx
**ctx
);
435 int lttng_add_suid_to_ctx(struct lttng_kernel_ctx
**ctx
);
436 int lttng_add_gid_to_ctx(struct lttng_kernel_ctx
**ctx
);
437 int lttng_add_egid_to_ctx(struct lttng_kernel_ctx
**ctx
);
438 int lttng_add_sgid_to_ctx(struct lttng_kernel_ctx
**ctx
);
439 int lttng_add_vuid_to_ctx(struct lttng_kernel_ctx
**ctx
);
440 int lttng_add_veuid_to_ctx(struct lttng_kernel_ctx
**ctx
);
441 int lttng_add_vsuid_to_ctx(struct lttng_kernel_ctx
**ctx
);
442 int lttng_add_vgid_to_ctx(struct lttng_kernel_ctx
**ctx
);
443 int lttng_add_vegid_to_ctx(struct lttng_kernel_ctx
**ctx
);
444 int lttng_add_vsgid_to_ctx(struct lttng_kernel_ctx
**ctx
);
446 #if defined(CONFIG_PERF_EVENTS)
447 int lttng_add_perf_counter_to_ctx(uint32_t type
,
450 struct lttng_kernel_ctx
**ctx
);
451 int lttng_cpuhp_perf_counter_online(unsigned int cpu
,
452 struct lttng_cpuhp_node
*node
);
453 int lttng_cpuhp_perf_counter_dead(unsigned int cpu
,
454 struct lttng_cpuhp_node
*node
);
457 int lttng_add_perf_counter_to_ctx(uint32_t type
,
460 struct lttng_kernel_ctx
**ctx
)
465 int lttng_cpuhp_perf_counter_online(unsigned int cpu
,
466 struct lttng_cpuhp_node
*node
)
471 int lttng_cpuhp_perf_counter_dead(unsigned int cpu
,
472 struct lttng_cpuhp_node
*node
)
478 struct lttng_event_enabler
*lttng_event_enabler_create(
479 enum lttng_enabler_format_type format_type
,
480 struct lttng_kernel_abi_event
*event_param
,
481 struct lttng_channel
*chan
);
483 int lttng_event_enabler_enable(struct lttng_event_enabler
*event_enabler
);
484 int lttng_event_enabler_disable(struct lttng_event_enabler
*event_enabler
);
485 struct lttng_event_notifier_enabler
*lttng_event_notifier_enabler_create(
486 struct lttng_event_notifier_group
*event_notifier_group
,
487 enum lttng_enabler_format_type format_type
,
488 struct lttng_kernel_abi_event_notifier
*event_notifier_param
);
490 int lttng_event_notifier_enabler_enable(
491 struct lttng_event_notifier_enabler
*event_notifier_enabler
);
492 int lttng_event_notifier_enabler_disable(
493 struct lttng_event_notifier_enabler
*event_notifier_enabler
);
495 int lttng_event_enabler_attach_filter_bytecode(struct lttng_event_enabler
*event_enabler
,
496 struct lttng_kernel_abi_filter_bytecode __user
*bytecode
);
497 int lttng_event_notifier_enabler_attach_filter_bytecode(
498 struct lttng_event_notifier_enabler
*event_notifier_enabler
,
499 struct lttng_kernel_abi_filter_bytecode __user
*bytecode
);
500 int lttng_event_notifier_enabler_attach_capture_bytecode(
501 struct lttng_event_notifier_enabler
*event_notifier_enabler
,
502 struct lttng_kernel_abi_capture_bytecode __user
*bytecode
);
504 int lttng_desc_match_enabler(const struct lttng_kernel_event_desc
*desc
,
505 struct lttng_enabler
*enabler
);
507 void lttng_enabler_link_bytecode(const struct lttng_kernel_event_desc
*event_desc
,
508 struct lttng_kernel_ctx
*ctx
,
509 struct list_head
*instance_bytecode_runtime_head
,
510 struct list_head
*enabler_bytecode_runtime_head
);
512 #if defined(CONFIG_HAVE_SYSCALL_TRACEPOINTS)
513 int lttng_syscalls_register_event(struct lttng_event_enabler
*event_enabler
);
514 int lttng_syscalls_unregister_channel(struct lttng_channel
*chan
);
515 int lttng_syscalls_destroy_event(struct lttng_channel
*chan
);
516 int lttng_syscall_filter_enable_event(
517 struct lttng_channel
*chan
,
518 struct lttng_kernel_event_recorder
*event
);
519 int lttng_syscall_filter_disable_event(
520 struct lttng_channel
*chan
,
521 struct lttng_kernel_event_recorder
*event
);
523 long lttng_channel_syscall_mask(struct lttng_channel
*channel
,
524 struct lttng_kernel_abi_syscall_mask __user
*usyscall_mask
);
526 int lttng_syscalls_register_event_notifier(
527 struct lttng_event_notifier_enabler
*event_notifier_enabler
);
528 int lttng_syscalls_create_matching_event_notifiers(
529 struct lttng_event_notifier_enabler
*event_notifier_enabler
);
530 int lttng_syscalls_unregister_event_notifier_group(struct lttng_event_notifier_group
*group
);
531 int lttng_syscall_filter_enable_event_notifier(struct lttng_kernel_event_notifier
*event_notifier
);
532 int lttng_syscall_filter_disable_event_notifier(struct lttng_kernel_event_notifier
*event_notifier
);
534 static inline int lttng_syscalls_register_event(
535 struct lttng_event_enabler
*event_enabler
)
540 static inline int lttng_syscalls_unregister_channel(struct lttng_channel
*chan
)
545 static inline int lttng_syscalls_destroy(struct lttng_channel
*chan
)
550 static inline int lttng_syscall_filter_enable_event(struct lttng_channel
*chan
,
551 struct lttng_kernel_event_recorder
*event
);
556 static inline int lttng_syscall_filter_disable_event(struct lttng_channel
*chan
,
557 struct lttng_kernel_event_recorder
*event
);
562 static inline long lttng_channel_syscall_mask(struct lttng_channel
*channel
,
563 struct lttng_kernel_syscall_mask __user
*usyscall_mask
)
568 static inline int lttng_syscalls_register_event_notifier(
569 struct lttng_event_notifier_group
*group
)
574 static inline int lttng_syscalls_unregister_event_notifier_group(
575 struct lttng_event_notifier_group
*group
)
580 static inline int lttng_syscall_filter_enable_event_notifier(
581 struct lttng_event_notifier_group
*group
,
587 static inline int lttng_syscall_filter_disable_event_notifier(
588 struct lttng_event_notifier_group
*group
,
596 #ifdef CONFIG_KPROBES
597 int lttng_kprobes_register_event(const char *name
,
598 const char *symbol_name
,
601 struct lttng_kernel_event_recorder
*event
);
602 void lttng_kprobes_unregister_event(struct lttng_kernel_event_recorder
*event
);
603 void lttng_kprobes_destroy_event_private(struct lttng_kernel_event_recorder
*event
);
604 int lttng_kprobes_register_event_notifier(const char *symbol_name
,
607 struct lttng_kernel_event_notifier
*event_notifier
);
608 void lttng_kprobes_unregister_event_notifier(struct lttng_kernel_event_notifier
*event_notifier
);
609 void lttng_kprobes_destroy_event_notifier_private(struct lttng_kernel_event_notifier
*event_notifier
);
612 int lttng_kprobes_register_event(const char *name
,
613 const char *symbol_name
,
616 struct lttng_kernel_event_recorder
*event
)
622 void lttng_kprobes_unregister_event(struct lttng_kernel_event_recorder
*event
)
627 void lttng_kprobes_destroy_event_private(struct lttng_kernel_event_recorder
*event
)
632 int lttng_kprobes_register_event_notifier(const char *symbol_name
,
635 struct lttng_kernel_event_notifier
*event_notifier
)
641 void lttng_kprobes_unregister_event_notifier(struct lttng_kernel_event_notifier
*event_notifier
)
646 void lttng_kprobes_destroy_event_notifier_private(struct lttng_kernel_event_notifier
*event_notifier
)
651 int lttng_event_add_callsite(struct lttng_kernel_event_common
*event
,
652 struct lttng_kernel_abi_event_callsite __user
*callsite
);
654 #ifdef CONFIG_UPROBES
655 int lttng_uprobes_register_event(const char *name
,
656 int fd
, struct lttng_kernel_event_recorder
*event
);
657 int lttng_uprobes_event_add_callsite(struct lttng_kernel_event_common
*event
,
658 struct lttng_kernel_abi_event_callsite __user
*callsite
);
659 void lttng_uprobes_unregister_event(struct lttng_kernel_event_recorder
*event
);
660 void lttng_uprobes_destroy_event_private(struct lttng_kernel_event_recorder
*event
);
661 int lttng_uprobes_register_event_notifier(const char *name
,
662 int fd
, struct lttng_kernel_event_notifier
*event_notifier
);
663 void lttng_uprobes_unregister_event_notifier(struct lttng_kernel_event_notifier
*event_notifier
);
664 void lttng_uprobes_destroy_event_notifier_private(struct lttng_kernel_event_notifier
*event_notifier
);
667 int lttng_uprobes_register_event(const char *name
,
668 int fd
, struct lttng_kernel_event_recorder
*event
)
674 int lttng_uprobes_event_add_callsite(struct lttng_kernel_event_common
*event
,
675 struct lttng_kernel_abi_event_callsite __user
*callsite
)
681 void lttng_uprobes_unregister_event(struct lttng_kernel_event_recorder
*event
)
686 void lttng_uprobes_destroy_event_private(struct lttng_kernel_event_recorder
*event
)
691 int lttng_uprobes_register_event_notifier(const char *name
,
692 int fd
, struct lttng_kernel_event_notifier
*event_notifier
)
698 void lttng_uprobes_unregister_event_notifier(struct lttng_kernel_event_notifier
*event_notifier
)
703 void lttng_uprobes_destroy_event_notifier_private(struct lttng_kernel_event_notifier
*event_notifier
)
708 #ifdef CONFIG_KRETPROBES
709 int lttng_kretprobes_register(const char *name
,
710 const char *symbol_name
,
713 struct lttng_kernel_event_recorder
*event_entry
,
714 struct lttng_kernel_event_recorder
*event_exit
);
715 void lttng_kretprobes_unregister(struct lttng_kernel_event_recorder
*event
);
716 void lttng_kretprobes_destroy_private(struct lttng_kernel_event_recorder
*event
);
717 int lttng_kretprobes_event_enable_state(struct lttng_kernel_event_common
*event
,
721 int lttng_kretprobes_register(const char *name
,
722 const char *symbol_name
,
725 struct lttng_kernel_event_recorder
*event_entry
,
726 struct lttng_kernel_event_recorder
*event_exit
)
732 void lttng_kretprobes_unregister(struct lttng_kernel_event_recorder
*event
)
737 void lttng_kretprobes_destroy_private(struct lttng_kernel_event_recorder
*event
)
742 int lttng_kretprobes_event_enable_state(struct lttng_kernel_event_common
*event
,
749 #define lttng_kernel_static_ctx_field(_event_field, _get_size, _record, _get_value, _destroy, _priv) \
750 __LTTNG_COMPOUND_LITERAL(const struct lttng_kernel_ctx_field, { \
751 .event_field = (_event_field), \
752 .get_size = (_get_size), \
753 .record = (_record), \
754 .get_value = (_get_value), \
755 .destroy = (_destroy), \
759 #endif /* _LTTNG_EVENTS_INTERNAL_H */