Refactoring: uprobes: combine common code between recorder and notifier
[lttng-modules.git] / include / lttng / events-internal.h
index 097f5e979723c8a3969f82f3e60e729fb63162ef..d72502c9b0a8ee8a6b912a5cc846a46fe1058ca3 100644 (file)
@@ -8,19 +8,32 @@
 #ifndef _LTTNG_EVENTS_INTERNAL_H
 #define _LTTNG_EVENTS_INTERNAL_H
 
+#include <wrapper/compiler_attributes.h>
+
 #include <lttng/events.h>
 
+struct lttng_syscall_filter;
+struct lttng_metadata_cache;
+struct perf_event;
+struct perf_event_attr;
+struct lttng_kernel_ring_buffer_config;
+
 enum lttng_enabler_format_type {
        LTTNG_ENABLER_FORMAT_STAR_GLOB,
        LTTNG_ENABLER_FORMAT_NAME,
 };
 
+enum channel_type {
+       PER_CPU_CHANNEL,
+       METADATA_CHANNEL,
+};
+
 /*
  * Objects in a linked-list of enablers, owned by an event.
  */
 struct lttng_enabler_ref {
        struct list_head node;                  /* enabler ref list */
-       struct lttng_enabler *ref;              /* backward ref */
+       struct lttng_event_enabler_common *ref;         /* backward ref */
 };
 
 struct lttng_krp;                              /* Kretprobe handling */
@@ -106,6 +119,58 @@ struct lttng_kernel_event_notifier_private {
 
 };
 
