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_krp
; /* Kretprobe handling */
28 struct lttng_uprobe_handler
{
29 struct lttng_kernel_event_common
*event
;
31 struct uprobe_consumer up_consumer
;
32 struct list_head node
;
42 struct list_head head
;
45 enum lttng_syscall_entryexit
{
50 enum lttng_syscall_abi
{
51 LTTNG_SYSCALL_ABI_NATIVE
,
52 LTTNG_SYSCALL_ABI_COMPAT
,
55 struct lttng_kernel_event_common_private
{
56 struct lttng_kernel_event_common
*pub
; /* Public event interface */
58 const struct lttng_kernel_event_desc
*desc
;
59 /* Backward references: list of lttng_enabler_ref (ref to enablers) */
60 struct list_head enablers_ref_head
;
61 int registered
; /* has reg'd tracepoint probe */
64 int has_enablers_without_filter_bytecode
;
65 /* list of struct lttng_kernel_bytecode_runtime, sorted by seqnum */
66 struct list_head filter_bytecode_runtime_head
;
67 enum lttng_kernel_abi_instrumentation instrumentation
;
68 /* Selected by instrumentation */
70 struct lttng_kprobe kprobe
;
71 struct lttng_uprobe uprobe
;
73 struct lttng_krp
*lttng_krp
;
77 enum lttng_syscall_entryexit entryexit
;
78 enum lttng_syscall_abi abi
;
79 struct hlist_node node
; /* chain registered syscall event_notifier */
80 unsigned int syscall_id
;
85 struct lttng_kernel_event_recorder_private
{
86 struct lttng_kernel_event_common_private parent
;
88 struct lttng_kernel_event_recorder
*pub
; /* Public event interface */
89 struct list_head node
; /* Event recorder list */
90 struct hlist_node hlist
; /* Hash table of event recorders */
91 struct lttng_kernel_ctx
*ctx
;
93 unsigned int metadata_dumped
:1;
96 struct lttng_kernel_event_notifier_private
{
97 struct lttng_kernel_event_common_private parent
;
99 struct lttng_kernel_event_notifier
*pub
; /* Public event notifier interface */
100 struct lttng_event_notifier_group
*group
; /* weak ref */
101 size_t num_captures
; /* Needed to allocate the msgpack array. */
102 uint64_t error_counter_index
;
103 struct list_head node
; /* Event notifier list */
104 struct hlist_node hlist
; /* Hash table of event notifiers */
105 struct list_head capture_bytecode_runtime_head
;
109 enum lttng_kernel_bytecode_interpreter_ret
{
110 LTTNG_KERNEL_BYTECODE_INTERPRETER_ERROR
= -1,
111 LTTNG_KERNEL_BYTECODE_INTERPRETER_OK
= 0,
114 enum lttng_kernel_bytecode_filter_result
{
115 LTTNG_KERNEL_BYTECODE_FILTER_ACCEPT
= 0,
116 LTTNG_KERNEL_BYTECODE_FILTER_REJECT
= 1,
119 struct lttng_kernel_bytecode_filter_ctx
{
120 enum lttng_kernel_bytecode_filter_result result
;
123 struct lttng_interpreter_output
;
125 enum lttng_kernel_bytecode_type
{
126 LTTNG_KERNEL_BYTECODE_TYPE_FILTER
,
127 LTTNG_KERNEL_BYTECODE_TYPE_CAPTURE
,
130 struct lttng_kernel_bytecode_node
{
131 enum lttng_kernel_bytecode_type type
;
132 struct list_head node
;
133 struct lttng_enabler
*enabler
;
136 uint32_t reloc_offset
;
142 struct lttng_kernel_bytecode_runtime
{
143 /* Associated bytecode */
144 enum lttng_kernel_bytecode_type type
;
145 struct lttng_kernel_bytecode_node
*bc
;
146 int (*interpreter_func
)(struct lttng_kernel_bytecode_runtime
*kernel_bytecode
,
147 const char *interpreter_stack_data
,
148 struct lttng_kernel_probe_ctx
*lttng_probe_ctx
,
151 struct list_head node
; /* list of bytecode runtime in event */
152 struct lttng_kernel_ctx
*ctx
;
156 * Enabler field, within whatever object is enabling an event. Target of
157 * backward reference.
159 struct lttng_enabler
{
160 enum lttng_enabler_format_type format_type
;
162 /* head list of struct lttng_kernel_bytecode_node */
163 struct list_head filter_bytecode_head
;
165 struct lttng_kernel_abi_event event_param
;
166 unsigned int enabled
:1;
168 uint64_t user_token
; /* User-provided token. */
171 struct lttng_event_enabler
{
172 struct lttng_enabler base
;
173 struct list_head node
; /* per-session list of enablers */
174 struct lttng_channel
*chan
;
177 struct lttng_event_notifier_enabler
{
178 struct lttng_enabler base
;
179 uint64_t error_counter_index
;
180 struct list_head node
; /* List of event_notifier enablers */
181 struct lttng_event_notifier_group
*group
;
183 /* head list of struct lttng_kernel_bytecode_node */
184 struct list_head capture_bytecode_head
;
185 uint64_t num_captures
;
188 struct lttng_ctx_value
{
197 * We need to keep this perf counter field separately from struct
198 * lttng_kernel_ctx_field because cpu hotplug needs fixed-location addresses.
200 struct lttng_perf_counter_field
{
201 #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0))
202 struct lttng_cpuhp_node cpuhp_prepare
;
203 struct lttng_cpuhp_node cpuhp_online
;
205 struct notifier_block nb
;
208 struct perf_event_attr
*attr
;
209 struct perf_event
**e
; /* per-cpu array */
211 struct lttng_kernel_event_field
*event_field
;
214 struct lttng_kernel_ctx_field
{
215 const struct lttng_kernel_event_field
*event_field
;
216 size_t (*get_size
)(void *priv
, struct lttng_kernel_probe_ctx
*probe_ctx
,
218 void (*record
)(void *priv
, struct lttng_kernel_probe_ctx
*probe_ctx
,
219 struct lib_ring_buffer_ctx
*ctx
,
220 struct lttng_channel
*chan
);
221 void (*get_value
)(void *priv
, struct lttng_kernel_probe_ctx
*probe_ctx
,
222 struct lttng_ctx_value
*value
);
223 void (*destroy
)(void *priv
);
227 struct lttng_kernel_ctx
{
228 struct lttng_kernel_ctx_field
*fields
;
229 unsigned int nr_fields
;
230 unsigned int allocated_fields
;
231 size_t largest_align
; /* in bytes */
234 extern struct lttng_kernel_ctx
*lttng_static_ctx
;
237 const struct lttng_kernel_type_integer
*lttng_kernel_get_type_integer(const struct lttng_kernel_type_common
*type
)
239 if (type
->type
!= lttng_kernel_type_integer
)
241 return container_of(type
, const struct lttng_kernel_type_integer
, parent
);
245 const struct lttng_kernel_type_string
*lttng_kernel_get_type_string(const struct lttng_kernel_type_common
*type
)
247 if (type
->type
!= lttng_kernel_type_string
)
249 return container_of(type
, const struct lttng_kernel_type_string
, parent
);
253 const struct lttng_kernel_type_enum
*lttng_kernel_get_type_enum(const struct lttng_kernel_type_common
*type
)
255 if (type
->type
!= lttng_kernel_type_enum
)
257 return container_of(type
, const struct lttng_kernel_type_enum
, parent
);
261 const struct lttng_kernel_type_array
*lttng_kernel_get_type_array(const struct lttng_kernel_type_common
*type
)
263 if (type
->type
!= lttng_kernel_type_array
)
265 return container_of(type
, const struct lttng_kernel_type_array
, parent
);
269 const struct lttng_kernel_type_sequence
*lttng_kernel_get_type_sequence(const struct lttng_kernel_type_common
*type
)
271 if (type
->type
!= lttng_kernel_type_sequence
)
273 return container_of(type
, const struct lttng_kernel_type_sequence
, parent
);
277 const struct lttng_kernel_type_struct
*lttng_kernel_get_type_struct(const struct lttng_kernel_type_common
*type
)
279 if (type
->type
!= lttng_kernel_type_struct
)
281 return container_of(type
, const struct lttng_kernel_type_struct
, parent
);
285 const struct lttng_kernel_type_variant
*lttng_kernel_get_type_variant(const struct lttng_kernel_type_common
*type
)
287 if (type
->type
!= lttng_kernel_type_variant
)
289 return container_of(type
, const struct lttng_kernel_type_variant
, parent
);
292 static inline bool lttng_kernel_type_is_bytewise_integer(const struct lttng_kernel_type_common
*type
)
294 const struct lttng_kernel_type_integer
*type_integer
= lttng_kernel_get_type_integer(type
);
298 switch (type_integer
->size
) {
299 case 8: /* Fall-through. */
300 case 16: /* Fall-through. */
301 case 32: /* Fall-through. */
310 int lttng_kernel_interpret_event_filter(const struct lttng_kernel_event_common
*event
,
311 const char *interpreter_stack_data
,
312 struct lttng_kernel_probe_ctx
*probe_ctx
,
313 void *event_filter_ctx
);
316 struct lttng_enabler
*lttng_event_enabler_as_enabler(
317 struct lttng_event_enabler
*event_enabler
)
319 return &event_enabler
->base
;
323 struct lttng_enabler
*lttng_event_notifier_enabler_as_enabler(
324 struct lttng_event_notifier_enabler
*event_notifier_enabler
)
326 return &event_notifier_enabler
->base
;
329 int lttng_context_init(void);
330 void lttng_context_exit(void);
331 int lttng_kernel_context_append(struct lttng_kernel_ctx
**ctx_p
,
332 const struct lttng_kernel_ctx_field
*f
);
333 void lttng_kernel_context_remove_last(struct lttng_kernel_ctx
**ctx_p
);
334 struct lttng_kernel_ctx_field
*lttng_kernel_get_context_field_from_index(struct lttng_kernel_ctx
*ctx
,
336 int lttng_kernel_find_context(struct lttng_kernel_ctx
*ctx
, const char *name
);
337 int lttng_kernel_get_context_index(struct lttng_kernel_ctx
*ctx
, const char *name
);
338 void lttng_kernel_destroy_context(struct lttng_kernel_ctx
*ctx
);
339 int lttng_add_pid_to_ctx(struct lttng_kernel_ctx
**ctx
);
340 int lttng_add_cpu_id_to_ctx(struct lttng_kernel_ctx
**ctx
);
341 int lttng_add_procname_to_ctx(struct lttng_kernel_ctx
**ctx
);
342 int lttng_add_prio_to_ctx(struct lttng_kernel_ctx
**ctx
);
343 int lttng_add_nice_to_ctx(struct lttng_kernel_ctx
**ctx
);
344 int lttng_add_vpid_to_ctx(struct lttng_kernel_ctx
**ctx
);
345 int lttng_add_tid_to_ctx(struct lttng_kernel_ctx
**ctx
);
346 int lttng_add_vtid_to_ctx(struct lttng_kernel_ctx
**ctx
);
347 int lttng_add_ppid_to_ctx(struct lttng_kernel_ctx
**ctx
);
348 int lttng_add_vppid_to_ctx(struct lttng_kernel_ctx
**ctx
);
349 int lttng_add_hostname_to_ctx(struct lttng_kernel_ctx
**ctx
);
350 int lttng_add_interruptible_to_ctx(struct lttng_kernel_ctx
**ctx
);
351 int lttng_add_need_reschedule_to_ctx(struct lttng_kernel_ctx
**ctx
);
352 #if defined(CONFIG_PREEMPT_RT_FULL) || defined(CONFIG_PREEMPT)
353 int lttng_add_preemptible_to_ctx(struct lttng_kernel_ctx
**ctx
);
356 int lttng_add_preemptible_to_ctx(struct lttng_kernel_ctx
**ctx
)
361 #ifdef CONFIG_PREEMPT_RT_FULL
362 int lttng_add_migratable_to_ctx(struct lttng_kernel_ctx
**ctx
);
365 int lttng_add_migratable_to_ctx(struct lttng_kernel_ctx
**ctx
)
371 int lttng_add_callstack_to_ctx(struct lttng_kernel_ctx
**ctx
, int type
);
373 #if defined(CONFIG_CGROUPS) && \
374 ((LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,6,0)) || \
375 LTTNG_UBUNTU_KERNEL_RANGE(4,4,0,0, 4,5,0,0))
376 int lttng_add_cgroup_ns_to_ctx(struct lttng_kernel_ctx
**ctx
);
379 int lttng_add_cgroup_ns_to_ctx(struct lttng_kernel_ctx
**ctx
)
385 #if defined(CONFIG_IPC_NS) && \
386 (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,8,0))
387 int lttng_add_ipc_ns_to_ctx(struct lttng_kernel_ctx
**ctx
);
390 int lttng_add_ipc_ns_to_ctx(struct lttng_kernel_ctx
**ctx
)
396 #if !defined(LTTNG_MNT_NS_MISSING_HEADER) && \
397 (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,8,0))
398 int lttng_add_mnt_ns_to_ctx(struct lttng_kernel_ctx
**ctx
);
401 int lttng_add_mnt_ns_to_ctx(struct lttng_kernel_ctx
**ctx
)
407 #if defined(CONFIG_NET_NS) && \
408 (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,8,0))
409 int lttng_add_net_ns_to_ctx(struct lttng_kernel_ctx
**ctx
);
412 int lttng_add_net_ns_to_ctx(struct lttng_kernel_ctx
**ctx
)
418 #if defined(CONFIG_PID_NS) && \
419 (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,8,0))
420 int lttng_add_pid_ns_to_ctx(struct lttng_kernel_ctx
**ctx
);
423 int lttng_add_pid_ns_to_ctx(struct lttng_kernel_ctx
**ctx
)
429 #if defined(CONFIG_USER_NS) && \
430 (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,8,0))
431 int lttng_add_user_ns_to_ctx(struct lttng_kernel_ctx
**ctx
);
434 int lttng_add_user_ns_to_ctx(struct lttng_kernel_ctx
**ctx
)
440 #if defined(CONFIG_UTS_NS) && \
441 (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,8,0))
442 int lttng_add_uts_ns_to_ctx(struct lttng_kernel_ctx
**ctx
);
445 int lttng_add_uts_ns_to_ctx(struct lttng_kernel_ctx
**ctx
)
451 #if defined(CONFIG_TIME_NS) && \
452 (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,6,0))
453 int lttng_add_time_ns_to_ctx(struct lttng_kernel_ctx
**ctx
);
456 int lttng_add_time_ns_to_ctx(struct lttng_kernel_ctx
**ctx
)
462 int lttng_add_uid_to_ctx(struct lttng_kernel_ctx
**ctx
);
463 int lttng_add_euid_to_ctx(struct lttng_kernel_ctx
**ctx
);
464 int lttng_add_suid_to_ctx(struct lttng_kernel_ctx
**ctx
);
465 int lttng_add_gid_to_ctx(struct lttng_kernel_ctx
**ctx
);
466 int lttng_add_egid_to_ctx(struct lttng_kernel_ctx
**ctx
);
467 int lttng_add_sgid_to_ctx(struct lttng_kernel_ctx
**ctx
);
468 int lttng_add_vuid_to_ctx(struct lttng_kernel_ctx
**ctx
);
469 int lttng_add_veuid_to_ctx(struct lttng_kernel_ctx
**ctx
);
470 int lttng_add_vsuid_to_ctx(struct lttng_kernel_ctx
**ctx
);
471 int lttng_add_vgid_to_ctx(struct lttng_kernel_ctx
**ctx
);
472 int lttng_add_vegid_to_ctx(struct lttng_kernel_ctx
**ctx
);
473 int lttng_add_vsgid_to_ctx(struct lttng_kernel_ctx
**ctx
);
475 #if defined(CONFIG_PERF_EVENTS)
476 int lttng_add_perf_counter_to_ctx(uint32_t type
,
479 struct lttng_kernel_ctx
**ctx
);
480 int lttng_cpuhp_perf_counter_online(unsigned int cpu
,
481 struct lttng_cpuhp_node
*node
);
482 int lttng_cpuhp_perf_counter_dead(unsigned int cpu
,
483 struct lttng_cpuhp_node
*node
);
486 int lttng_add_perf_counter_to_ctx(uint32_t type
,
489 struct lttng_kernel_ctx
**ctx
)
494 int lttng_cpuhp_perf_counter_online(unsigned int cpu
,
495 struct lttng_cpuhp_node
*node
)
500 int lttng_cpuhp_perf_counter_dead(unsigned int cpu
,
501 struct lttng_cpuhp_node
*node
)
507 struct lttng_event_enabler
*lttng_event_enabler_create(
508 enum lttng_enabler_format_type format_type
,
509 struct lttng_kernel_abi_event
*event_param
,
510 struct lttng_channel
*chan
);
512 int lttng_event_enabler_enable(struct lttng_event_enabler
*event_enabler
);
513 int lttng_event_enabler_disable(struct lttng_event_enabler
*event_enabler
);
514 struct lttng_event_notifier_enabler
*lttng_event_notifier_enabler_create(
515 struct lttng_event_notifier_group
*event_notifier_group
,
516 enum lttng_enabler_format_type format_type
,
517 struct lttng_kernel_abi_event_notifier
*event_notifier_param
);
519 int lttng_event_notifier_enabler_enable(
520 struct lttng_event_notifier_enabler
*event_notifier_enabler
);
521 int lttng_event_notifier_enabler_disable(
522 struct lttng_event_notifier_enabler
*event_notifier_enabler
);
524 int lttng_event_enabler_attach_filter_bytecode(struct lttng_event_enabler
*event_enabler
,
525 struct lttng_kernel_abi_filter_bytecode __user
*bytecode
);
526 int lttng_event_notifier_enabler_attach_filter_bytecode(
527 struct lttng_event_notifier_enabler
*event_notifier_enabler
,
528 struct lttng_kernel_abi_filter_bytecode __user
*bytecode
);
529 int lttng_event_notifier_enabler_attach_capture_bytecode(
530 struct lttng_event_notifier_enabler
*event_notifier_enabler
,
531 struct lttng_kernel_abi_capture_bytecode __user
*bytecode
);
533 int lttng_desc_match_enabler(const struct lttng_kernel_event_desc
*desc
,
534 struct lttng_enabler
*enabler
);
536 void lttng_enabler_link_bytecode(const struct lttng_kernel_event_desc
*event_desc
,
537 struct lttng_kernel_ctx
*ctx
,
538 struct list_head
*instance_bytecode_runtime_head
,
539 struct list_head
*enabler_bytecode_runtime_head
);
541 #if defined(CONFIG_HAVE_SYSCALL_TRACEPOINTS)
542 int lttng_syscalls_register_event(struct lttng_event_enabler
*event_enabler
);
543 int lttng_syscalls_unregister_channel(struct lttng_channel
*chan
);
544 int lttng_syscalls_destroy_event(struct lttng_channel
*chan
);
545 int lttng_syscall_filter_enable_event(
546 struct lttng_channel
*chan
,
547 struct lttng_kernel_event_recorder
*event
);
548 int lttng_syscall_filter_disable_event(
549 struct lttng_channel
*chan
,
550 struct lttng_kernel_event_recorder
*event
);
552 long lttng_channel_syscall_mask(struct lttng_channel
*channel
,
553 struct lttng_kernel_abi_syscall_mask __user
*usyscall_mask
);
555 int lttng_syscalls_register_event_notifier(
556 struct lttng_event_notifier_enabler
*event_notifier_enabler
);
557 int lttng_syscalls_create_matching_event_notifiers(
558 struct lttng_event_notifier_enabler
*event_notifier_enabler
);
559 int lttng_syscalls_unregister_event_notifier_group(struct lttng_event_notifier_group
*group
);
560 int lttng_syscall_filter_enable_event_notifier(struct lttng_kernel_event_notifier
*event_notifier
);
561 int lttng_syscall_filter_disable_event_notifier(struct lttng_kernel_event_notifier
*event_notifier
);
563 static inline int lttng_syscalls_register_event(
564 struct lttng_event_enabler
*event_enabler
)
569 static inline int lttng_syscalls_unregister_channel(struct lttng_channel
*chan
)
574 static inline int lttng_syscalls_destroy(struct lttng_channel
*chan
)
579 static inline int lttng_syscall_filter_enable_event(struct lttng_channel
*chan
,
580 struct lttng_kernel_event_recorder
*event
);
585 static inline int lttng_syscall_filter_disable_event(struct lttng_channel
*chan
,
586 struct lttng_kernel_event_recorder
*event
);
591 static inline long lttng_channel_syscall_mask(struct lttng_channel
*channel
,
592 struct lttng_kernel_syscall_mask __user
*usyscall_mask
)
597 static inline int lttng_syscalls_register_event_notifier(
598 struct lttng_event_notifier_group
*group
)
603 static inline int lttng_syscalls_unregister_event_notifier_group(
604 struct lttng_event_notifier_group
*group
)
609 static inline int lttng_syscall_filter_enable_event_notifier(
610 struct lttng_event_notifier_group
*group
,
616 static inline int lttng_syscall_filter_disable_event_notifier(
617 struct lttng_event_notifier_group
*group
,
625 #ifdef CONFIG_KPROBES
626 int lttng_kprobes_register_event(const char *name
,
627 const char *symbol_name
,
630 struct lttng_kernel_event_recorder
*event
);
631 void lttng_kprobes_unregister_event(struct lttng_kernel_event_recorder
*event
);
632 void lttng_kprobes_destroy_event_private(struct lttng_kernel_event_recorder
*event
);
633 int lttng_kprobes_register_event_notifier(const char *symbol_name
,
636 struct lttng_kernel_event_notifier
*event_notifier
);
637 void lttng_kprobes_unregister_event_notifier(struct lttng_kernel_event_notifier
*event_notifier
);
638 void lttng_kprobes_destroy_event_notifier_private(struct lttng_kernel_event_notifier
*event_notifier
);
641 int lttng_kprobes_register_event(const char *name
,
642 const char *symbol_name
,
645 struct lttng_kernel_event_recorder
*event
)
651 void lttng_kprobes_unregister_event(struct lttng_kernel_event_recorder
*event
)
656 void lttng_kprobes_destroy_event_private(struct lttng_kernel_event_recorder
*event
)
661 int lttng_kprobes_register_event_notifier(const char *symbol_name
,
664 struct lttng_kernel_event_notifier
*event_notifier
)
670 void lttng_kprobes_unregister_event_notifier(struct lttng_kernel_event_notifier
*event_notifier
)
675 void lttng_kprobes_destroy_event_notifier_private(struct lttng_kernel_event_notifier
*event_notifier
)
680 int lttng_event_add_callsite(struct lttng_kernel_event_common
*event
,
681 struct lttng_kernel_abi_event_callsite __user
*callsite
);
683 #ifdef CONFIG_UPROBES
684 int lttng_uprobes_register_event(const char *name
,
685 int fd
, struct lttng_kernel_event_recorder
*event
);
686 int lttng_uprobes_event_add_callsite(struct lttng_kernel_event_common
*event
,
687 struct lttng_kernel_abi_event_callsite __user
*callsite
);
688 void lttng_uprobes_unregister_event(struct lttng_kernel_event_recorder
*event
);
689 void lttng_uprobes_destroy_event_private(struct lttng_kernel_event_recorder
*event
);
690 int lttng_uprobes_register_event_notifier(const char *name
,
691 int fd
, struct lttng_kernel_event_notifier
*event_notifier
);
692 void lttng_uprobes_unregister_event_notifier(struct lttng_kernel_event_notifier
*event_notifier
);
693 void lttng_uprobes_destroy_event_notifier_private(struct lttng_kernel_event_notifier
*event_notifier
);
696 int lttng_uprobes_register_event(const char *name
,
697 int fd
, struct lttng_kernel_event_recorder
*event
)
703 int lttng_uprobes_event_add_callsite(struct lttng_kernel_event_common
*event
,
704 struct lttng_kernel_abi_event_callsite __user
*callsite
)
710 void lttng_uprobes_unregister_event(struct lttng_kernel_event_recorder
*event
)
715 void lttng_uprobes_destroy_event_private(struct lttng_kernel_event_recorder
*event
)
720 int lttng_uprobes_register_event_notifier(const char *name
,
721 int fd
, struct lttng_kernel_event_notifier
*event_notifier
)
727 void lttng_uprobes_unregister_event_notifier(struct lttng_kernel_event_notifier
*event_notifier
)
732 void lttng_uprobes_destroy_event_notifier_private(struct lttng_kernel_event_notifier
*event_notifier
)
737 #ifdef CONFIG_KRETPROBES
738 int lttng_kretprobes_register(const char *name
,
739 const char *symbol_name
,
742 struct lttng_kernel_event_recorder
*event_entry
,
743 struct lttng_kernel_event_recorder
*event_exit
);
744 void lttng_kretprobes_unregister(struct lttng_kernel_event_recorder
*event
);
745 void lttng_kretprobes_destroy_private(struct lttng_kernel_event_recorder
*event
);
746 int lttng_kretprobes_event_enable_state(struct lttng_kernel_event_common
*event
,
750 int lttng_kretprobes_register(const char *name
,
751 const char *symbol_name
,
754 struct lttng_kernel_event_recorder
*event_entry
,
755 struct lttng_kernel_event_recorder
*event_exit
)
761 void lttng_kretprobes_unregister(struct lttng_kernel_event_recorder
*event
)
766 void lttng_kretprobes_destroy_private(struct lttng_kernel_event_recorder
*event
)
771 int lttng_kretprobes_event_enable_state(struct lttng_kernel_event_common
*event
,
778 #define lttng_kernel_static_ctx_field(_event_field, _get_size, _record, _get_value, _destroy, _priv) \
779 __LTTNG_COMPOUND_LITERAL(const struct lttng_kernel_ctx_field, { \
780 .event_field = (_event_field), \
781 .get_size = (_get_size), \
782 .record = (_record), \
783 .get_value = (_get_value), \
784 .destroy = (_destroy), \
788 #endif /* _LTTNG_EVENTS_INTERNAL_H */