Refactoring: struct lttng_channel
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 6 May 2021 18:07:56 +0000 (14:07 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 6 May 2021 20:44:47 +0000 (16:44 -0400)
Split lttng_channel into public/private structures, and introduce
inheritance for common fields which will be shared between the channel
buffer and upcoming channel counter.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I932231c4af9ed1066d010b5be4f75f34842e8484

50 files changed:
include/lttng/events-internal.h
include/lttng/events.h
include/lttng/tracepoint-event-impl.h
include/lttng/tracer-core.h
src/lttng-abi.c
src/lttng-context-callstack-legacy-impl.h
src/lttng-context-callstack-stackwalk-impl.h
src/lttng-context-cgroup-ns.c
src/lttng-context-cpu-id.c
src/lttng-context-egid.c
src/lttng-context-euid.c
src/lttng-context-gid.c
src/lttng-context-hostname.c
src/lttng-context-interruptible.c
src/lttng-context-ipc-ns.c
src/lttng-context-migratable.c
src/lttng-context-mnt-ns.c
src/lttng-context-need-reschedule.c
src/lttng-context-net-ns.c
src/lttng-context-nice.c
src/lttng-context-perf-counters.c
src/lttng-context-pid-ns.c
src/lttng-context-pid.c
src/lttng-context-ppid.c
src/lttng-context-preemptible.c
src/lttng-context-prio.c
src/lttng-context-procname.c
src/lttng-context-sgid.c
src/lttng-context-suid.c
src/lttng-context-tid.c
src/lttng-context-time-ns.c
src/lttng-context-uid.c
src/lttng-context-user-ns.c
src/lttng-context-uts-ns.c
src/lttng-context-vegid.c
src/lttng-context-veuid.c
src/lttng-context-vgid.c
src/lttng-context-vpid.c
src/lttng-context-vppid.c
src/lttng-context-vsgid.c
src/lttng-context-vsuid.c
src/lttng-context-vtid.c
src/lttng-context-vuid.c
src/lttng-events.c
src/lttng-ring-buffer-client.h
src/lttng-ring-buffer-metadata-client.h
src/lttng-syscalls.c
src/probes/lttng-kprobes.c
src/probes/lttng-kretprobes.c
src/probes/lttng-uprobes.c

index defea8405e255d6ca838882e966377ffeb7d8035..1108cf273ce342b7ec4d74658304d768b2e5f238 100644 (file)
@@ -21,6 +21,11 @@ enum lttng_enabler_format_type {
        LTTNG_ENABLER_FORMAT_NAME,
 };
 
+enum channel_type {
+       PER_CPU_CHANNEL,
+       METADATA_CHANNEL,
+};
+
 /*
  * Objects in a linked-list of enablers, owned by an event.
  */
@@ -112,6 +117,44 @@ struct lttng_kernel_event_notifier_private {
 
 };
 
+struct lttng_kernel_channel_common_private {
+       struct lttng_kernel_channel_common *pub;
+
+       struct file *file;                      /* File associated to channel */
+       unsigned int sys_enter_registered:1,
+               sys_exit_registered:1,
+               tstate:1;                       /* Transient enable state */
+
+       struct hlist_head *sc_table;            /* for syscall tracing */
+       struct hlist_head *compat_sc_table;
+       struct hlist_head *sc_exit_table;       /* for syscall exit tracing */
+       struct hlist_head *compat_sc_exit_table;
+       struct hlist_head sc_unknown;           /* for unknown syscalls */
+       struct hlist_head sc_compat_unknown;
+       struct hlist_head sc_exit_unknown;
+       struct hlist_head compat_sc_exit_unknown;
+       struct lttng_syscall_filter *sc_filter;
+       int syscall_all_entry;
+       int syscall_all_exit;
+};
+
+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 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,
@@ -177,7 +220,7 @@ struct lttng_enabler {
 struct lttng_event_enabler {
        struct lttng_enabler base;
        struct list_head node;  /* per-session list of enablers */
-       struct lttng_channel *chan;
+       struct lttng_kernel_channel_buffer *chan;
 };
 
 struct lttng_event_notifier_enabler {
@@ -223,7 +266,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);
@@ -729,7 +772,7 @@ int lttng_cpuhp_perf_counter_dead(unsigned int cpu,
 struct lttng_event_enabler *lttng_event_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);
 
 int lttng_event_enabler_enable(struct lttng_event_enabler *event_enabler);
 int lttng_event_enabler_disable(struct lttng_event_enabler *event_enabler);
@@ -762,16 +805,16 @@ void lttng_enabler_link_bytecode(const struct lttng_kernel_event_desc *event_des
 
 #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_syscalls_unregister_channel(struct lttng_kernel_channel_buffer *chan);
+int lttng_syscalls_destroy_event(struct lttng_kernel_channel_buffer *chan);
 int lttng_syscall_filter_enable_event(
-               struct lttng_channel *chan,
+               struct lttng_kernel_channel_buffer *chan,
                struct lttng_kernel_event_recorder *event);
 int lttng_syscall_filter_disable_event(
-               struct lttng_channel *chan,
+               struct lttng_kernel_channel_buffer *chan,
                struct lttng_kernel_event_recorder *event);
 
-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(
@@ -788,29 +831,29 @@ static inline int lttng_syscalls_register_event(
        return -ENOSYS;
 }
 
-static inline int lttng_syscalls_unregister_channel(struct lttng_channel *chan)
+static inline int lttng_syscalls_unregister_channel(struct lttng_kernel_channel_buffer *chan)
 {
        return 0;
 }
 
-static inline int lttng_syscalls_destroy(struct lttng_channel *chan)
+static inline int lttng_syscalls_destroy(struct lttng_kernel_channel_buffer *chan)
 {
        return 0;
 }
 
-static inline int lttng_syscall_filter_enable_event(struct lttng_channel *chan,
+static inline int lttng_syscall_filter_enable_event(struct lttng_kernel_channel_buffer *chan,
                struct lttng_kernel_event_recorder *event);
 {
        return -ENOSYS;
 }
 
-static inline int lttng_syscall_filter_disable_event(struct lttng_channel *chan,
+static inline int lttng_syscall_filter_disable_event(struct lttng_kernel_channel_buffer *chan,
                struct lttng_kernel_event_recorder *event);
 {
        return -ENOSYS;
 }
 
-static inline long lttng_channel_syscall_mask(struct lttng_channel *channel,
+static inline long lttng_channel_syscall_mask(struct lttng_kernel_channel_buffer *channel,
                struct lttng_kernel_syscall_mask __user *usyscall_mask)
 {
        return -ENOSYS;
@@ -1033,29 +1076,29 @@ 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_kernel_session *session,
+struct lttng_kernel_channel_buffer *lttng_channel_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_kernel_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,
+void lttng_metadata_channel_destroy(struct lttng_kernel_channel_buffer *chan);
+struct lttng_kernel_event_recorder *lttng_kernel_event_recorder_create(struct lttng_kernel_channel_buffer *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_event_recorder *_lttng_kernel_event_recorder_create(struct lttng_kernel_channel_buffer *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,
+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);
 
@@ -1074,8 +1117,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_buffer *channel);
+int lttng_channel_disable(struct lttng_kernel_channel_buffer *channel);
 int lttng_event_enable(struct lttng_kernel_event_common *event);
 int lttng_event_disable(struct lttng_kernel_event_common *event);
 
index 09b4c6724833a41479bd97bbe218b0fd64e715a3..1eda3aca197fa5c69c197f09616e50198572a65a 100644 (file)
@@ -25,7 +25,7 @@
 
 #define lttng_is_signed_type(type)     (((type) -1) < (type) 1)
 
-struct lttng_channel;
+struct lttng_kernel_channel_buffer;
 struct lttng_kernel_session;
 struct lttng_kernel_ring_buffer_ctx;
 
@@ -49,11 +49,6 @@ enum lttng_kernel_string_encoding {
        NR_LTTNG_KERNEL_STRING_ENCODING,
 };
 
-enum channel_type {
-       PER_CPU_CHANNEL,
-       METADATA_CHANNEL,
-};
-
 struct lttng_kernel_enum_value {
        unsigned long long value;
        unsigned int signedness:1;
@@ -362,7 +357,7 @@ struct lttng_kernel_event_recorder {
        struct lttng_kernel_event_common parent;
        struct lttng_kernel_event_recorder_private *priv;       /* Private event record interface */
 
-       struct lttng_channel *chan;
+       struct lttng_kernel_channel_buffer *chan;
 };
 
 struct lttng_kernel_notification_ctx {
@@ -397,37 +392,32 @@ struct lttng_kernel_channel_buffer_ops {
                             size_t len);
        void (*event_strcpy_from_user)(struct lttng_kernel_ring_buffer_ctx *ctx,
                                       const char __user *src, size_t len);
+       void (*lost_event_too_big)(struct lttng_kernel_channel_buffer *lttng_channel);
+};
+
+enum lttng_kernel_channel_type {
+       LTTNG_KERNEL_CHANNEL_TYPE_BUFFER = 0,
 };
 
-struct lttng_channel {
-       unsigned int id;
-       struct channel *chan;           /* Channel buffers */
+struct lttng_kernel_channel_common_private;
+
+/* Use container_of() to get child. */
+struct lttng_kernel_channel_common {
+       struct lttng_kernel_channel_common_private *priv;       /* Private channel interface. */
+
+       enum lttng_kernel_channel_type type;
+
        int enabled;
-       struct lttng_kernel_ctx *ctx;
-       /* Event ID management */
        struct lttng_kernel_session *session;
-       struct file *file;              /* File associated to channel */
-       unsigned int free_event_id;     /* Next event ID to allocate */
-       struct list_head list;          /* Channel list */
+};
+
+struct lttng_kernel_channel_buffer_private;
+
+struct lttng_kernel_channel_buffer {
+       struct lttng_kernel_channel_common parent;
+       struct lttng_kernel_channel_buffer_private *priv;
+
        struct lttng_kernel_channel_buffer_ops *ops;
-       struct lttng_transport *transport;
-       struct hlist_head *sc_table;    /* for syscall tracing */
-       struct hlist_head *compat_sc_table;
-       struct hlist_head *sc_exit_table;       /* for syscall exit tracing */
-       struct hlist_head *compat_sc_exit_table;
-       struct hlist_head sc_unknown;   /* for unknown syscalls */
-       struct hlist_head sc_compat_unknown;
-       struct hlist_head sc_exit_unknown;
-       struct hlist_head compat_sc_exit_unknown;
-       struct lttng_syscall_filter *sc_filter;
-       int header_type;                /* 0: unset, 1: compact, 2: large */
-       enum channel_type channel_type;
-       int syscall_all_entry;
-       int syscall_all_exit;
-       unsigned int metadata_dumped:1,
-               sys_enter_registered:1,
-               sys_exit_registered:1,
-               tstate:1;               /* Transient enable state */
 };
 
 #define LTTNG_DYNAMIC_LEN_STACK_SIZE   128
index 35b0059b1739ef11968de2b0adc093d632a9a287..fdc3d5cf13be5c5ed430e1740c7034b14bfd606a 100644 (file)
@@ -1074,15 +1074,15 @@ static void __event_probe__##_name(_data_proto)                                         \
        {                                                                               \
                struct lttng_kernel_event_recorder *__event_recorder =                  \
                        container_of(__event, struct lttng_kernel_event_recorder, parent); \
-               struct lttng_channel *__chan = __event_recorder->chan;                  \
-               struct lttng_kernel_session *__session = __chan->session;               \
+               struct lttng_kernel_channel_buffer *__chan = __event_recorder->chan;    \
+               struct lttng_kernel_session *__session = __chan->parent.session;        \
                struct lttng_kernel_id_tracker_rcu *__lf;                               \
                                                                                        \
                if (!_TP_SESSION_CHECK(session, __session))                             \
                        return;                                                         \
                if (unlikely(!LTTNG_READ_ONCE(__session->active)))                      \
                        return;                                                         \
-               if (unlikely(!LTTNG_READ_ONCE(__chan->enabled)))                        \
+               if (unlikely(!LTTNG_READ_ONCE(__chan->parent.enabled)))                 \
                        return;                                                         \
                __lf = lttng_rcu_dereference(__session->pid_tracker.p);                 \
                if (__lf && likely(!lttng_id_tracker_lookup(__lf, current->tgid)))      \
@@ -1131,7 +1131,7 @@ static void __event_probe__##_name(_data_proto)                                           \
        {                                                                               \
                struct lttng_kernel_event_recorder *__event_recorder =                  \
                        container_of(__event, struct lttng_kernel_event_recorder, parent); \
-               struct lttng_channel *__chan = __event_recorder->chan;                  \
+               struct lttng_kernel_channel_buffer *__chan = __event_recorder->chan;    \
                struct lttng_kernel_ring_buffer_ctx __ctx;                              \
                ssize_t __event_len;                                                    \
                size_t __event_align;                                                   \
@@ -1139,7 +1139,7 @@ static void __event_probe__##_name(_data_proto)                                           \
                                                                                        \
                __event_len = __event_get_size__##_name(_locvar_args);                  \
                if (unlikely(__event_len < 0)) {                                        \
-                       lib_ring_buffer_lost_event_too_big(__chan->chan);               \
+                       __chan->ops->lost_event_too_big(__chan);                        \
                        goto __post;                                                    \
                }                                                                       \
                __event_align = __event_get_align__##_name(_locvar_args);               \
index e04f5a721845051765b0e1919229b9d3e97387f0..32ff442ca59ff458225d6bf049b66908a6ebb045 100644 (file)
@@ -22,7 +22,5 @@
 #include <ringbuffer/config.h>
 
 struct lttng_kernel_session;
-struct lttng_channel;
-struct lttng_event;
 
 #endif /* LTTNG_TRACER_CORE_H */
index aa1b0195eff6515ddee759871cc3fd4e25ee2f51..a78f2e332f34ef0434225380fbc77eed595cb881 100644 (file)
@@ -491,7 +491,7 @@ int lttng_abi_create_channel(struct file *session_file,
        struct lttng_kernel_session *session = session_file->private_data;
        const struct file_operations *fops = NULL;
        const char *transport_name;
-       struct lttng_channel *chan;
+       struct lttng_kernel_channel_buffer *chan;
        struct file *chan_file;
        int chan_fd;
        int ret = 0;
@@ -559,7 +559,7 @@ int lttng_abi_create_channel(struct file *session_file,
                ret = -EINVAL;
                goto chan_error;
        }
-       chan->file = chan_file;
+       chan->priv->parent.file = chan_file;
        chan_file->private_data = chan;
        fd_install(chan_fd, chan_file);
 
@@ -1627,12 +1627,12 @@ fd_error:
 static
 int lttng_abi_open_stream(struct file *channel_file)
 {
-       struct lttng_channel *channel = channel_file->private_data;
+       struct lttng_kernel_channel_buffer *channel = channel_file->private_data;
        struct lib_ring_buffer *buf;
        int ret;
        void *stream_priv;
 
-       buf = channel->ops->priv->buffer_read_open(channel->chan);
+       buf = channel->ops->priv->buffer_read_open(channel->priv->rb_chan);
        if (!buf)
                return -ENOENT;
 
@@ -1653,14 +1653,14 @@ fd_error:
 static
 int lttng_abi_open_metadata_stream(struct file *channel_file)
 {
-       struct lttng_channel *channel = channel_file->private_data;
-       struct lttng_kernel_session *session = channel->session;
+       struct lttng_kernel_channel_buffer *channel = channel_file->private_data;
+       struct lttng_kernel_session *session = channel->parent.session;
        struct lib_ring_buffer *buf;
        int ret;
        struct lttng_metadata_stream *metadata_stream;
        void *stream_priv;
 
-       buf = channel->ops->priv->buffer_read_open(channel->chan);
+       buf = channel->ops->priv->buffer_read_open(channel->priv->rb_chan);
        if (!buf)
                return -ENOENT;
 
@@ -1674,7 +1674,7 @@ int lttng_abi_open_metadata_stream(struct file *channel_file)
        init_waitqueue_head(&metadata_stream->read_wait);
        metadata_stream->priv = buf;
        stream_priv = metadata_stream;
-       metadata_stream->transport = channel->transport;
+       metadata_stream->transport = channel->priv->transport;
        /* Initial state is an empty metadata, considered as incoherent. */
        metadata_stream->coherent = false;
 
@@ -1808,7 +1808,7 @@ int lttng_abi_create_event(struct file *channel_file,
                           struct lttng_kernel_abi_event *event_param)
 {
        const struct file_operations *fops;
-       struct lttng_channel *channel = channel_file->private_data;
+       struct lttng_kernel_channel_buffer *channel = channel_file->private_data;
        int event_fd, ret;
        struct file *event_file;
        void *priv;
@@ -2342,7 +2342,7 @@ static const struct file_operations lttng_event_notifier_group_fops = {
 static
 long lttng_channel_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 {
-       struct lttng_channel *channel = file->private_data;
+       struct lttng_kernel_channel_buffer *channel = file->private_data;
 
        switch (cmd) {
        case LTTNG_KERNEL_ABI_OLD_STREAM:
@@ -2465,7 +2465,7 @@ old_event_end:
 
                ret = lttng_abi_add_context(file,
                                ucontext_param,
-                               &channel->ctx, channel->session);
+                               &channel->priv->ctx, channel->parent.session);
 
 old_ctx_error_free_old_param:
                kfree(old_ucontext_param);
@@ -2484,7 +2484,7 @@ old_ctx_end:
                        return -EFAULT;
                return lttng_abi_add_context(file,
                                &ucontext_param,
-                               &channel->ctx, channel->session);
+                               &channel->priv->ctx, channel->parent.session);
        }
        case LTTNG_KERNEL_ABI_OLD_ENABLE:
        case LTTNG_KERNEL_ABI_ENABLE:
@@ -2533,19 +2533,19 @@ long lttng_metadata_ioctl(struct file *file, unsigned int cmd, unsigned long arg
  */
 unsigned int lttng_channel_poll(struct file *file, poll_table *wait)
 {
-       struct lttng_channel *channel = file->private_data;
+       struct lttng_kernel_channel_buffer *channel = file->private_data;
        unsigned int mask = 0;
 
        if (file->f_mode & FMODE_READ) {
                poll_wait_set_exclusive(wait);
-               poll_wait(file, channel->ops->priv->get_hp_wait_queue(channel->chan),
+               poll_wait(file, channel->ops->priv->get_hp_wait_queue(channel->priv->rb_chan),
                          wait);
 
-               if (channel->ops->priv->is_disabled(channel->chan))
+               if (channel->ops->priv->is_disabled(channel->priv->rb_chan))
                        return POLLERR;
-               if (channel->ops->priv->is_finalized(channel->chan))
+               if (channel->ops->priv->is_finalized(channel->priv->rb_chan))
                        return POLLHUP;
-               if (channel->ops->priv->buffer_has_read_closed_stream(channel->chan))
+               if (channel->ops->priv->buffer_has_read_closed_stream(channel->priv->rb_chan))
                        return POLLIN | POLLRDNORM;
                return 0;
        }
@@ -2556,20 +2556,20 @@ unsigned int lttng_channel_poll(struct file *file, poll_table *wait)
 static
 int lttng_channel_release(struct inode *inode, struct file *file)
 {
-       struct lttng_channel *channel = file->private_data;
+       struct lttng_kernel_channel_buffer *channel = file->private_data;
 
        if (channel)
-               fput(channel->session->priv->file);
+               fput(channel->parent.session->priv->file);
        return 0;
 }
 
 static
 int lttng_metadata_channel_release(struct inode *inode, struct file *file)
 {
-       struct lttng_channel *channel = file->private_data;
+       struct lttng_kernel_channel_buffer *channel = file->private_data;
 
        if (channel) {
-               fput(channel->session->priv->file);
+               fput(channel->parent.session->priv->file);
                lttng_metadata_channel_destroy(channel);
        }
 
@@ -2696,7 +2696,7 @@ int lttng_event_recorder_event_release(struct inode *inode, struct file *file)
        struct lttng_kernel_event_recorder *event = file->private_data;
 
        if (event)
-               fput(event->chan->file);
+               fput(event->chan->priv->parent.file);
        return 0;
 }
 
@@ -2706,7 +2706,7 @@ int lttng_event_recorder_enabler_release(struct inode *inode, struct file *file)
        struct lttng_event_enabler *event_enabler = file->private_data;
 
        if (event_enabler)
-               fput(event_enabler->chan->file);
+               fput(event_enabler->chan->priv->parent.file);
        return 0;
 }
 
index 0e59aa6d70b63657407f0269312d3c6bb8dc6e05..03409291b9084fe8ae53a069254ddda03bfea052 100644 (file)
@@ -190,7 +190,7 @@ size_t lttng_callstack_sequence_get_size(void *priv, struct lttng_kernel_probe_c
 static
 void lttng_callstack_length_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)
 {
        int cpu = ctx->priv.reserve_cpu;
        struct field_data *fdata = (struct field_data *) priv;
@@ -210,7 +210,7 @@ void lttng_callstack_length_record(void *priv, struct lttng_kernel_probe_ctx *pr
 static
 void lttng_callstack_sequence_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)
 {
        int cpu = ctx->priv.reserve_cpu;
        struct field_data *fdata = (struct field_data *) priv;
index d3a57d86c110e7a67b37958208320f31458e3d7c..2452804dfe019d274d9a6c140f9070cf870ce32d 100644 (file)
@@ -195,7 +195,7 @@ size_t lttng_callstack_sequence_get_size(void *priv, struct lttng_kernel_probe_c
 static
 void lttng_callstack_length_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)
 {
        int cpu = ctx->priv.reserve_cpu;
        struct field_data *fdata = (struct field_data *) priv;
@@ -216,7 +216,7 @@ void lttng_callstack_length_record(void *priv, struct lttng_kernel_probe_ctx *pr
 static
 void lttng_callstack_sequence_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)
 {
        int cpu = ctx->priv.reserve_cpu;
        struct field_data *fdata = (struct field_data *) priv;
index 3588d9cd1e8344a4cb47fba6b168891ab1dab86b..6cab3153630cd4b613b629e4f9e4374adf8cf7af 100644 (file)
@@ -37,7 +37,7 @@ size_t cgroup_ns_get_size(void *priv, struct lttng_kernel_probe_ctx *probe_ctx,
 static
 void cgroup_ns_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)
 {
        unsigned int cgroup_ns_inum = 0;
 
index 467aef95bb9165a2e87ecddd4a089deef686b7d6..24241dee7f511b5ecdd47f4b7682f4daf7e20d08 100644 (file)
@@ -29,7 +29,7 @@ size_t cpu_id_get_size(void *priv, struct lttng_kernel_probe_ctx *probe_ctx, siz
 static
 void cpu_id_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)
 {
        int cpu;
 
index 902a57014528f7711efb12dc7b0e2bb1aa6bae02..6eaa758e5fe43f0eff9636253c2eba0ab332b50d 100644 (file)
@@ -31,7 +31,7 @@ size_t egid_get_size(void *priv, struct lttng_kernel_probe_ctx *probe_ctx, size_
 static
 void egid_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)
 {
        gid_t egid;
 
index 6076a3161ffd9ef0889923dfa4e358ff153a31c8..90a6dd3c9271c6dbb0cfdd1d7a5bafd52ad39e33 100644 (file)
@@ -31,7 +31,7 @@ size_t euid_get_size(void *priv, struct lttng_kernel_probe_ctx *probe_ctx, size_
 static
 void euid_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)
 {
        uid_t euid;
 
index c1906e25ac998092171f41de997edab2d976dcf0..f00840794a6b590cd1c52ac4ace39c2b9c4ae65f 100644 (file)
@@ -31,7 +31,7 @@ size_t gid_get_size(void *priv, struct lttng_kernel_probe_ctx *probe_ctx, size_t
 static
 void gid_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)
 {
        gid_t gid;
 
index c34ed5cd1a6814a3da7c1d1ae886cea6a5085557..8956e540e1c8a0a01255c61d88203b9727ed9092 100644 (file)
@@ -31,7 +31,7 @@ size_t hostname_get_size(void *priv, struct lttng_kernel_probe_ctx *probe_ctx, s
 static
 void hostname_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)
 {
        struct nsproxy *nsproxy;
        struct uts_namespace *ns;
index 933b4d1fb4524a40e7068e0617e52f10092546c6..bf2589da197f10cdafd1426417ec0f3374dbb7cf 100644 (file)
@@ -34,7 +34,7 @@ size_t interruptible_get_size(void *priv, struct lttng_kernel_probe_ctx *probe_c
 static
 void interruptible_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)
 {
        struct lttng_kernel_probe_ctx *lttng_probe_ctx = ctx->probe_ctx;
        int8_t interruptible = lttng_probe_ctx->interruptible;
index 5a805f1e25e0223338d07addc9ad1076daf8539c..c578fea8b5b6d00322c65271d36260501d8956ef 100644 (file)
@@ -36,7 +36,7 @@ size_t ipc_ns_get_size(void *priv, struct lttng_kernel_probe_ctx *probe_ctx, siz
 static
 void ipc_ns_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)
 {
        unsigned int ipc_ns_inum = 0;
 
index ed5200ea4fd4017f8ef03ce6aabc12f2e4443c48..e2f6bfd97b0816ccc196e4ff07f9b51004ad7190 100644 (file)
@@ -30,7 +30,7 @@ size_t migratable_get_size(void *priv, struct lttng_kernel_probe_ctx *probe_ctx,
 static
 void migratable_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)
 {
        uint8_t migratable = !current->migrate_disable;
 
index b58a151efd881fdcbaae28bfd23106b25681016c..030a7f25419760af692aef8fd5805f3c0d925b57 100644 (file)
@@ -38,7 +38,7 @@ size_t mnt_ns_get_size(void *priv, struct lttng_kernel_probe_ctx *probe_ctx, siz
 static
 void mnt_ns_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)
 {
        unsigned int mnt_ns_inum = 0;
 
index 0ceb6a5d2d6cd877be26c0c92f6fea4bd34cb52b..42cf11db03992db5694c6c038fcb81464a152004 100644 (file)
@@ -30,7 +30,7 @@ size_t need_reschedule_get_size(void *priv, struct lttng_kernel_probe_ctx *probe
 static
 void need_reschedule_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)
 {
        uint8_t need_reschedule = test_tsk_need_resched(current);
 
index 54c28e0fc17a601e9ee302178ac702bdbe919823..1262178b096d1e394304c36fa0cae85b5c4e8eea 100644 (file)
@@ -37,7 +37,7 @@ size_t net_ns_get_size(void *priv, struct lttng_kernel_probe_ctx *probe_ctx, siz
 static
 void net_ns_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)
 {
        unsigned int net_ns_inum = 0;
 
index fb698648521dea55ed9bdfe8ebb14ff813d7e536..a6847705adca8ca47074174200d2908ff6951bba 100644 (file)
@@ -29,7 +29,7 @@ size_t nice_get_size(void *priv, struct lttng_kernel_probe_ctx *probe_ctx, size_
 static
 void nice_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)
 {
        int nice;
 
index 72e920afbba137fa138caa4a1b5ae9e5bb6bbc28..0b466363235b2a91e307645dbd1b2cef107e9419 100644 (file)
@@ -33,7 +33,7 @@ size_t perf_counter_get_size(void *priv, struct lttng_kernel_probe_ctx *probe_ct
 static
 void perf_counter_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)
 {
        struct lttng_perf_counter_field *perf_field = (struct lttng_perf_counter_field *) priv;
        struct perf_event *event;
index 4c5a3e1996481a65eb5026fcab71c42588ecea6c..f99fec9afe5e8a3f8b49e2b8aa82cc9ac16599a8 100644 (file)
@@ -36,7 +36,7 @@ size_t pid_ns_get_size(void *priv, struct lttng_kernel_probe_ctx *probe_ctx, siz
 static
 void pid_ns_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)
 {
        struct pid_namespace *ns;
        unsigned int pid_ns_inum = 0;
index 5f5a65a79f19ce6117d849ba6ff810359f41b771..5bf9dfd147f4f643cf429bb37bc64560747971d4 100644 (file)
@@ -29,7 +29,7 @@ size_t pid_get_size(void *priv, struct lttng_kernel_probe_ctx *probe_ctx, size_t
 static
 void pid_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)
 {
        pid_t pid;
 
index 93cbc03c53e75a7f6b71b225473af383437eb274..8d359390a6d2736f1b51481dff41d1cb935567ea 100644 (file)
@@ -30,7 +30,7 @@ size_t ppid_get_size(void *priv, struct lttng_kernel_probe_ctx *probe_ctx, size_
 static
 void ppid_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)
 {
        pid_t ppid;
 
index ac9aab5932e49ff6c59f09799ed643043e9cb99e..548e79f43cf7a9a36d6cb25de6eb154c5c5acba3 100644 (file)
@@ -38,7 +38,7 @@ size_t preemptible_get_size(void *priv, struct lttng_kernel_probe_ctx *probe_ctx
 static
 void preemptible_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)
 {
        int pc = preempt_count();
        uint8_t preemptible = 0;
index 97c0672c5f566b0b675625c323748a1f62bfbca3..27a0ab8a5e8267a73af664b394c22acb4cff7505 100644 (file)
@@ -56,7 +56,7 @@ size_t prio_get_size(void *priv, struct lttng_kernel_probe_ctx *probe_ctx, size_
 static
 void prio_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)
 {
        int prio;
 
index e2517bc665aafa9e0ccb6fd6cc083c7f29e0c2f3..aaefef845f41ec82454f27eaadea51971b609ad9 100644 (file)
@@ -35,7 +35,7 @@ size_t procname_get_size(void *priv, struct lttng_kernel_probe_ctx *probe_ctx, s
 static
 void procname_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)
 {
        chan->ops->event_write(ctx, current->comm, sizeof(current->comm));
 }
index 23c594f0b73e7bad803aea1101f13c24cbab8d42..bffe9308226d8453da92b8d21bad91230335d5b2 100644 (file)
@@ -31,7 +31,7 @@ size_t sgid_get_size(void *priv, struct lttng_kernel_probe_ctx *probe_ctx, size_
 static
 void sgid_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)
 {
        gid_t sgid;
 
index 4d9b5af34ff74d07cfef20396cede5b69baa1d06..37ef7c3b2bff8e8aa1ca49add0b66909a7dc7e29 100644 (file)
@@ -31,7 +31,7 @@ size_t suid_get_size(void *priv, struct lttng_kernel_probe_ctx *probe_ctx, size_
 static
 void suid_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)
 {
        uid_t suid;
 
index 9438cb63e6d5574a7ae9d970b9a8bafcea585bf9..538a2a58f6a8f3bffdef9de6861d8ab259e033d5 100644 (file)
@@ -29,7 +29,7 @@ size_t tid_get_size(void *priv, struct lttng_kernel_probe_ctx *probe_ctx, size_t
 static
 void tid_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)
 {
        pid_t tid;
 
index e6300b5243eed293dcbe8590db6e05e69276b6c2..72f0f1c46b182b3e2fc2d1f2c15762dbdd7a869c 100644 (file)
@@ -36,7 +36,7 @@ size_t time_ns_get_size(void *priv, struct lttng_kernel_probe_ctx *probe_ctx, si
 static
 void time_ns_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)
 {
        unsigned int time_ns_inum = 0;
 
index 434f7199ae6e24bdf0da86e287434e82330bf90a..0bdc2ece41df3622f79dca3ee56be9227232af12 100644 (file)
@@ -31,7 +31,7 @@ size_t uid_get_size(void *priv, struct lttng_kernel_probe_ctx *probe_ctx, size_t
 static
 void uid_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)
 {
        uid_t uid;
 
index ae674667248c2129a6f139e1f061a2b94c0c171a..b497754b9ef13ac10cf8637b36d1ae3aef258259 100644 (file)
@@ -36,7 +36,7 @@ size_t user_ns_get_size(void *priv, struct lttng_kernel_probe_ctx *probe_ctx, si
 static
 void user_ns_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)
 {
        unsigned int user_ns_inum = 0;
 
index 35c4aded39cd10be8af2eb20161bc76d4fb2c613..afa61ab9ed5a268235fc553120b3a200572b2ca7 100644 (file)
@@ -36,7 +36,7 @@ size_t uts_ns_get_size(void *priv, struct lttng_kernel_probe_ctx *probe_ctx, siz
 static
 void uts_ns_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)
 {
        unsigned int uts_ns_inum = 0;
 
index 9c0108241192e79cc567756a363ad9acb96e8671..9abd29b8e85ecf4c70d48c7b139ad028cace7d75 100644 (file)
@@ -31,7 +31,7 @@ size_t vegid_get_size(void *priv, struct lttng_kernel_probe_ctx *probe_ctx, size
 static
 void vegid_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)
 {
        gid_t vegid;
 
index 775c078b429ac7d50881772bd4b4ea76a2ff227f..9113578e2bd76f855d59925f8a5af0e030972491 100644 (file)
@@ -31,7 +31,7 @@ size_t veuid_get_size(void *priv, struct lttng_kernel_probe_ctx *probe_ctx, size
 static
 void veuid_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)
 {
        uid_t veuid;
 
index 689f2708f34cbc3ca94acdeb32a155e64f7cd1e6..0b7516e233b2a214196442ab56a07940bba41f23 100644 (file)
@@ -31,7 +31,7 @@ size_t vgid_get_size(void *priv, struct lttng_kernel_probe_ctx *probe_ctx, size_
 static
 void vgid_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)
 {
        gid_t vgid;
 
index 6a01e431bbf2a6c006ee3335624fa4b003c6cb2b..f631f6e00e28bc96eb7af4b9bafca6ff957b63c2 100644 (file)
@@ -29,7 +29,7 @@ size_t vpid_get_size(void *priv, struct lttng_kernel_probe_ctx *probe_ctx, size_
 static
 void vpid_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)
 {
        pid_t vpid;
 
index 4d61fef0351098d25bca4729012269a3fbaf421f..d682364314e8b6f7b60e3acb20df2d9eed941147 100644 (file)
@@ -30,7 +30,7 @@ size_t vppid_get_size(void *priv, struct lttng_kernel_probe_ctx *probe_ctx, size
 static
 void vppid_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)
 {
        struct task_struct *parent;
        pid_t vppid;
index eb051f27a2763baa684a44112219370230fe4ddd..09c5c139af1756c569148ca16ea12d29b2aac20c 100644 (file)
@@ -31,7 +31,7 @@ size_t vsgid_get_size(void *priv, struct lttng_kernel_probe_ctx *probe_ctx, size
 static
 void vsgid_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)
 {
        gid_t vsgid;
 
index 8210e8f8026f445365cb5f13c0ac39c0bb09c600..0f7489837b8cfa2990cbaf7e509017339864cefc 100644 (file)
@@ -31,7 +31,7 @@ size_t vsuid_get_size(void *priv, struct lttng_kernel_probe_ctx *probe_ctx, size
 static
 void vsuid_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)
 {
        uid_t vsuid;
 
index 17c4bf6feb8da17a11ef231d3137f9800e051f03..f42734630ac9182b173740f71b7a6ccfb96c230d 100644 (file)
@@ -29,7 +29,7 @@ size_t vtid_get_size(void *priv, struct lttng_kernel_probe_ctx *probe_ctx, size_
 static
 void vtid_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)
 {
        pid_t vtid;
 
index 2330991a050f26be90ec330c17c1fd022eca3796..817800e4dbd83d959b7799358518cce678474f62 100644 (file)
@@ -31,7 +31,7 @@ size_t vuid_get_size(void *priv, struct lttng_kernel_probe_ctx *probe_ctx, size_
 static
 void vuid_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)
 {
        uid_t vuid;
 
index 78e50c87c67e015b1df7474cc282524be0a1a2f8..999080bc490f54be1b129094e32aa909b63fac85 100644 (file)
@@ -70,12 +70,12 @@ static void lttng_event_notifier_enabler_destroy(struct lttng_event_notifier_ena
 static void lttng_event_notifier_group_sync_enablers(struct lttng_event_notifier_group *event_notifier_group);
 
 static void _lttng_event_destroy(struct lttng_kernel_event_common *event);
-static void _lttng_channel_destroy(struct lttng_channel *chan);
+static void _lttng_channel_destroy(struct lttng_kernel_channel_buffer *chan);
 static int _lttng_event_unregister(struct lttng_kernel_event_recorder *event);
 static int _lttng_event_notifier_unregister(struct lttng_kernel_event_notifier *event_notifier);
 static
 int _lttng_event_metadata_statedump(struct lttng_kernel_session *session,
-                                 struct lttng_channel *chan,
+                                 struct lttng_kernel_channel_buffer *chan,
                                  struct lttng_kernel_event_recorder *event);
 static
 int _lttng_session_metadata_statedump(struct lttng_kernel_session *session);
@@ -350,7 +350,7 @@ void metadata_cache_destroy(struct kref *kref)
 
 void lttng_session_destroy(struct lttng_kernel_session *session)
 {
-       struct lttng_channel *chan, *tmpchan;
+       struct lttng_kernel_channel_buffer_private *chan_priv, *tmpchan_priv;
        struct lttng_kernel_event_recorder_private *event_recorder_priv, *tmpevent_recorder_priv;
        struct lttng_metadata_stream *metadata_stream;
        struct lttng_event_enabler *event_enabler, *tmp_event_enabler;
@@ -358,8 +358,8 @@ void lttng_session_destroy(struct lttng_kernel_session *session)
 
        mutex_lock(&sessions_mutex);
        WRITE_ONCE(session->active, 0);
-       list_for_each_entry(chan, &session->priv->chan, list) {
-               ret = lttng_syscalls_unregister_channel(chan);
+       list_for_each_entry(chan_priv, &session->priv->chan, node) {
+               ret = lttng_syscalls_unregister_channel(chan_priv->pub);
                WARN_ON(ret);
        }
        list_for_each_entry(event_recorder_priv, &session->priv->events, node) {
@@ -367,8 +367,8 @@ void lttng_session_destroy(struct lttng_kernel_session *session)
                WARN_ON(ret);
        }
        synchronize_trace();    /* Wait for in-flight events to complete */
-       list_for_each_entry(chan, &session->priv->chan, list) {
-               ret = lttng_syscalls_destroy_event(chan);
+       list_for_each_entry(chan_priv, &session->priv->chan, node) {
+               ret = lttng_syscalls_destroy_event(chan_priv->pub);
                WARN_ON(ret);
        }
        list_for_each_entry_safe(event_enabler, tmp_event_enabler,
@@ -376,9 +376,9 @@ void lttng_session_destroy(struct lttng_kernel_session *session)
                lttng_event_enabler_destroy(event_enabler);
        list_for_each_entry_safe(event_recorder_priv, tmpevent_recorder_priv, &session->priv->events, node)
                _lttng_event_destroy(&event_recorder_priv->pub->parent);
-       list_for_each_entry_safe(chan, tmpchan, &session->priv->chan, list) {
-               BUG_ON(chan->channel_type == METADATA_CHANNEL);
-               _lttng_channel_destroy(chan);
+       list_for_each_entry_safe(chan_priv, tmpchan_priv, &session->priv->chan, node) {
+               BUG_ON(chan_priv->channel_type == METADATA_CHANNEL);
+               _lttng_channel_destroy(chan_priv->pub);
        }
        mutex_lock(&session->priv->metadata_cache->lock);
        list_for_each_entry(metadata_stream, &session->priv->metadata_cache->metadata_stream, list)
@@ -463,7 +463,7 @@ int lttng_session_statedump(struct lttng_kernel_session *session)
 int lttng_session_enable(struct lttng_kernel_session *session)
 {
        int ret = 0;
-       struct lttng_channel *chan;
+       struct lttng_kernel_channel_buffer_private *chan_priv;
 
        mutex_lock(&sessions_mutex);
        if (session->active) {
@@ -481,19 +481,19 @@ int lttng_session_enable(struct lttng_kernel_session *session)
         * Snapshot the number of events per channel to know the type of header
         * we need to use.
         */
-       list_for_each_entry(chan, &session->priv->chan, list) {
-               if (chan->header_type)
-                       continue;               /* don't change it if session stop/restart */
-               if (chan->free_event_id < 31)
-                       chan->header_type = 1;  /* compact */
+       list_for_each_entry(chan_priv, &session->priv->chan, node) {
+               if (chan_priv->header_type)
+                       continue;                       /* don't change it if session stop/restart */
+               if (chan_priv->free_event_id < 31)
+                       chan_priv->header_type = 1;     /* compact */
                else
-                       chan->header_type = 2;  /* large */
+                       chan_priv->header_type = 2;     /* large */
        }
 
        /* Clear each stream's quiescent state. */
-       list_for_each_entry(chan, &session->priv->chan, list) {
-               if (chan->channel_type != METADATA_CHANNEL)
-                       lib_ring_buffer_clear_quiescent_channel(chan->chan);
+       list_for_each_entry(chan_priv, &session->priv->chan, node) {
+               if (chan_priv->channel_type != METADATA_CHANNEL)
+                       lib_ring_buffer_clear_quiescent_channel(chan_priv->rb_chan);
        }
 
        WRITE_ONCE(session->active, 1);
@@ -514,7 +514,7 @@ end:
 int lttng_session_disable(struct lttng_kernel_session *session)
 {
        int ret = 0;
-       struct lttng_channel *chan;
+       struct lttng_kernel_channel_buffer_private *chan_priv;
 
        mutex_lock(&sessions_mutex);
        if (!session->active) {
@@ -528,9 +528,9 @@ int lttng_session_disable(struct lttng_kernel_session *session)
        lttng_session_sync_event_enablers(session);
 
        /* Set each stream's quiescent state. */
-       list_for_each_entry(chan, &session->priv->chan, list) {
-               if (chan->channel_type != METADATA_CHANNEL)
-                       lib_ring_buffer_set_quiescent_channel(chan->chan);
+       list_for_each_entry(chan_priv, &session->priv->chan, node) {
+               if (chan_priv->channel_type != METADATA_CHANNEL)
+                       lib_ring_buffer_set_quiescent_channel(chan_priv->rb_chan);
        }
 end:
        mutex_unlock(&sessions_mutex);
@@ -540,7 +540,7 @@ end:
 int lttng_session_metadata_regenerate(struct lttng_kernel_session *session)
 {
        int ret = 0;
-       struct lttng_channel *chan;
+       struct lttng_kernel_channel_buffer_private *chan_priv;
        struct lttng_kernel_event_recorder_private *event_recorder_priv;
        struct lttng_metadata_cache *cache = session->priv->metadata_cache;
        struct lttng_metadata_stream *stream;
@@ -562,8 +562,8 @@ int lttng_session_metadata_regenerate(struct lttng_kernel_session *session)
        mutex_unlock(&cache->lock);
 
        session->priv->metadata_dumped = 0;
-       list_for_each_entry(chan, &session->priv->chan, list) {
-               chan->metadata_dumped = 0;
+       list_for_each_entry(chan_priv, &session->priv->chan, node) {
+               chan_priv->metadata_dumped = 0;
        }
 
        list_for_each_entry(event_recorder_priv, &session->priv->events, node) {
@@ -577,47 +577,47 @@ end:
        return ret;
 }
 
-int lttng_channel_enable(struct lttng_channel *channel)
+int lttng_channel_enable(struct lttng_kernel_channel_buffer *channel)
 {
        int ret = 0;
 
        mutex_lock(&sessions_mutex);
-       if (channel->channel_type == METADATA_CHANNEL) {
+       if (channel->priv->channel_type == METADATA_CHANNEL) {
                ret = -EPERM;
                goto end;
        }
-       if (channel->enabled) {
+       if (channel->parent.enabled) {
                ret = -EEXIST;
                goto end;
        }
        /* Set transient enabler state to "enabled" */
-       channel->tstate = 1;
-       lttng_session_sync_event_enablers(channel->session);
+       channel->priv->parent.tstate = 1;
+       lttng_session_sync_event_enablers(channel->parent.session);
        /* Set atomically the state to "enabled" */
-       WRITE_ONCE(channel->enabled, 1);
+       WRITE_ONCE(channel->parent.enabled, 1);
 end:
        mutex_unlock(&sessions_mutex);
        return ret;
 }
 
-int lttng_channel_disable(struct lttng_channel *channel)
+int lttng_channel_disable(struct lttng_kernel_channel_buffer *channel)
 {
        int ret = 0;
 
        mutex_lock(&sessions_mutex);
-       if (channel->channel_type == METADATA_CHANNEL) {
+       if (channel->priv->channel_type == METADATA_CHANNEL) {
                ret = -EPERM;
                goto end;
        }
-       if (!channel->enabled) {
+       if (!channel->parent.enabled) {
                ret = -EEXIST;
                goto end;
        }
        /* Set atomically the state to "disabled" */
-       WRITE_ONCE(channel->enabled, 0);
+       WRITE_ONCE(channel->parent.enabled, 0);
        /* Set transient enabler state to "enabled" */
-       channel->tstate = 0;
-       lttng_session_sync_event_enablers(channel->session);
+       channel->priv->parent.tstate = 0;
+       lttng_session_sync_event_enablers(channel->parent.session);
 end:
        mutex_unlock(&sessions_mutex);
        return ret;
@@ -634,7 +634,7 @@ int lttng_event_enable(struct lttng_kernel_event_common *event)
                struct lttng_kernel_event_recorder *event_recorder =
                        container_of(event, struct lttng_kernel_event_recorder, parent);
 
-               if (event_recorder->chan->channel_type == METADATA_CHANNEL) {
+               if (event_recorder->chan->priv->channel_type == METADATA_CHANNEL) {
                        ret = -EPERM;
                        goto end;
                }
@@ -694,7 +694,7 @@ int lttng_event_disable(struct lttng_kernel_event_common *event)
                struct lttng_kernel_event_recorder *event_recorder =
                        container_of(event, struct lttng_kernel_event_recorder, parent);
 
-               if (event_recorder->chan->channel_type == METADATA_CHANNEL) {
+               if (event_recorder->chan->priv->channel_type == METADATA_CHANNEL) {
                        ret = -EPERM;
                        goto end;
                }
@@ -743,7 +743,7 @@ end:
        return ret;
 }
 
-struct lttng_channel *lttng_channel_create(struct lttng_kernel_session *session,
+struct lttng_kernel_channel_buffer *lttng_channel_create(struct lttng_kernel_session *session,
                                       const char *transport_name,
                                       void *buf_addr,
                                       size_t subbuf_size, size_t num_subbuf,
@@ -751,7 +751,8 @@ struct lttng_channel *lttng_channel_create(struct lttng_kernel_session *session,
                                       unsigned int read_timer_interval,
                                       enum channel_type channel_type)
 {
-       struct lttng_channel *chan;
+       struct lttng_kernel_channel_buffer *chan;
+       struct lttng_kernel_channel_buffer_private *chan_priv;
        struct lttng_transport *transport = NULL;
 
        mutex_lock(&sessions_mutex);
@@ -767,31 +768,39 @@ struct lttng_channel *lttng_channel_create(struct lttng_kernel_session *session,
                printk(KERN_WARNING "LTTng: Can't lock transport module.\n");
                goto notransport;
        }
-       chan = kzalloc(sizeof(struct lttng_channel), GFP_KERNEL);
+       chan = kzalloc(sizeof(struct lttng_kernel_channel_buffer), GFP_KERNEL);
        if (!chan)
                goto nomem;
-       chan->session = session;
-       chan->id = session->priv->free_chan_id++;
+       chan_priv = kzalloc(sizeof(struct lttng_kernel_channel_buffer_private), GFP_KERNEL);
+       if (!chan_priv)
+               goto nomem_priv;
+       chan->priv = chan_priv;
+       chan_priv->pub = chan;
+       chan->parent.type = LTTNG_KERNEL_CHANNEL_TYPE_BUFFER;
+       chan->parent.session = session;
+       chan->priv->id = session->priv->free_chan_id++;
        chan->ops = &transport->ops;
        /*
         * Note: the channel creation op already writes into the packet
         * headers. Therefore the "chan" information used as input
         * should be already accessible.
         */
-       chan->chan = transport->ops.priv->channel_create(transport_name,
+       chan->priv->rb_chan = transport->ops.priv->channel_create(transport_name,
                        chan, buf_addr, subbuf_size, num_subbuf,
                        switch_timer_interval, read_timer_interval);
-       if (!chan->chan)
+       if (!chan->priv->rb_chan)
                goto create_error;
-       chan->tstate = 1;
-       chan->enabled = 1;
-       chan->transport = transport;
-       chan->channel_type = channel_type;
-       list_add(&chan->list, &session->priv->chan);
+       chan->priv->parent.tstate = 1;
+       chan->parent.enabled = 1;
+       chan->priv->transport = transport;
+       chan->priv->channel_type = channel_type;
+       list_add(&chan->priv->node, &session->priv->chan);
        mutex_unlock(&sessions_mutex);
        return chan;
 
 create_error:
+       kfree(chan_priv);
+nomem_priv:
        kfree(chan);
 nomem:
        if (transport)
@@ -808,18 +817,19 @@ active:
  * Needs to be called with sessions mutex held.
  */
 static
-void _lttng_channel_destroy(struct lttng_channel *chan)
+void _lttng_channel_destroy(struct lttng_kernel_channel_buffer *chan)
 {
-       chan->ops->priv->channel_destroy(chan->chan);
-       module_put(chan->transport->owner);
-       list_del(&chan->list);
-       lttng_kernel_destroy_context(chan->ctx);
+       chan->ops->priv->channel_destroy(chan->priv->rb_chan);
+       module_put(chan->priv->transport->owner);
+       list_del(&chan->priv->node);
+       lttng_kernel_destroy_context(chan->priv->ctx);
+       kfree(chan->priv);
        kfree(chan);
 }
 
-void lttng_metadata_channel_destroy(struct lttng_channel *chan)
+void lttng_metadata_channel_destroy(struct lttng_kernel_channel_buffer *chan)
 {
-       BUG_ON(chan->channel_type != METADATA_CHANNEL);
+       BUG_ON(chan->priv->channel_type != METADATA_CHANNEL);
 
        /* Protect the metadata cache with the sessions_mutex. */
        mutex_lock(&sessions_mutex);
@@ -840,19 +850,19 @@ void _lttng_metadata_channel_hangup(struct lttng_metadata_stream *stream)
  * Supports event creation while tracing session is active.
  * Needs to be called with sessions mutex held.
  */
-struct lttng_kernel_event_recorder *_lttng_kernel_event_recorder_create(struct lttng_channel *chan,
+struct lttng_kernel_event_recorder *_lttng_kernel_event_recorder_create(struct lttng_kernel_channel_buffer *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_session *session = chan->session;
+       struct lttng_kernel_session *session = chan->parent.session;
        struct lttng_kernel_event_recorder *event_recorder;
        struct lttng_kernel_event_recorder_private *event_recorder_priv;
        const char *event_name;
        struct hlist_head *head;
        int ret;
 
-       if (chan->free_event_id == -1U) {
+       if (chan->priv->free_event_id == -1U) {
                ret = -EMFILE;
                goto full;
        }
@@ -907,7 +917,7 @@ struct lttng_kernel_event_recorder *_lttng_kernel_event_recorder_create(struct l
 
        event_recorder->parent.run_filter = lttng_kernel_interpret_event_filter;
        event_recorder->chan = chan;
-       event_recorder->priv->id = chan->free_event_id++;
+       event_recorder->priv->id = chan->priv->free_event_id++;
        event_recorder->priv->parent.instrumentation = itype;
        INIT_LIST_HEAD(&event_recorder->priv->parent.filter_bytecode_runtime_head);
        INIT_LIST_HEAD(&event_recorder->priv->parent.enablers_ref_head);
@@ -983,7 +993,7 @@ struct lttng_kernel_event_recorder *_lttng_kernel_event_recorder_create(struct l
 
                event_recorder_return->parent.run_filter = lttng_kernel_interpret_event_filter;
                event_recorder_return->chan = chan;
-               event_recorder_return->priv->id = chan->free_event_id++;
+               event_recorder_return->priv->id = chan->priv->free_event_id++;
                event_recorder_return->priv->parent.instrumentation = itype;
                event_recorder_return->parent.enabled = 0;
                event_recorder_return->priv->parent.registered = 1;
@@ -1009,7 +1019,7 @@ struct lttng_kernel_event_recorder *_lttng_kernel_event_recorder_create(struct l
                WARN_ON_ONCE(!ret);
                ret = try_module_get(event_recorder_return->priv->parent.desc->owner);
                WARN_ON_ONCE(!ret);
-               ret = _lttng_event_metadata_statedump(chan->session, chan,
+               ret = _lttng_event_metadata_statedump(chan->parent.session, chan,
                                                    event_recorder_return);
                WARN_ON_ONCE(ret > 0);
                if (ret) {
@@ -1019,7 +1029,7 @@ struct lttng_kernel_event_recorder *_lttng_kernel_event_recorder_create(struct l
                        module_put(event_recorder->priv->parent.desc->owner);
                        goto statedump_error;
                }
-               list_add(&event_recorder_return->priv->node, &chan->session->priv->events);
+               list_add(&event_recorder_return->priv->node, &chan->parent.session->priv->events);
                break;
        }
 
@@ -1089,13 +1099,13 @@ struct lttng_kernel_event_recorder *_lttng_kernel_event_recorder_create(struct l
                ret = -EINVAL;
                goto register_error;
        }
-       ret = _lttng_event_metadata_statedump(chan->session, chan, event_recorder);
+       ret = _lttng_event_metadata_statedump(chan->parent.session, chan, event_recorder);
        WARN_ON_ONCE(ret > 0);
        if (ret) {
                goto statedump_error;
        }
        hlist_add_head(&event_recorder->priv->hlist, head);
-       list_add(&event_recorder->priv->node, &chan->session->priv->events);
+       list_add(&event_recorder->priv->node, &chan->parent.session->priv->events);
        return event_recorder;
 
 statedump_error:
@@ -1360,7 +1370,7 @@ int lttng_kernel_counter_clear(struct lttng_counter *counter,
        return counter->ops->counter_clear(counter->counter, dim_indexes);
 }
 
-struct lttng_kernel_event_recorder *lttng_kernel_event_recorder_create(struct lttng_channel *chan,
+struct lttng_kernel_event_recorder *lttng_kernel_event_recorder_create(struct lttng_kernel_channel_buffer *chan,
                                struct lttng_kernel_abi_event *event_param,
                                const struct lttng_kernel_event_desc *event_desc,
                                enum lttng_kernel_abi_instrumentation itype)
@@ -2066,7 +2076,7 @@ struct lttng_enabler_ref *lttng_enabler_ref(
 static
 void lttng_create_tracepoint_event_if_missing(struct lttng_event_enabler *event_enabler)
 {
-       struct lttng_kernel_session *session = event_enabler->chan->session;
+       struct lttng_kernel_session *session = event_enabler->chan->parent.session;
        struct lttng_kernel_probe_desc *probe_desc;
        const struct lttng_kernel_event_desc *desc;
        int i;
@@ -2226,8 +2236,8 @@ void lttng_create_event_if_missing(struct lttng_event_enabler *event_enabler)
 static
 int lttng_event_enabler_ref_events(struct lttng_event_enabler *event_enabler)
 {
-       struct lttng_channel *chan = event_enabler->chan;
-       struct lttng_kernel_session *session = event_enabler->chan->session;
+       struct lttng_kernel_channel_buffer *chan = event_enabler->chan;
+       struct lttng_kernel_session *session = event_enabler->chan->parent.session;
        struct lttng_enabler *base_enabler = lttng_event_enabler_as_enabler(event_enabler);
        struct lttng_kernel_event_recorder_private *event_recorder_priv;
 
@@ -2239,10 +2249,10 @@ int lttng_event_enabler_ref_events(struct lttng_event_enabler *event_enabler)
                enum lttng_kernel_abi_syscall_entryexit entryexit = base_enabler->event_param.u.syscall.entryexit;
 
                if (entryexit == LTTNG_KERNEL_ABI_SYSCALL_ENTRY || entryexit == LTTNG_KERNEL_ABI_SYSCALL_ENTRYEXIT)
-                       WRITE_ONCE(chan->syscall_all_entry, enabled);
+                       WRITE_ONCE(chan->priv->parent.syscall_all_entry, enabled);
 
                if (entryexit == LTTNG_KERNEL_ABI_SYSCALL_EXIT || entryexit == LTTNG_KERNEL_ABI_SYSCALL_ENTRYEXIT)
-                       WRITE_ONCE(chan->syscall_all_exit, enabled);
+                       WRITE_ONCE(chan->priv->parent.syscall_all_exit, enabled);
        }
 
        /* First ensure that probe events are created for this enabler. */
@@ -2426,7 +2436,7 @@ int lttng_fix_pending_event_notifiers(void)
 struct lttng_event_enabler *lttng_event_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)
 {
        struct lttng_event_enabler *event_enabler;
 
@@ -2441,8 +2451,8 @@ struct lttng_event_enabler *lttng_event_enabler_create(
        /* ctx left NULL */
        event_enabler->base.enabled = 0;
        mutex_lock(&sessions_mutex);
-       list_add(&event_enabler->node, &event_enabler->chan->session->priv->enablers_head);
-       lttng_session_lazy_sync_event_enablers(event_enabler->chan->session);
+       list_add(&event_enabler->node, &event_enabler->chan->parent.session->priv->enablers_head);
+       lttng_session_lazy_sync_event_enablers(event_enabler->chan->parent.session);
        mutex_unlock(&sessions_mutex);
        return event_enabler;
 }
@@ -2451,7 +2461,7 @@ int lttng_event_enabler_enable(struct lttng_event_enabler *event_enabler)
 {
        mutex_lock(&sessions_mutex);
        lttng_event_enabler_as_enabler(event_enabler)->enabled = 1;
-       lttng_session_lazy_sync_event_enablers(event_enabler->chan->session);
+       lttng_session_lazy_sync_event_enablers(event_enabler->chan->parent.session);
        mutex_unlock(&sessions_mutex);
        return 0;
 }
@@ -2460,7 +2470,7 @@ int lttng_event_enabler_disable(struct lttng_event_enabler *event_enabler)
 {
        mutex_lock(&sessions_mutex);
        lttng_event_enabler_as_enabler(event_enabler)->enabled = 0;
-       lttng_session_lazy_sync_event_enablers(event_enabler->chan->session);
+       lttng_session_lazy_sync_event_enablers(event_enabler->chan->parent.session);
        mutex_unlock(&sessions_mutex);
        return 0;
 }
@@ -2507,7 +2517,7 @@ int lttng_event_enabler_attach_filter_bytecode(struct lttng_event_enabler *event
        if (ret)
                goto error;
 
-       lttng_session_lazy_sync_event_enablers(event_enabler->chan->session);
+       lttng_session_lazy_sync_event_enablers(event_enabler->chan->parent.session);
        return 0;
 
 error:
@@ -2723,7 +2733,7 @@ void lttng_session_sync_event_enablers(struct lttng_kernel_session *session)
                 * intesection of session and channel transient enable
                 * states.
                 */
-               enabled = enabled && session->priv->tstate && event_recorder->chan->tstate;
+               enabled = enabled && session->priv->tstate && event_recorder->chan->priv->parent.tstate;
 
                WRITE_ONCE(event_recorder->parent.enabled, enabled);
                /*
@@ -3627,14 +3637,14 @@ int _lttng_fields_metadata_statedump(struct lttng_kernel_session *session,
  */
 static
 int _lttng_event_metadata_statedump(struct lttng_kernel_session *session,
-                                 struct lttng_channel *chan,
+                                 struct lttng_kernel_channel_buffer *chan,
                                  struct lttng_kernel_event_recorder *event_recorder)
 {
        int ret = 0;
 
        if (event_recorder->priv->metadata_dumped || !LTTNG_READ_ONCE(session->active))
                return 0;
-       if (chan->channel_type == METADATA_CHANNEL)
+       if (chan->priv->channel_type == METADATA_CHANNEL)
                return 0;
 
        lttng_metadata_begin(session);
@@ -3646,7 +3656,7 @@ int _lttng_event_metadata_statedump(struct lttng_kernel_session *session,
                "       stream_id = %u;\n",
                event_recorder->priv->parent.desc->event_name,
                event_recorder->priv->id,
-               event_recorder->chan->id);
+               event_recorder->chan->priv->id);
        if (ret)
                goto end;
 
@@ -3684,40 +3694,40 @@ end:
  */
 static
 int _lttng_channel_metadata_statedump(struct lttng_kernel_session *session,
-                                   struct lttng_channel *chan)
+                                   struct lttng_kernel_channel_buffer *chan)
 {
        int ret = 0;
 
-       if (chan->metadata_dumped || !LTTNG_READ_ONCE(session->active))
+       if (chan->priv->metadata_dumped || !LTTNG_READ_ONCE(session->active))
                return 0;
 
-       if (chan->channel_type == METADATA_CHANNEL)
+       if (chan->priv->channel_type == METADATA_CHANNEL)
                return 0;
 
        lttng_metadata_begin(session);
 
-       WARN_ON_ONCE(!chan->header_type);
+       WARN_ON_ONCE(!chan->priv->header_type);
        ret = lttng_metadata_printf(session,
                "stream {\n"
                "       id = %u;\n"
                "       event.header := %s;\n"
                "       packet.context := struct packet_context;\n",
-               chan->id,
-               chan->header_type == 1 ? "struct event_header_compact" :
+               chan->priv->id,
+               chan->priv->header_type == 1 ? "struct event_header_compact" :
                        "struct event_header_large");
        if (ret)
                goto end;
 
-       if (chan->ctx) {
+       if (chan->priv->ctx) {
                ret = lttng_metadata_printf(session,
                        "       event.context := struct {\n");
                if (ret)
                        goto end;
        }
-       ret = _lttng_context_metadata_statedump(session, chan->ctx);
+       ret = _lttng_context_metadata_statedump(session, chan->priv->ctx);
        if (ret)
                goto end;
-       if (chan->ctx) {
+       if (chan->priv->ctx) {
                ret = lttng_metadata_printf(session,
                        "       };\n");
                if (ret)
@@ -3727,7 +3737,7 @@ int _lttng_channel_metadata_statedump(struct lttng_kernel_session *session,
        ret = lttng_metadata_printf(session,
                "};\n\n");
 
-       chan->metadata_dumped = 1;
+       chan->priv->metadata_dumped = 1;
 end:
        lttng_metadata_end(session);
        return ret;
@@ -3911,7 +3921,7 @@ int _lttng_session_metadata_statedump(struct lttng_kernel_session *session)
        unsigned char *uuid_c = session->priv->uuid.b;
        unsigned char uuid_s[37], clock_uuid_s[BOOT_ID_LEN];
        const char *product_uuid;
-       struct lttng_channel *chan;
+       struct lttng_kernel_channel_buffer_private *chan_priv;
        struct lttng_kernel_event_recorder_private *event_recorder_priv;
        int ret = 0;
 
@@ -4079,8 +4089,8 @@ int _lttng_session_metadata_statedump(struct lttng_kernel_session *session)
                goto end;
 
 skip_session:
-       list_for_each_entry(chan, &session->priv->chan, list) {
-               ret = _lttng_channel_metadata_statedump(session, chan);
+       list_for_each_entry(chan_priv, &session->priv->chan, node) {
+               ret = _lttng_channel_metadata_statedump(session, chan_priv->pub);
                if (ret)
                        goto end;
        }
@@ -4285,7 +4295,6 @@ static void lttng_exit_cpu_hotplug(void)
 }
 #endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) */
 
-
 static int __init lttng_events_init(void)
 {
        int ret;
index ac6d5e410acc5b0286e5507c66fde5bd99e6a077..e8f94e24df9407c6bfffcd0de85a63aec05e8843 100644 (file)
@@ -89,7 +89,8 @@ size_t ctx_get_aligned_size(size_t offset, struct lttng_kernel_ctx *ctx,
 
 static inline
 void ctx_get_struct_size(struct lttng_kernel_ctx *ctx, size_t *ctx_len,
-               struct lttng_channel *chan, struct lttng_kernel_ring_buffer_ctx *bufctx)
+               struct lttng_kernel_channel_buffer *lttng_chan,
+               struct lttng_kernel_ring_buffer_ctx *bufctx)
 {
        int i;
        size_t offset = 0;
@@ -107,7 +108,7 @@ void ctx_get_struct_size(struct lttng_kernel_ctx *ctx, size_t *ctx_len,
 
 static inline
 void ctx_record(struct lttng_kernel_ring_buffer_ctx *bufctx,
-               struct lttng_channel *chan,
+               struct lttng_kernel_channel_buffer *lttng_chan,
                struct lttng_kernel_ctx *ctx)
 {
        int i;
@@ -117,7 +118,7 @@ void ctx_record(struct lttng_kernel_ring_buffer_ctx *bufctx,
        lib_ring_buffer_align_ctx(bufctx, ctx->largest_align);
        for (i = 0; i < ctx->nr_fields; i++)
                ctx->fields[i].record(ctx->fields[i].priv, bufctx->probe_ctx,
-                               bufctx, chan);
+                               bufctx, lttng_chan);
 }
 
 /*
@@ -140,11 +141,11 @@ size_t record_header_size(const struct lib_ring_buffer_config *config,
                                 struct lttng_kernel_ring_buffer_ctx *ctx,
                                 struct lttng_client_ctx *client_ctx)
 {
-       struct lttng_channel *lttng_chan = channel_get_private(chan);
+       struct lttng_kernel_channel_buffer *lttng_chan = channel_get_private(chan);
        size_t orig_offset = offset;
        size_t padding;
 
-       switch (lttng_chan->header_type) {
+       switch (lttng_chan->priv->header_type) {
        case 1: /* compact */
                padding = lib_ring_buffer_align(offset, lttng_alignof(uint32_t));
                offset += padding;
@@ -179,7 +180,7 @@ size_t record_header_size(const struct lib_ring_buffer_config *config,
                padding = 0;
                WARN_ON_ONCE(1);
        }
-       offset += ctx_get_aligned_size(offset, lttng_chan->ctx,
+       offset += ctx_get_aligned_size(offset, lttng_chan->priv->ctx,
                        client_ctx->packet_context_len);
        *pre_header_padding = padding;
        return offset - orig_offset;
@@ -206,12 +207,12 @@ void lttng_write_event_header(const struct lib_ring_buffer_config *config,
                            struct lttng_kernel_ring_buffer_ctx *ctx,
                            uint32_t event_id)
 {
-       struct lttng_channel *lttng_chan = channel_get_private(ctx->priv.chan);
+       struct lttng_kernel_channel_buffer *lttng_chan = channel_get_private(ctx->priv.chan);
 
        if (unlikely(ctx->priv.rflags))
                goto slow_path;
 
-       switch (lttng_chan->header_type) {
+       switch (lttng_chan->priv->header_type) {
        case 1: /* compact */
        {
                uint32_t id_time = 0;
@@ -241,7 +242,7 @@ void lttng_write_event_header(const struct lib_ring_buffer_config *config,
                WARN_ON_ONCE(1);
        }
 
-       ctx_record(ctx, lttng_chan, lttng_chan->ctx);
+       ctx_record(ctx, lttng_chan, lttng_chan->priv->ctx);
        lib_ring_buffer_align_ctx(ctx, ctx->largest_align);
 
        return;
@@ -255,9 +256,9 @@ void lttng_write_event_header_slow(const struct lib_ring_buffer_config *config,
                                 struct lttng_kernel_ring_buffer_ctx *ctx,
                                 uint32_t event_id)
 {
-       struct lttng_channel *lttng_chan = channel_get_private(ctx->priv.chan);
+       struct lttng_kernel_channel_buffer *lttng_chan = channel_get_private(ctx->priv.chan);
 
-       switch (lttng_chan->header_type) {
+       switch (lttng_chan->priv->header_type) {
        case 1: /* compact */
                if (!(ctx->priv.rflags & (RING_BUFFER_RFLAG_FULL_TSC | LTTNG_RFLAG_EXTENDED))) {
                        uint32_t id_time = 0;
@@ -311,7 +312,7 @@ void lttng_write_event_header_slow(const struct lib_ring_buffer_config *config,
        default:
                WARN_ON_ONCE(1);
        }
-       ctx_record(ctx, lttng_chan, lttng_chan->ctx);
+       ctx_record(ctx, lttng_chan, lttng_chan->priv->ctx);
        lib_ring_buffer_align_ctx(ctx, ctx->largest_align);
 }
 
@@ -353,12 +354,12 @@ static void client_buffer_begin(struct lib_ring_buffer *buf, u64 tsc,
                (struct packet_header *)
                        lib_ring_buffer_offset_address(&buf->backend,
                                subbuf_idx * chan->backend.subbuf_size);
-       struct lttng_channel *lttng_chan = channel_get_private(chan);
-       struct lttng_kernel_session *session = lttng_chan->session;
+       struct lttng_kernel_channel_buffer *lttng_chan = channel_get_private(chan);
+       struct lttng_kernel_session *session = lttng_chan->parent.session;
 
        header->magic = CTF_MAGIC_NUMBER;
        memcpy(header->uuid, session->priv->uuid.b, sizeof(session->priv->uuid));
-       header->stream_id = lttng_chan->id;
+       header->stream_id = lttng_chan->priv->id;
        header->stream_instance_id = buf->backend.cpu;
        header->ctx.timestamp_begin = tsc;
        header->ctx.timestamp_end = 0;
@@ -468,9 +469,9 @@ static int client_stream_id(const struct lib_ring_buffer_config *config,
                        uint64_t *stream_id)
 {
        struct channel *chan = buf->backend.chan;
-       struct lttng_channel *lttng_chan = channel_get_private(chan);
+       struct lttng_kernel_channel_buffer *lttng_chan = channel_get_private(chan);
 
-       *stream_id = lttng_chan->id;
+       *stream_id = lttng_chan->priv->id;
        return 0;
 }
 
@@ -543,7 +544,7 @@ struct channel *_channel_create(const char *name,
                                unsigned int switch_timer_interval,
                                unsigned int read_timer_interval)
 {
-       struct lttng_channel *lttng_chan = priv;
+       struct lttng_kernel_channel_buffer *lttng_chan = priv;
        struct channel *chan;
 
        chan = channel_create(&client_config, name, lttng_chan, buf_addr,
@@ -606,7 +607,7 @@ static
 int lttng_event_reserve(struct lttng_kernel_ring_buffer_ctx *ctx)
 {
        struct lttng_kernel_event_recorder *event_recorder = ctx->client_priv;
-       struct lttng_channel *lttng_chan = event_recorder->chan;
+       struct lttng_kernel_channel_buffer *lttng_chan = event_recorder->chan;
        struct lttng_client_ctx client_ctx;
        int ret, cpu;
        uint32_t event_id;
@@ -616,13 +617,13 @@ int lttng_event_reserve(struct lttng_kernel_ring_buffer_ctx *ctx)
                return -EPERM;
        event_id = event_recorder->priv->id;
        memset(&ctx->priv, 0, sizeof(ctx->priv));
-       ctx->priv.chan = lttng_chan->chan;
+       ctx->priv.chan = lttng_chan->priv->rb_chan;
        ctx->priv.reserve_cpu = cpu;
 
        /* Compute internal size of context structures. */
-       ctx_get_struct_size(lttng_chan->ctx, &client_ctx.packet_context_len, lttng_chan, ctx);
+       ctx_get_struct_size(lttng_chan->priv->ctx, &client_ctx.packet_context_len, lttng_chan, ctx);
 
-       switch (lttng_chan->header_type) {
+       switch (lttng_chan->priv->header_type) {
        case 1: /* compact */
                if (event_id > 30)
                        ctx->priv.rflags |= LTTNG_RFLAG_EXTENDED;
@@ -690,6 +691,12 @@ void lttng_event_strcpy_from_user(struct lttng_kernel_ring_buffer_ctx *ctx,
                        len, '#');
 }
 
+static
+void lttng_channel_buffer_lost_event_too_big(struct lttng_kernel_channel_buffer *lttng_chan)
+{
+       lib_ring_buffer_lost_event_too_big(lttng_chan->priv->rb_chan);
+}
+
 static
 wait_queue_head_t *lttng_get_writer_buf_wait_queue(struct channel *chan, int cpu)
 {
@@ -750,6 +757,7 @@ static struct lttng_transport lttng_relay_transport = {
                .event_memset = lttng_event_memset,
                .event_strcpy = lttng_event_strcpy,
                .event_strcpy_from_user = lttng_event_strcpy_from_user,
+               .lost_event_too_big = lttng_channel_buffer_lost_event_too_big,
        },
 };
 
index 623120c0a98e0b0922ff8c05942b15657f8c964e..bd6fb20015996c0a47d496f6918906a7b8a70bd7 100644 (file)
@@ -243,11 +243,11 @@ struct channel *_channel_create(const char *name,
                                unsigned int switch_timer_interval,
                                unsigned int read_timer_interval)
 {
-       struct lttng_channel *lttng_chan = priv;
+       struct lttng_kernel_channel_buffer *lttng_chan = priv;
        struct channel *chan;
 
        chan = channel_create(&client_config, name,
-                             lttng_chan->session->priv->metadata_cache, buf_addr,
+                             lttng_chan->parent.session->priv->metadata_cache, buf_addr,
                              subbuf_size, num_subbuf, switch_timer_interval,
                              read_timer_interval);
        if (chan) {
index 6b52b69bbf7dd2c3d0f50e2dfaa6b2f2d96a160f..bd836c001d658257e5bf529d61a3cbeabc84a168 100644 (file)
@@ -256,33 +256,33 @@ void syscall_entry_event_call_func(struct hlist_head *action_list,
 
 void syscall_entry_event_probe(void *__data, struct pt_regs *regs, long id)
 {
-       struct lttng_channel *chan = __data;
+       struct lttng_kernel_channel_buffer *chan = __data;
        struct hlist_head *action_list, *unknown_action_list;
        const struct trace_syscall_entry *table, *entry;
        size_t table_len;
 
        if (unlikely(in_compat_syscall())) {
-               struct lttng_syscall_filter *filter = chan->sc_filter;
+               struct lttng_syscall_filter *filter = chan->priv->parent.sc_filter;
 
                if (id < 0 || id >= NR_compat_syscalls
-                       || (!READ_ONCE(chan->syscall_all_entry) && !test_bit(id, filter->sc_compat_entry))) {
+                       || (!READ_ONCE(chan->priv->parent.syscall_all_entry) && !test_bit(id, filter->sc_compat_entry))) {
                        /* System call filtered out. */
                        return;
                }
                table = compat_sc_table.table;
                table_len = compat_sc_table.len;
-               unknown_action_list = &chan->sc_compat_unknown;
+               unknown_action_list = &chan->priv->parent.sc_compat_unknown;
        } else {
-               struct lttng_syscall_filter *filter = chan->sc_filter;
+               struct lttng_syscall_filter *filter = chan->priv->parent.sc_filter;
 
                if (id < 0 || id >= NR_syscalls
-                       || (!READ_ONCE(chan->syscall_all_entry) && !test_bit(id, filter->sc_entry))) {
+                       || (!READ_ONCE(chan->priv->parent.syscall_all_entry) && !test_bit(id, filter->sc_entry))) {
                        /* System call filtered out. */
                        return;
                }
                table = sc_table.table;
                table_len = sc_table.len;
-               unknown_action_list = &chan->sc_unknown;
+               unknown_action_list = &chan->priv->parent.sc_unknown;
        }
        if (unlikely(id < 0 || id >= table_len)) {
                syscall_entry_event_unknown(unknown_action_list, regs, id);
@@ -296,9 +296,9 @@ void syscall_entry_event_probe(void *__data, struct pt_regs *regs, long id)
        }
 
        if (unlikely(in_compat_syscall())) {
-               action_list = &chan->compat_sc_table[id];
+               action_list = &chan->priv->parent.compat_sc_table[id];
        } else {
-               action_list = &chan->sc_table[id];
+               action_list = &chan->priv->parent.sc_table[id];
        }
        if (unlikely(hlist_empty(action_list)))
                return;
@@ -492,7 +492,7 @@ void syscall_exit_event_call_func(struct hlist_head *action_list,
 
 void syscall_exit_event_probe(void *__data, struct pt_regs *regs, long ret)
 {
-       struct lttng_channel *chan = __data;
+       struct lttng_kernel_channel_buffer *chan = __data;
        struct hlist_head *action_list, *unknown_action_list;
        const struct trace_syscall_entry *table, *entry;
        size_t table_len;
@@ -501,27 +501,27 @@ void syscall_exit_event_probe(void *__data, struct pt_regs *regs, long ret)
        id = syscall_get_nr(current, regs);
 
        if (unlikely(in_compat_syscall())) {
-               struct lttng_syscall_filter *filter = chan->sc_filter;
+               struct lttng_syscall_filter *filter = chan->priv->parent.sc_filter;
 
                if (id < 0 || id >= NR_compat_syscalls
-                       || (!READ_ONCE(chan->syscall_all_exit) && !test_bit(id, filter->sc_compat_exit))) {
+                       || (!READ_ONCE(chan->priv->parent.syscall_all_exit) && !test_bit(id, filter->sc_compat_exit))) {
                        /* System call filtered out. */
                        return;
                }
                table = compat_sc_exit_table.table;
                table_len = compat_sc_exit_table.len;
-               unknown_action_list = &chan->compat_sc_exit_unknown;
+               unknown_action_list = &chan->priv->parent.compat_sc_exit_unknown;
        } else {
-               struct lttng_syscall_filter *filter = chan->sc_filter;
+               struct lttng_syscall_filter *filter = chan->priv->parent.sc_filter;
 
                if (id < 0 || id >= NR_syscalls
-                       || (!READ_ONCE(chan->syscall_all_exit) && !test_bit(id, filter->sc_exit))) {
+                       || (!READ_ONCE(chan->priv->parent.syscall_all_exit) && !test_bit(id, filter->sc_exit))) {
                        /* System call filtered out. */
                        return;
                }
                table = sc_exit_table.table;
                table_len = sc_exit_table.len;
-               unknown_action_list = &chan->sc_exit_unknown;
+               unknown_action_list = &chan->priv->parent.sc_exit_unknown;
        }
        if (unlikely(id < 0 || id >= table_len)) {
                syscall_exit_event_unknown(unknown_action_list, regs, id, ret);
@@ -535,9 +535,9 @@ void syscall_exit_event_probe(void *__data, struct pt_regs *regs, long ret)
        }
 
        if (unlikely(in_compat_syscall())) {
-               action_list = &chan->compat_sc_exit_table[id];
+               action_list = &chan->priv->parent.compat_sc_exit_table[id];
        } else {
-               action_list = &chan->sc_exit_table[id];
+               action_list = &chan->priv->parent.sc_exit_table[id];
        }
        if (unlikely(hlist_empty(action_list)))
                return;
@@ -616,8 +616,8 @@ int lttng_create_syscall_event_if_missing(const struct trace_syscall_entry *tabl
        struct hlist_head *chan_table, struct lttng_event_enabler *event_enabler,
        enum sc_type type)
 {
-       struct lttng_channel *chan = event_enabler->chan;
-       struct lttng_kernel_session *session = chan->session;
+       struct lttng_kernel_channel_buffer *chan = event_enabler->chan;
+       struct lttng_kernel_session *session = chan->parent.session;
        unsigned int i;
 
        /* Allocate events for each syscall matching enabler, insert into table */
@@ -694,46 +694,46 @@ int lttng_create_syscall_event_if_missing(const struct trace_syscall_entry *tabl
  */
 int lttng_syscalls_register_event(struct lttng_event_enabler *event_enabler)
 {
-       struct lttng_channel *chan = event_enabler->chan;
+       struct lttng_kernel_channel_buffer *chan = event_enabler->chan;
        struct lttng_kernel_abi_event ev;
        int ret;
 
        wrapper_vmalloc_sync_mappings();
 
-       if (!chan->sc_table) {
+       if (!chan->priv->parent.sc_table) {
                /* create syscall table mapping syscall to events */
-               chan->sc_table = kzalloc(sizeof(struct lttng_kernel_event_recorder *)
+               chan->priv->parent.sc_table = kzalloc(sizeof(struct lttng_kernel_event_recorder *)
                                        * sc_table.len, GFP_KERNEL);
-               if (!chan->sc_table)
+               if (!chan->priv->parent.sc_table)
                        return -ENOMEM;
        }
-       if (!chan->sc_exit_table) {
+       if (!chan->priv->parent.sc_exit_table) {
                /* create syscall table mapping syscall to events */
-               chan->sc_exit_table = kzalloc(sizeof(struct lttng_kernel_event_recorder *)
+               chan->priv->parent.sc_exit_table = kzalloc(sizeof(struct lttng_kernel_event_recorder *)
                                        * sc_exit_table.len, GFP_KERNEL);
-               if (!chan->sc_exit_table)
+               if (!chan->priv->parent.sc_exit_table)
                        return -ENOMEM;
        }
 
 
 #ifdef CONFIG_COMPAT
-       if (!chan->compat_sc_table) {
+       if (!chan->priv->parent.compat_sc_table) {
                /* create syscall table mapping compat syscall to events */
-               chan->compat_sc_table = kzalloc(sizeof(struct lttng_kernel_event_recorder *)
+               chan->priv->parent.compat_sc_table = kzalloc(sizeof(struct lttng_kernel_event_recorder *)
                                        * compat_sc_table.len, GFP_KERNEL);
-               if (!chan->compat_sc_table)
+               if (!chan->priv->parent.compat_sc_table)
                        return -ENOMEM;
        }
 
-       if (!chan->compat_sc_exit_table) {
+       if (!chan->priv->parent.compat_sc_exit_table) {
                /* create syscall table mapping compat syscall to events */
-               chan->compat_sc_exit_table = kzalloc(sizeof(struct lttng_kernel_event_recorder *)
+               chan->priv->parent.compat_sc_exit_table = kzalloc(sizeof(struct lttng_kernel_event_recorder *)
                                        * compat_sc_exit_table.len, GFP_KERNEL);
-               if (!chan->compat_sc_exit_table)
+               if (!chan->priv->parent.compat_sc_exit_table)
                        return -ENOMEM;
        }
 #endif
-       if (hlist_empty(&chan->sc_unknown)) {
+       if (hlist_empty(&chan->priv->parent.sc_unknown)) {
                const struct lttng_kernel_event_desc *desc =
                        &__event_desc___syscall_entry_unknown;
                struct lttng_kernel_event_recorder *event_recorder;
@@ -750,10 +750,10 @@ int lttng_syscalls_register_event(struct lttng_event_enabler *event_enabler)
                if (IS_ERR(event_recorder)) {
                        return PTR_ERR(event_recorder);
                }
-               hlist_add_head(&event_recorder->priv->parent.u.syscall.node, &chan->sc_unknown);
+               hlist_add_head(&event_recorder->priv->parent.u.syscall.node, &chan->priv->parent.sc_unknown);
        }
 
-       if (hlist_empty(&chan->sc_compat_unknown)) {
+       if (hlist_empty(&chan->priv->parent.sc_compat_unknown)) {
                const struct lttng_kernel_event_desc *desc =
                        &__event_desc___compat_syscall_entry_unknown;
                struct lttng_kernel_event_recorder *event_recorder;
@@ -770,10 +770,10 @@ int lttng_syscalls_register_event(struct lttng_event_enabler *event_enabler)
                if (IS_ERR(event_recorder)) {
                        return PTR_ERR(event_recorder);
                }
-               hlist_add_head(&event_recorder->priv->parent.u.syscall.node, &chan->sc_compat_unknown);
+               hlist_add_head(&event_recorder->priv->parent.u.syscall.node, &chan->priv->parent.sc_compat_unknown);
        }
 
-       if (hlist_empty(&chan->compat_sc_exit_unknown)) {
+       if (hlist_empty(&chan->priv->parent.compat_sc_exit_unknown)) {
                const struct lttng_kernel_event_desc *desc =
                        &__event_desc___compat_syscall_exit_unknown;
                struct lttng_kernel_event_recorder *event_recorder;
@@ -790,10 +790,10 @@ int lttng_syscalls_register_event(struct lttng_event_enabler *event_enabler)
                if (IS_ERR(event_recorder)) {
                        return PTR_ERR(event_recorder);
                }
-               hlist_add_head(&event_recorder->priv->parent.u.syscall.node, &chan->compat_sc_exit_unknown);
+               hlist_add_head(&event_recorder->priv->parent.u.syscall.node, &chan->priv->parent.compat_sc_exit_unknown);
        }
 
-       if (hlist_empty(&chan->sc_exit_unknown)) {
+       if (hlist_empty(&chan->priv->parent.sc_exit_unknown)) {
                const struct lttng_kernel_event_desc *desc =
                        &__event_desc___syscall_exit_unknown;
                struct lttng_kernel_event_recorder *event_recorder;
@@ -810,48 +810,48 @@ int lttng_syscalls_register_event(struct lttng_event_enabler *event_enabler)
                if (IS_ERR(event_recorder)) {
                        return PTR_ERR(event_recorder);
                }
-               hlist_add_head(&event_recorder->priv->parent.u.syscall.node, &chan->sc_exit_unknown);
+               hlist_add_head(&event_recorder->priv->parent.u.syscall.node, &chan->priv->parent.sc_exit_unknown);
        }
 
        ret = lttng_create_syscall_event_if_missing(sc_table.table, sc_table.len,
-                       chan->sc_table, event_enabler, SC_TYPE_ENTRY);
+                       chan->priv->parent.sc_table, event_enabler, SC_TYPE_ENTRY);
        if (ret)
                return ret;
        ret = lttng_create_syscall_event_if_missing(sc_exit_table.table, sc_exit_table.len,
-                       chan->sc_exit_table, event_enabler, SC_TYPE_EXIT);
+                       chan->priv->parent.sc_exit_table, event_enabler, SC_TYPE_EXIT);
        if (ret)
                return ret;
 
 #ifdef CONFIG_COMPAT
        ret = lttng_create_syscall_event_if_missing(compat_sc_table.table, compat_sc_table.len,
-                       chan->compat_sc_table, event_enabler, SC_TYPE_COMPAT_ENTRY);
+                       chan->priv->parent.compat_sc_table, event_enabler, SC_TYPE_COMPAT_ENTRY);
        if (ret)
                return ret;
        ret = lttng_create_syscall_event_if_missing(compat_sc_exit_table.table, compat_sc_exit_table.len,
-                       chan->compat_sc_exit_table, event_enabler, SC_TYPE_COMPAT_EXIT);
+                       chan->priv->parent.compat_sc_exit_table, event_enabler, SC_TYPE_COMPAT_EXIT);
        if (ret)
                return ret;
 #endif
 
-       if (!chan->sc_filter) {
-               chan->sc_filter = kzalloc(sizeof(struct lttng_syscall_filter),
+       if (!chan->priv->parent.sc_filter) {
+               chan->priv->parent.sc_filter = kzalloc(sizeof(struct lttng_syscall_filter),
                                GFP_KERNEL);
-               if (!chan->sc_filter)
+               if (!chan->priv->parent.sc_filter)
                        return -ENOMEM;
        }
 
-       if (!chan->sys_enter_registered) {
+       if (!chan->priv->parent.sys_enter_registered) {
                ret = lttng_wrapper_tracepoint_probe_register("sys_enter",
                                (void *) syscall_entry_event_probe, chan);
                if (ret)
                        return ret;
-               chan->sys_enter_registered = 1;
+               chan->priv->parent.sys_enter_registered = 1;
        }
        /*
         * We change the name of sys_exit tracepoint due to namespace
         * conflict with sys_exit syscall entry.
         */
-       if (!chan->sys_exit_registered) {
+       if (!chan->priv->parent.sys_exit_registered) {
                ret = lttng_wrapper_tracepoint_probe_register("sys_exit",
                                (void *) syscall_exit_event_probe, chan);
                if (ret) {
@@ -859,7 +859,7 @@ int lttng_syscalls_register_event(struct lttng_event_enabler *event_enabler)
                                (void *) syscall_entry_event_probe, chan));
                        return ret;
                }
-               chan->sys_exit_registered = 1;
+               chan->priv->parent.sys_exit_registered = 1;
        }
        return ret;
 }
@@ -1238,38 +1238,38 @@ int lttng_syscalls_unregister_event_notifier_group(
        return 0;
 }
 
-int lttng_syscalls_unregister_channel(struct lttng_channel *chan)
+int lttng_syscalls_unregister_channel(struct lttng_kernel_channel_buffer *chan)
 {
        int ret;
 
-       if (!chan->sc_table)
+       if (!chan->priv->parent.sc_table)
                return 0;
-       if (chan->sys_enter_registered) {
+       if (chan->priv->parent.sys_enter_registered) {
                ret = lttng_wrapper_tracepoint_probe_unregister("sys_enter",
                                (void *) syscall_entry_event_probe, chan);
                if (ret)
                        return ret;
-               chan->sys_enter_registered = 0;
+               chan->priv->parent.sys_enter_registered = 0;
        }
-       if (chan->sys_exit_registered) {
+       if (chan->priv->parent.sys_exit_registered) {
                ret = lttng_wrapper_tracepoint_probe_unregister("sys_exit",
                                (void *) syscall_exit_event_probe, chan);
                if (ret)
                        return ret;
-               chan->sys_exit_registered = 0;
+               chan->priv->parent.sys_exit_registered = 0;
        }
        return 0;
 }
 
-int lttng_syscalls_destroy_event(struct lttng_channel *chan)
+int lttng_syscalls_destroy_event(struct lttng_kernel_channel_buffer *chan)
 {
-       kfree(chan->sc_table);
-       kfree(chan->sc_exit_table);
+       kfree(chan->priv->parent.sc_table);
+       kfree(chan->priv->parent.sc_exit_table);
 #ifdef CONFIG_COMPAT
-       kfree(chan->compat_sc_table);
-       kfree(chan->compat_sc_exit_table);
+       kfree(chan->priv->parent.compat_sc_table);
+       kfree(chan->priv->parent.compat_sc_exit_table);
 #endif
-       kfree(chan->sc_filter);
+       kfree(chan->priv->parent.sc_filter);
        return 0;
 }
 
@@ -1475,12 +1475,12 @@ end:
 }
 
 int lttng_syscall_filter_enable_event(
-               struct lttng_channel *channel,
+               struct lttng_kernel_channel_buffer *channel,
                struct lttng_kernel_event_recorder *event_recorder)
 {
        WARN_ON_ONCE(event_recorder->priv->parent.instrumentation != LTTNG_KERNEL_ABI_SYSCALL);
 
-       return lttng_syscall_filter_enable(channel->sc_filter,
+       return lttng_syscall_filter_enable(channel->priv->parent.sc_filter,
                event_recorder->priv->parent.desc->event_name,
                event_recorder->priv->parent.u.syscall.abi,
                event_recorder->priv->parent.u.syscall.entryexit);
@@ -1565,10 +1565,10 @@ int lttng_syscall_filter_disable_event_notifier(
 }
 
 int lttng_syscall_filter_disable_event(
-               struct lttng_channel *channel,
+               struct lttng_kernel_channel_buffer *channel,
                struct lttng_kernel_event_recorder *event_recorder)
 {
-       return lttng_syscall_filter_disable(channel->sc_filter,
+       return lttng_syscall_filter_disable(channel->priv->parent.sc_filter,
                event_recorder->priv->parent.desc->event_name,
                event_recorder->priv->parent.u.syscall.abi,
                event_recorder->priv->parent.u.syscall.entryexit);
@@ -1688,7 +1688,7 @@ const struct file_operations lttng_syscall_list_fops = {
 /*
  * A syscall is enabled if it is traced for either entry or exit.
  */
-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)
 {
        uint32_t len, sc_tables_len, bitmask_len;
@@ -1708,14 +1708,14 @@ long lttng_channel_syscall_mask(struct lttng_channel *channel,
        tmp_mask = kzalloc(bitmask_len, GFP_KERNEL);
        if (!tmp_mask)
                return -ENOMEM;
-       filter = channel->sc_filter;
+       filter = channel->priv->parent.sc_filter;
 
        for (bit = 0; bit < sc_table.len; bit++) {
                char state;
 
-               if (channel->sc_table) {
-                       if (!(READ_ONCE(channel->syscall_all_entry)
-                                       || READ_ONCE(channel->syscall_all_exit)) && filter)
+               if (channel->priv->parent.sc_table) {
+                       if (!(READ_ONCE(channel->priv->parent.syscall_all_entry)
+                                       || READ_ONCE(channel->priv->parent.syscall_all_exit)) && filter)
                                state = test_bit(bit, filter->sc_entry)
                                        || test_bit(bit, filter->sc_exit);
                        else
@@ -1728,9 +1728,9 @@ long lttng_channel_syscall_mask(struct lttng_channel *channel,
        for (; bit < sc_tables_len; bit++) {
                char state;
 
-               if (channel->compat_sc_table) {
-                       if (!(READ_ONCE(channel->syscall_all_entry)
-                                       || READ_ONCE(channel->syscall_all_exit)) && filter)
+               if (channel->priv->parent.compat_sc_table) {
+                       if (!(READ_ONCE(channel->priv->parent.syscall_all_entry)
+                                       || READ_ONCE(channel->priv->parent.syscall_all_exit)) && filter)
                                state = test_bit(bit - sc_table.len,
                                                filter->sc_compat_entry)
                                        || test_bit(bit - sc_table.len,
index 95f485408b6c5ee8625f623cb3ad6705869ab71b..a279b19d58c01588382cdcc2ff1c6b713bff480d 100644 (file)
@@ -37,11 +37,11 @@ int lttng_kprobes_event_handler_pre(struct kprobe *p, struct pt_regs *regs)
                        container_of(event_priv, struct lttng_kernel_event_recorder_private, parent);
                struct lttng_kernel_event_recorder *event_recorder =
                        event_recorder_priv->pub;
-               struct lttng_channel *chan = event_recorder->chan;
+               struct lttng_kernel_channel_buffer *chan = event_recorder->chan;
 
-               if (unlikely(!LTTNG_READ_ONCE(chan->session->active)))
+               if (unlikely(!LTTNG_READ_ONCE(chan->parent.session->active)))
                        return 0;
-               if (unlikely(!LTTNG_READ_ONCE(chan->enabled)))
+               if (unlikely(!LTTNG_READ_ONCE(chan->parent.enabled)))
                        return 0;
                break;
        }
@@ -59,7 +59,7 @@ int lttng_kprobes_event_handler_pre(struct kprobe *p, struct pt_regs *regs)
        {
                struct lttng_kernel_event_recorder *event_recorder =
                        container_of(event, struct lttng_kernel_event_recorder, parent);
-               struct lttng_channel *chan = event_recorder->chan;
+               struct lttng_kernel_channel_buffer *chan = event_recorder->chan;
                struct lttng_kernel_ring_buffer_ctx ctx;
                int ret;
 
index 7d0db416908f6ba95ff21600d115374a6f9dc477..e939a0ae56bb2af3f75dcb0b938d8d8766d993f4 100644 (file)
@@ -53,11 +53,11 @@ int _lttng_kretprobes_handler(struct kretprobe_instance *krpi,
        {
                struct lttng_kernel_event_recorder *event_recorder =
                        container_of(event, struct lttng_kernel_event_recorder, parent);
-               struct lttng_channel *chan = event_recorder->chan;
+               struct lttng_kernel_channel_buffer *chan = event_recorder->chan;
 
-               if (unlikely(!LTTNG_READ_ONCE(chan->session->active)))
+               if (unlikely(!LTTNG_READ_ONCE(chan->parent.session->active)))
                        return 0;
-               if (unlikely(!LTTNG_READ_ONCE(chan->enabled)))
+               if (unlikely(!LTTNG_READ_ONCE(chan->parent.enabled)))
                        return 0;
                break;
        }
@@ -74,7 +74,7 @@ int _lttng_kretprobes_handler(struct kretprobe_instance *krpi,
        {
                struct lttng_kernel_event_recorder *event_recorder =
                        container_of(event, struct lttng_kernel_event_recorder, parent);
-               struct lttng_channel *chan = event_recorder->chan;
+               struct lttng_kernel_channel_buffer *chan = event_recorder->chan;
                struct lttng_kernel_ring_buffer_ctx ctx;
                int ret;
 
index b88aee13cb29a3a9d815d5302a11928f53eaa0df..efb879be7c56e42e8eaa37ad486af5907d608ad3 100644 (file)
@@ -42,11 +42,11 @@ int lttng_uprobes_event_handler_pre(struct uprobe_consumer *uc, struct pt_regs *
        {
                struct lttng_kernel_event_recorder *event_recorder =
                        container_of(event, struct lttng_kernel_event_recorder, parent);
-               struct lttng_channel *chan = event_recorder->chan;
+               struct lttng_kernel_channel_buffer *chan = event_recorder->chan;
 
-               if (unlikely(!LTTNG_READ_ONCE(chan->session->active)))
+               if (unlikely(!LTTNG_READ_ONCE(chan->parent.session->active)))
                        return 0;
-               if (unlikely(!LTTNG_READ_ONCE(chan->enabled)))
+               if (unlikely(!LTTNG_READ_ONCE(chan->parent.enabled)))
                        return 0;
                break;
        }
@@ -64,7 +64,7 @@ int lttng_uprobes_event_handler_pre(struct uprobe_consumer *uc, struct pt_regs *
        {
                struct lttng_kernel_event_recorder *event_recorder =
                        container_of(event, struct lttng_kernel_event_recorder, parent);
-               struct lttng_channel *chan = event_recorder->chan;
+               struct lttng_kernel_channel_buffer *chan = event_recorder->chan;
                struct lttng_kernel_ring_buffer_ctx ctx;
                int ret;
 
This page took 0.074452 seconds and 4 git commands to generate.