+struct lttng_kernel_syscall_table {
+       unsigned int sys_enter_registered:1,
+               sys_exit_registered:1;
+
+       struct hlist_head *syscall_dispatch;            /* for syscall tracing */
+       struct hlist_head *compat_syscall_dispatch;
+       struct hlist_head *syscall_exit_dispatch;       /* for syscall exit tracing */
+       struct hlist_head *compat_syscall_exit_dispatch;
+
+       /*
+        * Combining all unknown syscall events works as long as they
+        * are only matched by "all" syscalls enablers, but will require
+        * a design change when we allow matching by syscall number, for
+        * instance by allocating sc_tables accomodating NR_syscalls
+        * entries.
+        */
+       struct hlist_head unknown_syscall_dispatch;     /* for unknown syscalls */
+       struct hlist_head compat_unknown_syscall_dispatch;
+       struct hlist_head unknown_syscall_exit_dispatch;
+       struct hlist_head compat_unknown_syscall_exit_dispatch;
+
+       struct lttng_syscall_filter *sc_filter;
+       int syscall_all_entry;
+       int syscall_all_exit;
+};
+
+struct lttng_kernel_channel_common_private {
+       struct lttng_kernel_channel_common *pub;
+
+       struct file *file;                      /* File associated to channel */
+       unsigned int tstate:1;                  /* Transient enable state */
+
+       struct lttng_kernel_syscall_table syscall_table;
+};
+
+struct lttng_kernel_channel_buffer_private {
+       struct lttng_kernel_channel_common_private parent;
+
+       struct lttng_kernel_channel_buffer *pub;
+
+       unsigned int id;                        /* Channel ID */
+       unsigned int free_event_id;             /* Next event ID to allocate */
+       int header_type;                        /* 0: unset, 1: compact, 2: large */
+
+       enum channel_type channel_type;
+       struct lttng_kernel_ctx *ctx;
+       struct lttng_kernel_ring_buffer_channel *rb_chan;               /* Ring buffer channel */
+       unsigned int metadata_dumped:1;
+       struct list_head node;                  /* Channel list in session */
+       struct lttng_transport *transport;
+};
+
 enum lttng_kernel_bytecode_interpreter_ret {
        LTTNG_KERNEL_BYTECODE_INTERPRETER_ERROR = -1,
        LTTNG_KERNEL_BYTECODE_INTERPRETER_OK = 0,
@@ -127,10 +192,15 @@ enum lttng_kernel_bytecode_type {
        LTTNG_KERNEL_BYTECODE_TYPE_CAPTURE,
 };
 
+enum lttng_kernel_event_enabler_type {
+       LTTNG_EVENT_ENABLER_TYPE_RECORDER,
+       LTTNG_EVENT_ENABLER_TYPE_NOTIFIER,
+};
+
 struct lttng_kernel_bytecode_node {
        enum lttng_kernel_bytecode_type type;
        struct list_head node;
-       struct lttng_enabler *enabler;
+       struct lttng_event_enabler_common *enabler;
        struct {
                uint32_t len;
                uint32_t reloc_offset;
@@ -156,7 +226,8 @@ struct lttng_kernel_bytecode_runtime {
  * Enabler field, within whatever object is enabling an event. Target of
  * backward reference.
  */
-struct lttng_enabler {
+struct lttng_event_enabler_common {
+       enum lttng_kernel_event_enabler_type enabler_type;
        enum lttng_enabler_format_type format_type;
 
        /* head list of struct lttng_kernel_bytecode_node */
@@ -168,14 +239,15 @@ struct lttng_enabler {
        uint64_t user_token;            /* User-provided token. */
 };
 
-struct lttng_event_enabler {
-       struct lttng_enabler base;
-       struct list_head node;  /* per-session list of enablers */
-       struct lttng_channel *chan;
+struct lttng_event_recorder_enabler {
+       struct lttng_event_enabler_common parent;
+       struct list_head node;          /* per-session list of enablers */
+       bool published;                 /* published in per-session list. */
+       struct lttng_kernel_channel_buffer *chan;
 };
 
 struct lttng_event_notifier_enabler {
-       struct lttng_enabler base;
+       struct lttng_event_enabler_common parent;
        uint64_t error_counter_index;
        struct list_head node;  /* List of event_notifier enablers */
        struct lttng_event_notifier_group *group;
@@ -217,7 +289,7 @@ struct lttng_kernel_ctx_field {
                        size_t offset);
        void (*record)(void *priv, struct lttng_kernel_probe_ctx *probe_ctx,
                        struct lttng_kernel_ring_buffer_ctx *ctx,
-                       struct lttng_channel *chan);
+                       struct lttng_kernel_channel_buffer *chan);
        void (*get_value)(void *priv, struct lttng_kernel_probe_ctx *probe_ctx,
                        struct lttng_ctx_value *value);
        void (*destroy)(void *priv);
@@ -243,55 +315,68 @@ struct lttng_metadata_cache {
        uint64_t version;               /* Current version of the metadata */
 };
 
+struct lttng_metadata_stream {
+       void *priv;                     /* Ring buffer private data */
+       struct lttng_metadata_cache *metadata_cache;
+       unsigned int metadata_in;       /* Bytes read from the cache */
+       unsigned int metadata_out;      /* Bytes consumed from stream */
+       int finalized;                  /* Has channel been finalized */
+       wait_queue_head_t read_wait;    /* Reader buffer-level wait queue */
+       struct list_head list;          /* Stream list */
+       struct lttng_transport *transport;
+       uint64_t version;               /* Current version of the metadata cache */
+       bool coherent;                  /* Stream in a coherent state */
+};
+
 struct lttng_kernel_channel_buffer_ops_private {
        struct lttng_kernel_channel_buffer_ops *pub;    /* Public channel buffer ops interface */
 
-       struct channel *(*channel_create)(const char *name,
+       struct lttng_kernel_ring_buffer_channel *(*channel_create)(const char *name,
                                void *priv,
                                void *buf_addr,
                                size_t subbuf_size, size_t num_subbuf,
                                unsigned int switch_timer_interval,
                                unsigned int read_timer_interval);
-       void (*channel_destroy)(struct channel *chan);
-       struct lib_ring_buffer *(*buffer_read_open)(struct channel *chan);
-       int (*buffer_has_read_closed_stream)(struct channel *chan);
-       void (*buffer_read_close)(struct lib_ring_buffer *buf);
+       void (*channel_destroy)(struct lttng_kernel_ring_buffer_channel *chan);
+       struct lttng_kernel_ring_buffer *(*buffer_read_open)(struct lttng_kernel_ring_buffer_channel *chan);
+       int (*buffer_has_read_closed_stream)(struct lttng_kernel_ring_buffer_channel *chan);
+       void (*buffer_read_close)(struct lttng_kernel_ring_buffer *buf);
        /*
         * packet_avail_size returns the available size in the current
         * packet. Note that the size returned is only a hint, since it
         * may change due to concurrent writes.
         */
-       size_t (*packet_avail_size)(struct channel *chan);
-       wait_queue_head_t *(*get_writer_buf_wait_queue)(struct channel *chan, int cpu);
-       wait_queue_head_t *(*get_hp_wait_queue)(struct channel *chan);
-       int (*is_finalized)(struct channel *chan);
-       int (*is_disabled)(struct channel *chan);
-       int (*timestamp_begin) (const struct lib_ring_buffer_config *config,
-                       struct lib_ring_buffer *bufb,
+       size_t (*packet_avail_size)(struct lttng_kernel_ring_buffer_channel *chan);
+       wait_queue_head_t *(*get_writer_buf_wait_queue)(struct lttng_kernel_ring_buffer_channel *chan, int cpu);
+       wait_queue_head_t *(*get_hp_wait_queue)(struct lttng_kernel_ring_buffer_channel *chan);
+       int (*is_finalized)(struct lttng_kernel_ring_buffer_channel *chan);
+       int (*is_disabled)(struct lttng_kernel_ring_buffer_channel *chan);
+       int (*timestamp_begin) (const struct lttng_kernel_ring_buffer_config *config,
+                       struct lttng_kernel_ring_buffer *bufb,
                        uint64_t *timestamp_begin);
-       int (*timestamp_end) (const struct lib_ring_buffer_config *config,
-                       struct lib_ring_buffer *bufb,
+       int (*timestamp_end) (const struct lttng_kernel_ring_buffer_config *config,
+                       struct lttng_kernel_ring_buffer *bufb,
                        uint64_t *timestamp_end);
-       int (*events_discarded) (const struct lib_ring_buffer_config *config,
-                       struct lib_ring_buffer *bufb,
+       int (*events_discarded) (const struct lttng_kernel_ring_buffer_config *config,
+                       struct lttng_kernel_ring_buffer *bufb,
                        uint64_t *events_discarded);
-       int (*content_size) (const struct lib_ring_buffer_config *config,
-                       struct lib_ring_buffer *bufb,
+       int (*content_size) (const struct lttng_kernel_ring_buffer_config *config,
+                       struct lttng_kernel_ring_buffer *bufb,
                        uint64_t *content_size);
-       int (*packet_size) (const struct lib_ring_buffer_config *config,
-                       struct lib_ring_buffer *bufb,
+       int (*packet_size) (const struct lttng_kernel_ring_buffer_config *config,
+                       struct lttng_kernel_ring_buffer *bufb,
                        uint64_t *packet_size);
-       int (*stream_id) (const struct lib_ring_buffer_config *config,
-                       struct lib_ring_buffer *bufb,
+       int (*stream_id) (const struct lttng_kernel_ring_buffer_config *config,
+                       struct lttng_kernel_ring_buffer *bufb,
                        uint64_t *stream_id);
-       int (*current_timestamp) (const struct lib_ring_buffer_config *config,
-                       struct lib_ring_buffer *bufb,
+       int (*current_timestamp) (const struct lttng_kernel_ring_buffer_config *config,
+                       struct lttng_kernel_ring_buffer *bufb,
                        uint64_t *ts);
-       int (*sequence_number) (const struct lib_ring_buffer_config *config,
-                       struct lib_ring_buffer *bufb,
+       int (*sequence_number) (const struct lttng_kernel_ring_buffer_config *config,
+                       struct lttng_kernel_ring_buffer *bufb,
                        uint64_t *seq);
-       int (*instance_id) (const struct lib_ring_buffer_config *config,
-                       struct lib_ring_buffer *bufb,
+       int (*instance_id) (const struct lttng_kernel_ring_buffer_config *config,
+                       struct lttng_kernel_ring_buffer *bufb,
                        uint64_t *id);
 };
 
@@ -325,6 +410,13 @@ struct lttng_counter {
        struct lttng_counter_ops *ops;
 };
 
+#define LTTNG_EVENT_NOTIFIER_HT_BITS           12
+#define LTTNG_EVENT_NOTIFIER_HT_SIZE           (1U << LTTNG_EVENT_NOTIFIER_HT_BITS)
+
+struct lttng_event_notifier_ht {
+       struct hlist_head table[LTTNG_EVENT_NOTIFIER_HT_SIZE];
+};
+
 struct lttng_event_notifier_group {
        struct file *file;              /* File associated to event notifier group */
        struct file *notif_file;        /* File used to expose notifications to userspace. */
@@ -334,29 +426,12 @@ struct lttng_event_notifier_group {
        struct lttng_event_notifier_ht event_notifiers_ht; /* Hash table of event notifiers */
        struct lttng_kernel_channel_buffer_ops *ops;
        struct lttng_transport *transport;
-       struct channel *chan;           /* Ring buffer channel for event notifier group. */
-       struct lib_ring_buffer *buf;    /* Ring buffer for event notifier group. */
+       struct lttng_kernel_ring_buffer_channel *chan;          /* Ring buffer channel for event notifier group. */
+       struct lttng_kernel_ring_buffer *buf;   /* Ring buffer for event notifier group. */
        wait_queue_head_t read_wait;
        struct irq_work wakeup_pending; /* Pending wakeup irq work. */
-       struct lttng_kernel_event_notifier *sc_unknown; /* for unknown syscalls */
-       struct lttng_kernel_event_notifier *sc_compat_unknown;
-
-       struct lttng_syscall_filter *sc_filter;
 
-       struct hlist_head *event_notifier_syscall_dispatch;
-       struct hlist_head *event_notifier_compat_syscall_dispatch;
-       struct hlist_head *event_notifier_exit_syscall_dispatch;
-       struct hlist_head *event_notifier_exit_compat_syscall_dispatch;
-
-       struct hlist_head event_notifier_unknown_syscall_dispatch;
-       struct hlist_head event_notifier_compat_unknown_syscall_dispatch;
-       struct hlist_head event_notifier_exit_unknown_syscall_dispatch;
-       struct hlist_head event_notifier_exit_compat_unknown_syscall_dispatch;
-
-       int syscall_all_entry;
-       int syscall_all_exit;
-
-       unsigned int sys_enter_registered:1, sys_exit_registered:1;
+       struct lttng_kernel_syscall_table syscall_table;
 
        struct lttng_counter *error_counter;
        size_t error_counter_len;
@@ -376,6 +451,57 @@ struct lttng_counter_transport {
        struct lttng_counter_ops ops;
 };
 
+#define LTTNG_EVENT_HT_BITS            12
+#define LTTNG_EVENT_HT_SIZE            (1U << LTTNG_EVENT_HT_BITS)
+
+struct lttng_event_ht {
+       struct hlist_head table[LTTNG_EVENT_HT_SIZE];
+};
+
+struct lttng_kernel_session_private {
+       struct lttng_kernel_session *pub;       /* Public session interface */
+
+       int been_active;                        /* Has trace session been active ? */
+       struct file *file;                      /* File associated to session */
+       struct list_head chan;                  /* Channel list head */
+       struct list_head events;                /* Event list head */
+       struct list_head list;                  /* Session list */
+       unsigned int free_chan_id;              /* Next chan ID to allocate */
+       uuid_le uuid;                           /* Trace session unique ID */
+       struct lttng_metadata_cache *metadata_cache;
+       unsigned int metadata_dumped:1,
+               tstate:1;                       /* Transient enable state */
+       /* List of event enablers */
+       struct list_head enablers_head;
+       /* Hash table of events */
+       struct lttng_event_ht events_ht;
+       char name[LTTNG_KERNEL_ABI_SESSION_NAME_LEN];
+       char creation_time[LTTNG_KERNEL_ABI_SESSION_CREATION_TIME_ISO8601_LEN];
+};
+
+struct lttng_id_hash_node {
+       struct hlist_node hlist;
+       int id;
+};
+
+enum tracker_type {
+       TRACKER_PID,
+       TRACKER_VPID,
+       TRACKER_UID,
+       TRACKER_VUID,
+       TRACKER_GID,
+       TRACKER_VGID,
+
+       TRACKER_UNKNOWN,
+};
+
+struct lttng_kernel_id_tracker_private {
+       struct lttng_kernel_id_tracker *pub;    /* Public interface */
+
+       struct lttng_kernel_session *session;
+       enum tracker_type tracker_type;
+};
+
 extern struct lttng_kernel_ctx *lttng_static_ctx;
 
 static inline
@@ -441,9 +567,12 @@ static inline bool lttng_kernel_type_is_bytewise_integer(const struct lttng_kern
        if (!type_integer)
                return false;
        switch (type_integer->size) {
-       case 8:         /* Fall-through. */
-       case 16:        /* Fall-through. */
-       case 32:        /* Fall-through. */
+       case 8:
+               lttng_fallthrough;
+       case 16:
+               lttng_fallthrough;
+       case 32:
+               lttng_fallthrough;
        case 64:
                break;
        default:
@@ -458,17 +587,17 @@ int lttng_kernel_interpret_event_filter(const struct lttng_kernel_event_common *
                void *event_filter_ctx);
 
 static inline
-struct lttng_enabler *lttng_event_enabler_as_enabler(
-               struct lttng_event_enabler *event_enabler)
+struct lttng_event_enabler_common *lttng_event_recorder_enabler_as_enabler(
+               struct lttng_event_recorder_enabler *event_recorder_enabler)
 {
-       return &event_enabler->base;
+       return &event_recorder_enabler->parent;
 }
 
 static inline
-struct lttng_enabler *lttng_event_notifier_enabler_as_enabler(
+struct lttng_event_enabler_common *lttng_event_notifier_enabler_as_enabler(
                struct lttng_event_notifier_enabler *event_notifier_enabler)
 {
-       return &event_notifier_enabler->base;
+       return &event_notifier_enabler->parent;
 }
 
 int lttng_context_init(void);
@@ -594,7 +723,8 @@ int lttng_add_uts_ns_to_ctx(struct lttng_kernel_ctx **ctx)
 #endif
 
 #if defined(CONFIG_TIME_NS) && \
-       (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,6,0))
+       (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,6,0) || \
+       LTTNG_RHEL_KERNEL_RANGE(4,18,0,305,0,0, 4,19,0,0,0,0))
 int lttng_add_time_ns_to_ctx(struct lttng_kernel_ctx **ctx);
 #else
 static inline
@@ -649,34 +779,29 @@ int lttng_cpuhp_perf_counter_dead(unsigned int cpu,
 }
 #endif
 
-struct lttng_event_enabler *lttng_event_enabler_create(
+struct lttng_event_recorder_enabler *lttng_event_recorder_enabler_create(
                enum lttng_enabler_format_type format_type,
                struct lttng_kernel_abi_event *event_param,
-               struct lttng_channel *chan);
+               struct lttng_kernel_channel_buffer *chan);
+void lttng_event_enabler_session_add(struct lttng_kernel_session *session,
+               struct lttng_event_recorder_enabler *event_enabler);
 
-int lttng_event_enabler_enable(struct lttng_event_enabler *event_enabler);
-int lttng_event_enabler_disable(struct lttng_event_enabler *event_enabler);
 struct lttng_event_notifier_enabler *lttng_event_notifier_enabler_create(
                struct lttng_event_notifier_group *event_notifier_group,
                enum lttng_enabler_format_type format_type,
                struct lttng_kernel_abi_event_notifier *event_notifier_param);
-
-int lttng_event_notifier_enabler_enable(
-               struct lttng_event_notifier_enabler *event_notifier_enabler);
-int lttng_event_notifier_enabler_disable(
-               struct lttng_event_notifier_enabler *event_notifier_enabler);
-
-int lttng_event_enabler_attach_filter_bytecode(struct lttng_event_enabler *event_enabler,
-               struct lttng_kernel_abi_filter_bytecode __user *bytecode);
-int lttng_event_notifier_enabler_attach_filter_bytecode(
-               struct lttng_event_notifier_enabler *event_notifier_enabler,
-               struct lttng_kernel_abi_filter_bytecode __user *bytecode);
 int lttng_event_notifier_enabler_attach_capture_bytecode(
                struct lttng_event_notifier_enabler *event_notifier_enabler,
                struct lttng_kernel_abi_capture_bytecode __user *bytecode);
 
+int lttng_event_enabler_enable(struct lttng_event_enabler_common *event_enabler);
+int lttng_event_enabler_disable(struct lttng_event_enabler_common *event_enabler);
+int lttng_event_enabler_attach_filter_bytecode(struct lttng_event_enabler_common *event_enabler,
+               struct lttng_kernel_abi_filter_bytecode __user *bytecode);
+void lttng_event_enabler_destroy(struct lttng_event_enabler_common *event_enabler);
+
 int lttng_desc_match_enabler(const struct lttng_kernel_event_desc *desc,
-               struct lttng_enabler *enabler);
+               struct lttng_event_enabler_common *enabler);
 
 void lttng_enabler_link_bytecode(const struct lttng_kernel_event_desc *event_desc,
                struct lttng_kernel_ctx *ctx,
@@ -684,83 +809,51 @@ void lttng_enabler_link_bytecode(const struct lttng_kernel_event_desc *event_des
                struct list_head *enabler_bytecode_runtime_head);
 
 #if defined(CONFIG_HAVE_SYSCALL_TRACEPOINTS)
-int lttng_syscalls_register_event(struct lttng_event_enabler *event_enabler);
-int lttng_syscalls_unregister_channel(struct lttng_channel *chan);
-int lttng_syscalls_destroy_event(struct lttng_channel *chan);
-int lttng_syscall_filter_enable_event(
-               struct lttng_channel *chan,
-               struct lttng_kernel_event_recorder *event);
-int lttng_syscall_filter_disable_event(
-               struct lttng_channel *chan,
-               struct lttng_kernel_event_recorder *event);
+int lttng_syscalls_register_event(struct lttng_event_enabler_common *event_enabler);
+int lttng_syscall_filter_enable_event(struct lttng_kernel_event_common *event);
+int lttng_syscall_filter_disable_event(struct lttng_kernel_event_common *event);
+
+int lttng_syscalls_unregister_syscall_table(struct lttng_kernel_syscall_table *syscall_table);
+int lttng_syscalls_destroy_syscall_table(struct lttng_kernel_syscall_table *syscall_table);
 
-long lttng_channel_syscall_mask(struct lttng_channel *channel,
+long lttng_channel_syscall_mask(struct lttng_kernel_channel_buffer *channel,
                struct lttng_kernel_abi_syscall_mask __user *usyscall_mask);
 
-int lttng_syscalls_register_event_notifier(
-               struct lttng_event_notifier_enabler *event_notifier_enabler);
 int lttng_syscalls_create_matching_event_notifiers(
                struct lttng_event_notifier_enabler *event_notifier_enabler);
-int lttng_syscalls_unregister_event_notifier_group(struct lttng_event_notifier_group *group);
-int lttng_syscall_filter_enable_event_notifier(struct lttng_kernel_event_notifier *event_notifier);
-int lttng_syscall_filter_disable_event_notifier(struct lttng_kernel_event_notifier *event_notifier);
 #else
-static inline int lttng_syscalls_register_event(
-               struct lttng_event_enabler *event_enabler)
-{
-       return -ENOSYS;
-}
-
-static inline int lttng_syscalls_unregister_channel(struct lttng_channel *chan)
-{
-       return 0;
-}
-
-static inline int lttng_syscalls_destroy(struct lttng_channel *chan)
-{
-       return 0;
-}
-
-static inline int lttng_syscall_filter_enable_event(struct lttng_channel *chan,
-               struct lttng_kernel_event_recorder *event);
+static inline int lttng_syscalls_register_event(struct lttng_event_enabler_common *event_enabler)
 {
        return -ENOSYS;
 }
 
-static inline int lttng_syscall_filter_disable_event(struct lttng_channel *chan,
-               struct lttng_kernel_event_recorder *event);
+static inline int lttng_syscall_filter_enable_event(struct lttng_kernel_event_common *event)
 {
        return -ENOSYS;
 }
 
-static inline long lttng_channel_syscall_mask(struct lttng_channel *channel,
-               struct lttng_kernel_syscall_mask __user *usyscall_mask)
+static inline int lttng_syscall_filter_disable_event(struct lttng_kernel_event_common *event)
 {
        return -ENOSYS;
 }
 
-static inline int lttng_syscalls_register_event_notifier(
-               struct lttng_event_notifier_group *group)
+static inline int lttng_syscalls_unregister_syscall_table(struct lttng_kernel_syscall_table *syscall_table)
 {
-       return -ENOSYS;
+       return 0;
 }
 
-static inline int lttng_syscalls_unregister_event_notifier_group(
-               struct lttng_event_notifier_group *group)
+static inline int lttng_syscalls_destroy_syscall_table(struct lttng_kernel_syscall_table *syscall_table)
 {
        return 0;
 }
 
-static inline int lttng_syscall_filter_enable_event_notifier(
-               struct lttng_event_notifier_group *group,
-               const char *name)
+static inline long lttng_channel_syscall_mask(struct lttng_kernel_channel_buffer *channel,
+               struct lttng_kernel_syscall_mask __user *usyscall_mask)
 {
        return -ENOSYS;
 }
 
-static inline int lttng_syscall_filter_disable_event_notifier(
-               struct lttng_event_notifier_group *group,
-               const char *name)
+static inline int lttng_syscalls_create_matching_event_notifiers(struct lttng_event_notifier_enabler *event_notifier_enabler)
 {
        return -ENOSYS;
 }
@@ -827,19 +920,15 @@ int lttng_event_add_callsite(struct lttng_kernel_event_common *event,
 
 #ifdef CONFIG_UPROBES
 int lttng_uprobes_register_event(const char *name,
-       int fd, struct lttng_kernel_event_recorder *event);
+       int fd, struct lttng_kernel_event_common *event);
 int lttng_uprobes_event_add_callsite(struct lttng_kernel_event_common *event,
        struct lttng_kernel_abi_event_callsite __user *callsite);
-void lttng_uprobes_unregister_event(struct lttng_kernel_event_recorder *event);
-void lttng_uprobes_destroy_event_private(struct lttng_kernel_event_recorder *event);
-int lttng_uprobes_register_event_notifier(const char *name,
-       int fd, struct lttng_kernel_event_notifier *event_notifier);
-void lttng_uprobes_unregister_event_notifier(struct lttng_kernel_event_notifier *event_notifier);
-void lttng_uprobes_destroy_event_notifier_private(struct lttng_kernel_event_notifier *event_notifier);
+void lttng_uprobes_unregister_event(struct lttng_kernel_event_common *event);
+void lttng_uprobes_destroy_event_private(struct lttng_kernel_event_common *event);
 #else
 static inline
 int lttng_uprobes_register_event(const char *name,
-       int fd, struct lttng_kernel_event_recorder *event)
+       int fd, struct lttng_kernel_event_common *event)
 {
        return -ENOSYS;
 }
@@ -852,29 +941,12 @@ int lttng_uprobes_event_add_callsite(struct lttng_kernel_event_common *event,
 }
 
 static inline
-void lttng_uprobes_unregister_event(struct lttng_kernel_event_recorder *event)
+void lttng_uprobes_unregister_event(struct lttng_kernel_event_common *event)
 {
 }
 
 static inline
-void lttng_uprobes_destroy_event_private(struct lttng_kernel_event_recorder *event)
-{
-}
-
-static inline
-int lttng_uprobes_register_event_notifier(const char *name,
-       int fd, struct lttng_kernel_event_notifier *event_notifier)
-{
-       return -ENOSYS;
-}
-
-static inline
-void lttng_uprobes_unregister_event_notifier(struct lttng_kernel_event_notifier *event_notifier)
-{
-}
-
-static inline
-void lttng_uprobes_destroy_event_notifier_private(struct lttng_kernel_event_notifier *event_notifier)
+void lttng_uprobes_destroy_event_private(struct lttng_kernel_event_common *event)
 {
 }
 #endif
@@ -930,12 +1002,12 @@ int lttng_fix_pending_event_notifiers(void);
 int lttng_session_active(void);
 bool lttng_event_notifier_active(void);
 
-struct lttng_session *lttng_session_create(void);
-int lttng_session_enable(struct lttng_session *session);
-int lttng_session_disable(struct lttng_session *session);
-void lttng_session_destroy(struct lttng_session *session);
-int lttng_session_metadata_regenerate(struct lttng_session *session);
-int lttng_session_statedump(struct lttng_session *session);
+struct lttng_kernel_session *lttng_session_create(void);
+int lttng_session_enable(struct lttng_kernel_session *session);
+int lttng_session_disable(struct lttng_kernel_session *session);
+void lttng_session_destroy(struct lttng_kernel_session *session);
+int lttng_session_metadata_regenerate(struct lttng_kernel_session *session);
+int lttng_session_statedump(struct lttng_kernel_session *session);
 void metadata_cache_destroy(struct kref *kref);
 
 struct lttng_counter *lttng_kernel_counter_create(
@@ -956,29 +1028,25 @@ int lttng_event_notifier_group_create_error_counter(
 void lttng_event_notifier_group_destroy(
                struct lttng_event_notifier_group *event_notifier_group);
 
-struct lttng_channel *lttng_channel_create(struct lttng_session *session,
+struct lttng_kernel_channel_buffer *lttng_channel_buffer_create(struct lttng_kernel_session *session,
                                       const char *transport_name,
                                       void *buf_addr,
                                       size_t subbuf_size, size_t num_subbuf,
                                       unsigned int switch_timer_interval,
                                       unsigned int read_timer_interval,
                                       enum channel_type channel_type);
-struct lttng_channel *lttng_global_channel_create(struct lttng_session *session,
+struct lttng_kernel_channel_buffer *lttng_global_channel_create(struct lttng_kernel_session *session,
                                       int overwrite, void *buf_addr,
                                       size_t subbuf_size, size_t num_subbuf,
                                       unsigned int switch_timer_interval,
                                       unsigned int read_timer_interval);
 
-void lttng_metadata_channel_destroy(struct lttng_channel *chan);
-struct lttng_kernel_event_recorder *lttng_kernel_event_recorder_create(struct lttng_channel *chan,
-                               struct lttng_kernel_abi_event *event_param,
-                               const struct lttng_kernel_event_desc *event_desc,
-                               enum lttng_kernel_abi_instrumentation itype);
-struct lttng_kernel_event_recorder *_lttng_kernel_event_recorder_create(struct lttng_channel *chan,
-                               struct lttng_kernel_abi_event *event_param,
-                               const struct lttng_kernel_event_desc *event_desc,
-                               enum lttng_kernel_abi_instrumentation itype);
-struct lttng_kernel_event_recorder *lttng_event_compat_old_create(struct lttng_channel *chan,
+void lttng_metadata_channel_destroy(struct lttng_kernel_channel_buffer *chan);
+struct lttng_kernel_event_recorder *lttng_kernel_event_recorder_create(struct lttng_event_recorder_enabler *event_enabler,
+                               const struct lttng_kernel_event_desc *event_desc);
+struct lttng_kernel_event_recorder *_lttng_kernel_event_recorder_create(struct lttng_event_recorder_enabler *event_enabler,
+                               const struct lttng_kernel_event_desc *event_desc);
+struct lttng_kernel_event_recorder *lttng_event_compat_old_create(struct lttng_kernel_channel_buffer *chan,
                struct lttng_kernel_abi_old_event *old_event_param,
                const struct lttng_kernel_event_desc *internal_desc);
 
@@ -997,8 +1065,8 @@ struct lttng_kernel_event_notifier *_lttng_event_notifier_create(
                                struct lttng_kernel_abi_event_notifier *event_notifier_param,
                                enum lttng_kernel_abi_instrumentation itype);
 
-int lttng_channel_enable(struct lttng_channel *channel);
-int lttng_channel_disable(struct lttng_channel *channel);
+int lttng_channel_enable(struct lttng_kernel_channel_common *channel);
+int lttng_channel_disable(struct lttng_kernel_channel_common *channel);
 int lttng_event_enable(struct lttng_kernel_event_common *event);
 int lttng_event_disable(struct lttng_kernel_event_common *event);
 
@@ -1020,20 +1088,24 @@ int lttng_probes_init(void);
 void lttng_probes_exit(void);
 
 int lttng_metadata_output_channel(struct lttng_metadata_stream *stream,
-               struct channel *chan, bool *coherent);
+               struct lttng_kernel_ring_buffer_channel *chan, bool *coherent);
 
 int lttng_id_tracker_get_node_id(const struct lttng_id_hash_node *node);
-int lttng_id_tracker_empty_set(struct lttng_id_tracker *lf);
-void lttng_id_tracker_destroy(struct lttng_id_tracker *lf, bool rcu);
-int lttng_id_tracker_add(struct lttng_id_tracker *lf, int id);
-int lttng_id_tracker_del(struct lttng_id_tracker *lf, int id);
-
-int lttng_session_track_id(struct lttng_session *session,
+int lttng_id_tracker_empty_set(struct lttng_kernel_id_tracker *lf);
+int lttng_id_tracker_init(struct lttng_kernel_id_tracker *lf,
+               struct lttng_kernel_session *session,
+               enum tracker_type type);
+void lttng_id_tracker_fini(struct lttng_kernel_id_tracker *lf);
+void lttng_id_tracker_destroy(struct lttng_kernel_id_tracker *lf, bool rcu);
+int lttng_id_tracker_add(struct lttng_kernel_id_tracker *lf, int id);
+int lttng_id_tracker_del(struct lttng_kernel_id_tracker *lf, int id);
+
+int lttng_session_track_id(struct lttng_kernel_session *session,
                enum tracker_type tracker_type, int id);
-int lttng_session_untrack_id(struct lttng_session *session,
+int lttng_session_untrack_id(struct lttng_kernel_session *session,
                enum tracker_type tracker_type, int id);
 
-int lttng_session_list_tracker_ids(struct lttng_session *session,
+int lttng_session_list_tracker_ids(struct lttng_kernel_session *session,
                enum tracker_type tracker_type);
 
 void lttng_clock_ref(void);
@@ -1046,7 +1118,7 @@ int lttng_probes_init(void);
 int lttng_logger_init(void);
 void lttng_logger_exit(void);
 
-extern int lttng_statedump_start(struct lttng_session *session);
+extern int lttng_statedump_start(struct lttng_kernel_session *session);
 
 int lttng_calibrate(struct lttng_kernel_abi_calibrate *calibrate);
 
This page took 0.031865 seconds and 4 git commands to generate.