Refactoring: event notifier create: use enablers
[lttng-modules.git] / src / lttng-abi.c
index 974aaff0b888e74504a814f584fa82bc488bdd62..1f0939815262e5e2209d6c3e208a1c113c4b3acc 100644 (file)
@@ -34,6 +34,7 @@
 #include <ringbuffer/vfs.h>
 #include <ringbuffer/backend.h>
 #include <ringbuffer/frontend.h>
+#include <wrapper/compiler_attributes.h>
 #include <wrapper/poll.h>
 #include <wrapper/file.h>
 #include <wrapper/kref.h>
@@ -549,7 +550,7 @@ int lttng_abi_create_channel(struct file *session_file,
         * We tolerate no failure path after channel creation. It will stay
         * invariant for the rest of the session.
         */
-       chan = lttng_channel_create(session, transport_name, NULL,
+       chan = lttng_channel_buffer_create(session, transport_name, NULL,
                                  chan_param->subbuf_size,
                                  chan_param->num_subbuf,
                                  chan_param->switch_timer_interval,
@@ -1000,7 +1001,7 @@ ssize_t lttng_event_notifier_group_notif_read(struct file *filp, char __user *us
 {
        struct lttng_event_notifier_group *event_notifier_group = filp->private_data;
        struct lttng_kernel_ring_buffer_channel *chan = event_notifier_group->chan;
-       struct lib_ring_buffer *buf = event_notifier_group->buf;
+       struct lttng_kernel_ring_buffer *buf = event_notifier_group->buf;
        ssize_t read_count = 0, len;
        size_t read_offset;
 
@@ -1106,8 +1107,8 @@ unsigned int lttng_event_notifier_group_notif_poll(struct file *filp,
        unsigned int mask = 0;
        struct lttng_event_notifier_group *event_notifier_group = filp->private_data;
        struct lttng_kernel_ring_buffer_channel *chan = event_notifier_group->chan;
-       struct lib_ring_buffer *buf = event_notifier_group->buf;
-       const struct lib_ring_buffer_config *config = &chan->backend.config;
+       struct lttng_kernel_ring_buffer *buf = event_notifier_group->buf;
+       const struct lttng_kernel_ring_buffer_config *config = &chan->backend.config;
        int finalized, disabled;
        unsigned long consumed, offset;
        size_t subbuffer_header_size = config->cb.subbuffer_header_size();
@@ -1179,7 +1180,7 @@ retry:
 static int lttng_event_notifier_group_notif_open(struct inode *inode, struct file *file)
 {
        struct lttng_event_notifier_group *event_notifier_group = inode->i_private;
-       struct lib_ring_buffer *buf = event_notifier_group->buf;
+       struct lttng_kernel_ring_buffer *buf = event_notifier_group->buf;
 
        file->private_data = event_notifier_group;
        return lib_ring_buffer_open(inode, file, buf);
@@ -1195,7 +1196,7 @@ static int lttng_event_notifier_group_notif_open(struct inode *inode, struct fil
 static int lttng_event_notifier_group_notif_release(struct inode *inode, struct file *file)
 {
        struct lttng_event_notifier_group *event_notifier_group = file->private_data;
-       struct lib_ring_buffer *buf = event_notifier_group->buf;
+       struct lttng_kernel_ring_buffer *buf = event_notifier_group->buf;
        int ret;
 
        ret = lib_ring_buffer_release(inode, file, buf);
@@ -1225,7 +1226,7 @@ unsigned int lttng_metadata_ring_buffer_poll(struct file *filp,
                poll_table *wait)
 {
        struct lttng_metadata_stream *stream = filp->private_data;
-       struct lib_ring_buffer *buf = stream->priv;
+       struct lttng_kernel_ring_buffer *buf = stream->priv;
        int finalized;
        unsigned int mask = 0;
 
@@ -1301,7 +1302,7 @@ long lttng_metadata_ring_buffer_ioctl(struct file *filp,
 {
        int ret;
        struct lttng_metadata_stream *stream = filp->private_data;
-       struct lib_ring_buffer *buf = stream->priv;
+       struct lttng_kernel_ring_buffer *buf = stream->priv;
        unsigned int rb_cmd;
        bool coherent;
 
@@ -1314,7 +1315,7 @@ long lttng_metadata_ring_buffer_ioctl(struct file *filp,
        case LTTNG_KERNEL_ABI_RING_BUFFER_GET_NEXT_SUBBUF:
        {
                struct lttng_metadata_stream *stream = filp->private_data;
-               struct lib_ring_buffer *buf = stream->priv;
+               struct lttng_kernel_ring_buffer *buf = stream->priv;
                struct lttng_kernel_ring_buffer_channel *chan = buf->backend.chan;
 
                ret = lttng_metadata_output_channel(stream, chan, NULL);
@@ -1332,11 +1333,12 @@ long lttng_metadata_ring_buffer_ioctl(struct file *filp,
                 */
                return -ENOSYS;
        }
-       case LTTNG_KERNEL_ABI_RING_BUFFER_FLUSH_EMPTY:  /* Fall-through. */
+       case LTTNG_KERNEL_ABI_RING_BUFFER_FLUSH_EMPTY:
+               lttng_fallthrough;
        case LTTNG_KERNEL_ABI_RING_BUFFER_FLUSH:
        {
                struct lttng_metadata_stream *stream = filp->private_data;
-               struct lib_ring_buffer *buf = stream->priv;
+               struct lttng_kernel_ring_buffer *buf = stream->priv;
                struct lttng_kernel_ring_buffer_channel *chan = buf->backend.chan;
 
                /*
@@ -1363,7 +1365,7 @@ long lttng_metadata_ring_buffer_ioctl(struct file *filp,
        case LTTNG_KERNEL_ABI_RING_BUFFER_GET_NEXT_SUBBUF_METADATA_CHECK:
        {
                struct lttng_metadata_stream *stream = filp->private_data;
-               struct lib_ring_buffer *buf = stream->priv;
+               struct lttng_kernel_ring_buffer *buf = stream->priv;
                struct lttng_kernel_ring_buffer_channel *chan = buf->backend.chan;
 
                ret = lttng_metadata_output_channel(stream, chan, &coherent);
@@ -1410,7 +1412,7 @@ long lttng_metadata_ring_buffer_compat_ioctl(struct file *filp,
 {
        int ret;
        struct lttng_metadata_stream *stream = filp->private_data;
-       struct lib_ring_buffer *buf = stream->priv;
+       struct lttng_kernel_ring_buffer *buf = stream->priv;
        unsigned int rb_cmd;
        bool coherent;
 
@@ -1423,7 +1425,7 @@ long lttng_metadata_ring_buffer_compat_ioctl(struct file *filp,
        case LTTNG_KERNEL_ABI_RING_BUFFER_GET_NEXT_SUBBUF:
        {
                struct lttng_metadata_stream *stream = filp->private_data;
-               struct lib_ring_buffer *buf = stream->priv;
+               struct lttng_kernel_ring_buffer *buf = stream->priv;
                struct lttng_kernel_ring_buffer_channel *chan = buf->backend.chan;
 
                ret = lttng_metadata_output_channel(stream, chan, NULL);
@@ -1441,11 +1443,12 @@ long lttng_metadata_ring_buffer_compat_ioctl(struct file *filp,
                 */
                return -ENOSYS;
        }
-       case LTTNG_KERNEL_ABI_RING_BUFFER_FLUSH_EMPTY:  /* Fall-through. */
+       case LTTNG_KERNEL_ABI_RING_BUFFER_FLUSH_EMPTY:
+               lttng_fallthrough;
        case LTTNG_KERNEL_ABI_RING_BUFFER_FLUSH:
        {
                struct lttng_metadata_stream *stream = filp->private_data;
-               struct lib_ring_buffer *buf = stream->priv;
+               struct lttng_kernel_ring_buffer *buf = stream->priv;
                struct lttng_kernel_ring_buffer_channel *chan = buf->backend.chan;
 
                /*
@@ -1472,7 +1475,7 @@ long lttng_metadata_ring_buffer_compat_ioctl(struct file *filp,
        case LTTNG_KERNEL_ABI_RING_BUFFER_GET_NEXT_SUBBUF_METADATA_CHECK:
        {
                struct lttng_metadata_stream *stream = filp->private_data;
-               struct lib_ring_buffer *buf = stream->priv;
+               struct lttng_kernel_ring_buffer *buf = stream->priv;
                struct lttng_kernel_ring_buffer_channel *chan = buf->backend.chan;
 
                ret = lttng_metadata_output_channel(stream, chan, &coherent);
@@ -1521,7 +1524,7 @@ static
 int lttng_metadata_ring_buffer_open(struct inode *inode, struct file *file)
 {
        struct lttng_metadata_stream *stream = inode->i_private;
-       struct lib_ring_buffer *buf = stream->priv;
+       struct lttng_kernel_ring_buffer *buf = stream->priv;
 
        file->private_data = buf;
        /*
@@ -1539,7 +1542,7 @@ static
 int lttng_metadata_ring_buffer_release(struct inode *inode, struct file *file)
 {
        struct lttng_metadata_stream *stream = file->private_data;
-       struct lib_ring_buffer *buf = stream->priv;
+       struct lttng_kernel_ring_buffer *buf = stream->priv;
 
        mutex_lock(&stream->metadata_cache->lock);
        list_del(&stream->list);
@@ -1556,7 +1559,7 @@ ssize_t lttng_metadata_ring_buffer_splice_read(struct file *in, loff_t *ppos,
                unsigned int flags)
 {
        struct lttng_metadata_stream *stream = in->private_data;
-       struct lib_ring_buffer *buf = stream->priv;
+       struct lttng_kernel_ring_buffer *buf = stream->priv;
 
        return lib_ring_buffer_splice_read(in, ppos, pipe, len,
                        flags, buf);
@@ -1567,7 +1570,7 @@ int lttng_metadata_ring_buffer_mmap(struct file *filp,
                struct vm_area_struct *vma)
 {
        struct lttng_metadata_stream *stream = filp->private_data;
-       struct lib_ring_buffer *buf = stream->priv;
+       struct lttng_kernel_ring_buffer *buf = stream->priv;
 
        return lib_ring_buffer_mmap(filp, vma, buf);
 }
@@ -1628,7 +1631,7 @@ static
 int lttng_abi_open_stream(struct file *channel_file)
 {
        struct lttng_kernel_channel_buffer *channel = channel_file->private_data;
-       struct lib_ring_buffer *buf;
+       struct lttng_kernel_ring_buffer *buf;
        int ret;
        void *stream_priv;
 
@@ -1655,7 +1658,7 @@ int lttng_abi_open_metadata_stream(struct file *channel_file)
 {
        struct lttng_kernel_channel_buffer *channel = channel_file->private_data;
        struct lttng_kernel_session *session = channel->parent.session;
-       struct lib_ring_buffer *buf;
+       struct lttng_kernel_ring_buffer *buf;
        int ret;
        struct lttng_metadata_stream *metadata_stream;
        void *stream_priv;
@@ -1721,7 +1724,7 @@ int lttng_abi_open_event_notifier_group_stream(struct file *notif_file)
 {
        struct lttng_event_notifier_group *event_notifier_group = notif_file->private_data;
        struct lttng_kernel_ring_buffer_channel *chan = event_notifier_group->chan;
-       struct lib_ring_buffer *buf;
+       struct lttng_kernel_ring_buffer *buf;
        int ret;
        void *stream_priv;
 
@@ -1758,8 +1761,10 @@ int lttng_abi_validate_event_param(struct lttng_kernel_abi_event *event_param)
        switch (event_param->instrumentation) {
        case LTTNG_KERNEL_ABI_SYSCALL:
                switch (event_param->u.syscall.entryexit) {
-               case LTTNG_KERNEL_ABI_SYSCALL_ENTRY:    /* Fall-through */
-               case LTTNG_KERNEL_ABI_SYSCALL_EXIT:             /* Fall-through */
+               case LTTNG_KERNEL_ABI_SYSCALL_ENTRY:
+                       lttng_fallthrough;
+               case LTTNG_KERNEL_ABI_SYSCALL_EXIT:
+                       lttng_fallthrough;
                case LTTNG_KERNEL_ABI_SYSCALL_ENTRYEXIT:
                        break;
                default:
@@ -1783,20 +1788,26 @@ int lttng_abi_validate_event_param(struct lttng_kernel_abi_event *event_param)
                switch (event_param->u.kretprobe.entryexit) {
                case LTTNG_KERNEL_ABI_SYSCALL_ENTRYEXIT:
                        break;
-               case LTTNG_KERNEL_ABI_SYSCALL_ENTRY:    /* Fall-through */
-               case LTTNG_KERNEL_ABI_SYSCALL_EXIT:             /* Fall-through */
+               case LTTNG_KERNEL_ABI_SYSCALL_ENTRY:
+                       lttng_fallthrough;
+               case LTTNG_KERNEL_ABI_SYSCALL_EXIT:
+                       lttng_fallthrough;
                default:
                        return -EINVAL;
                }
                break;
 
-       case LTTNG_KERNEL_ABI_TRACEPOINT:       /* Fall-through */
-       case LTTNG_KERNEL_ABI_KPROBE:   /* Fall-through */
+       case LTTNG_KERNEL_ABI_TRACEPOINT:
+               lttng_fallthrough;
+       case LTTNG_KERNEL_ABI_KPROBE:
+               lttng_fallthrough;
        case LTTNG_KERNEL_ABI_UPROBE:
                break;
 
-       case LTTNG_KERNEL_ABI_FUNCTION: /* Fall-through */
-       case LTTNG_KERNEL_ABI_NOOP:             /* Fall-through */
+       case LTTNG_KERNEL_ABI_FUNCTION:
+               lttng_fallthrough;
+       case LTTNG_KERNEL_ABI_NOOP:
+               lttng_fallthrough;
        default:
                return -EINVAL;
        }
@@ -1830,18 +1841,23 @@ int lttng_abi_create_event(struct file *channel_file,
        }
 
        switch (event_param->instrumentation) {
-       case LTTNG_KERNEL_ABI_TRACEPOINT:               /* Fall-through */
+       case LTTNG_KERNEL_ABI_TRACEPOINT:
+               lttng_fallthrough;
        case LTTNG_KERNEL_ABI_SYSCALL:
                fops = &lttng_event_recorder_enabler_fops;
                break;
-       case LTTNG_KERNEL_ABI_KPROBE:                   /* Fall-through */
-       case LTTNG_KERNEL_ABI_KRETPROBE:                /* Fall-through */
+       case LTTNG_KERNEL_ABI_KPROBE:
+               lttng_fallthrough;
+       case LTTNG_KERNEL_ABI_KRETPROBE:
+               lttng_fallthrough;
        case LTTNG_KERNEL_ABI_UPROBE:
                fops = &lttng_event_recorder_event_fops;
                break;
 
-       case LTTNG_KERNEL_ABI_FUNCTION:                 /* Fall-through */
-       case LTTNG_KERNEL_ABI_NOOP:                     /* Fall-through */
+       case LTTNG_KERNEL_ABI_FUNCTION:
+               lttng_fallthrough;
+       case LTTNG_KERNEL_ABI_NOOP:
+               lttng_fallthrough;
        default:
                return -EINVAL;
        }
@@ -1867,39 +1883,51 @@ int lttng_abi_create_event(struct file *channel_file,
                goto event_error;
 
        switch (event_param->instrumentation) {
-       case LTTNG_KERNEL_ABI_TRACEPOINT:               /* Fall-through */
+       case LTTNG_KERNEL_ABI_TRACEPOINT:
+               lttng_fallthrough;
        case LTTNG_KERNEL_ABI_SYSCALL:
        {
-               struct lttng_event_enabler *event_enabler;
+               struct lttng_event_recorder_enabler *event_enabler;
 
                if (strutils_is_star_glob_pattern(event_param->name)) {
                        /*
                         * If the event name is a star globbing pattern,
                         * we create the special star globbing enabler.
                         */
-                       event_enabler = lttng_event_enabler_create(LTTNG_ENABLER_FORMAT_STAR_GLOB,
+                       event_enabler = lttng_event_recorder_enabler_create(LTTNG_ENABLER_FORMAT_STAR_GLOB,
                                event_param, channel);
                } else {
-                       event_enabler = lttng_event_enabler_create(LTTNG_ENABLER_FORMAT_NAME,
+                       event_enabler = lttng_event_recorder_enabler_create(LTTNG_ENABLER_FORMAT_NAME,
                                event_param, channel);
                }
+               if (event_enabler)
+                       lttng_event_enabler_session_add(channel->parent.session, event_enabler);
                priv = event_enabler;
                break;
        }
 
-       case LTTNG_KERNEL_ABI_KPROBE:                   /* Fall-through */
-       case LTTNG_KERNEL_ABI_KRETPROBE:                /* Fall-through */
+       case LTTNG_KERNEL_ABI_KPROBE:
+               lttng_fallthrough;
+       case LTTNG_KERNEL_ABI_KRETPROBE:
+               lttng_fallthrough;
        case LTTNG_KERNEL_ABI_UPROBE:
        {
                struct lttng_kernel_event_recorder *event;
+               struct lttng_event_recorder_enabler *event_enabler;
 
+               event_enabler = lttng_event_recorder_enabler_create(LTTNG_ENABLER_FORMAT_NAME,
+                               event_param, channel);
+               if (!event_enabler) {
+                       ret = -ENOMEM;
+                       goto event_error;
+               }
                /*
                 * We tolerate no failure path after event creation. It
                 * will stay invariant for the rest of the session.
                 */
-               event = lttng_kernel_event_recorder_create(channel, event_param,
-                               NULL, event_param->instrumentation);
+               event = lttng_kernel_event_recorder_create(event_enabler, NULL);
                WARN_ON_ONCE(!event);
+               lttng_event_enabler_destroy(&event_enabler->parent);
                if (IS_ERR(event)) {
                        ret = PTR_ERR(event);
                        goto event_error;
@@ -1908,8 +1936,10 @@ int lttng_abi_create_event(struct file *channel_file,
                break;
        }
 
-       case LTTNG_KERNEL_ABI_FUNCTION:                 /* Fall-through */
-       case LTTNG_KERNEL_ABI_NOOP:                     /* Fall-through */
+       case LTTNG_KERNEL_ABI_FUNCTION:
+               lttng_fallthrough;
+       case LTTNG_KERNEL_ABI_NOOP:
+               lttng_fallthrough;
        default:
                ret = -EINVAL;
                goto event_error;
@@ -1957,12 +1987,11 @@ long lttng_event_notifier_enabler_ioctl(struct file *file, unsigned int cmd, uns
 
        switch (cmd) {
        case LTTNG_KERNEL_ABI_ENABLE:
-               return lttng_event_notifier_enabler_enable(event_notifier_enabler);
+               return lttng_event_enabler_enable(&event_notifier_enabler->parent);
        case LTTNG_KERNEL_ABI_DISABLE:
-               return lttng_event_notifier_enabler_disable(event_notifier_enabler);
+               return lttng_event_enabler_disable(&event_notifier_enabler->parent);
        case LTTNG_KERNEL_ABI_FILTER:
-               return lttng_event_notifier_enabler_attach_filter_bytecode(
-                               event_notifier_enabler,
+               return lttng_event_enabler_attach_filter_bytecode(&event_notifier_enabler->parent,
                        (struct lttng_kernel_abi_filter_bytecode __user *) arg);
        case LTTNG_KERNEL_ABI_CAPTURE:
                return lttng_event_notifier_enabler_attach_capture_bytecode(
@@ -2043,18 +2072,23 @@ int lttng_abi_create_event_notifier(struct file *event_notifier_group_file,
        }
 
        switch (event_notifier_param->event.instrumentation) {
-       case LTTNG_KERNEL_ABI_TRACEPOINT:               /* Fall-through */
+       case LTTNG_KERNEL_ABI_TRACEPOINT:
+               lttng_fallthrough;
        case LTTNG_KERNEL_ABI_SYSCALL:
                fops = &lttng_event_notifier_enabler_fops;
                break;
-       case LTTNG_KERNEL_ABI_KPROBE:                   /* Fall-through */
-       case LTTNG_KERNEL_ABI_KRETPROBE:                /* Fall-through */
+       case LTTNG_KERNEL_ABI_KPROBE:
+               lttng_fallthrough;
+       case LTTNG_KERNEL_ABI_KRETPROBE:
+               lttng_fallthrough;
        case LTTNG_KERNEL_ABI_UPROBE:
                fops = &lttng_event_notifier_event_fops;
                break;
 
-       case LTTNG_KERNEL_ABI_FUNCTION:                 /* Fall-through */
-       case LTTNG_KERNEL_ABI_NOOP:                     /* Fall-through */
+       case LTTNG_KERNEL_ABI_FUNCTION:
+               lttng_fallthrough;
+       case LTTNG_KERNEL_ABI_NOOP:
+               lttng_fallthrough;
        default:
                ret = -EINVAL;
                goto inval_instr;
@@ -2086,7 +2120,8 @@ int lttng_abi_create_event_notifier(struct file *event_notifier_group_file,
                goto event_notifier_error;
 
        switch (event_notifier_param->event.instrumentation) {
-       case LTTNG_KERNEL_ABI_TRACEPOINT:               /* Fall-through */
+       case LTTNG_KERNEL_ABI_TRACEPOINT:
+               lttng_fallthrough;
        case LTTNG_KERNEL_ABI_SYSCALL:
        {
                struct lttng_event_notifier_enabler *enabler;
@@ -2097,36 +2132,39 @@ int lttng_abi_create_event_notifier(struct file *event_notifier_group_file,
                         * we create the special star globbing enabler.
                         */
                        enabler = lttng_event_notifier_enabler_create(
-                                       event_notifier_group,
                                        LTTNG_ENABLER_FORMAT_STAR_GLOB,
-                                       event_notifier_param);
+                                       event_notifier_param,
+                                       event_notifier_group);
                } else {
                        enabler = lttng_event_notifier_enabler_create(
-                                       event_notifier_group,
                                        LTTNG_ENABLER_FORMAT_NAME,
-                                       event_notifier_param);
+                                       event_notifier_param,
+                                       event_notifier_group);
                }
+               if (enabler)
+                       lttng_event_notifier_enabler_group_add(event_notifier_group, enabler);
                priv = enabler;
                break;
        }
 
-       case LTTNG_KERNEL_ABI_KPROBE:                   /* Fall-through */
-       case LTTNG_KERNEL_ABI_KRETPROBE:                /* Fall-through */
+       case LTTNG_KERNEL_ABI_KPROBE:
+               lttng_fallthrough;
+       case LTTNG_KERNEL_ABI_KRETPROBE:
+               lttng_fallthrough;
        case LTTNG_KERNEL_ABI_UPROBE:
        {
                struct lttng_kernel_event_notifier *event_notifier;
+               struct lttng_event_notifier_enabler *event_notifier_enabler;
 
-               /*
-                * We tolerate no failure path after event notifier creation.
-                * It will stay invariant for the rest of the session.
-                */
-               event_notifier = lttng_event_notifier_create(NULL,
-                               event_notifier_param->event.token,
-                               event_notifier_param->error_counter_index,
-                               event_notifier_group,
-                               event_notifier_param,
-                               event_notifier_param->event.instrumentation);
+               event_notifier_enabler = lttng_event_notifier_enabler_create(LTTNG_ENABLER_FORMAT_NAME,
+                               event_notifier_param, event_notifier_group);
+               if (!event_notifier_enabler) {
+                       ret = -ENOMEM;
+                       goto event_notifier_error;
+               }
+               event_notifier = lttng_event_notifier_create(event_notifier_enabler, NULL);
                WARN_ON_ONCE(!event_notifier);
+               lttng_event_enabler_destroy(&event_notifier_enabler->parent);
                if (IS_ERR(event_notifier)) {
                        ret = PTR_ERR(event_notifier);
                        goto event_notifier_error;
@@ -2135,8 +2173,10 @@ int lttng_abi_create_event_notifier(struct file *event_notifier_group_file,
                break;
        }
 
-       case LTTNG_KERNEL_ABI_FUNCTION:                 /* Fall-through */
-       case LTTNG_KERNEL_ABI_NOOP:                     /* Fall-through */
+       case LTTNG_KERNEL_ABI_FUNCTION:
+               lttng_fallthrough;
+       case LTTNG_KERNEL_ABI_NOOP:
+               lttng_fallthrough;
        default:
                ret = -EINVAL;
                goto event_notifier_error;
@@ -2488,12 +2528,12 @@ old_ctx_end:
        }
        case LTTNG_KERNEL_ABI_OLD_ENABLE:
        case LTTNG_KERNEL_ABI_ENABLE:
-               return lttng_channel_enable(channel);
+               return lttng_channel_enable(&channel->parent);
        case LTTNG_KERNEL_ABI_OLD_DISABLE:
        case LTTNG_KERNEL_ABI_DISABLE:
-               return lttng_channel_disable(channel);
+               return lttng_channel_disable(&channel->parent);
        case LTTNG_KERNEL_ABI_SYSCALL_MASK:
-               return lttng_channel_syscall_mask(channel,
+               return lttng_syscall_table_get_active_mask(&channel->priv->parent.syscall_table,
                        (struct lttng_kernel_abi_syscall_mask __user *) arg);
        default:
                return -ENOIOCTLCMD;
@@ -2660,7 +2700,7 @@ long lttng_event_recorder_event_ioctl(struct file *file, unsigned int cmd, unsig
 static
 long lttng_event_recorder_enabler_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 {
-       struct lttng_event_enabler *event_enabler = file->private_data;
+       struct lttng_event_recorder_enabler *event_enabler = file->private_data;
 
        switch (cmd) {
        case LTTNG_KERNEL_ABI_OLD_CONTEXT:
@@ -2675,13 +2715,12 @@ long lttng_event_recorder_enabler_ioctl(struct file *file, unsigned int cmd, uns
        }
        case LTTNG_KERNEL_ABI_OLD_ENABLE:
        case LTTNG_KERNEL_ABI_ENABLE:
-               return lttng_event_enabler_enable(event_enabler);
+               return lttng_event_enabler_enable(&event_enabler->parent);
        case LTTNG_KERNEL_ABI_OLD_DISABLE:
        case LTTNG_KERNEL_ABI_DISABLE:
-               return lttng_event_enabler_disable(event_enabler);
+               return lttng_event_enabler_disable(&event_enabler->parent);
        case LTTNG_KERNEL_ABI_FILTER:
-               return lttng_event_enabler_attach_filter_bytecode(
-                       event_enabler,
+               return lttng_event_enabler_attach_filter_bytecode(&event_enabler->parent,
                        (struct lttng_kernel_abi_filter_bytecode __user *) arg);
        case LTTNG_KERNEL_ABI_ADD_CALLSITE:
                return -EINVAL;
@@ -2703,7 +2742,7 @@ int lttng_event_recorder_event_release(struct inode *inode, struct file *file)
 static
 int lttng_event_recorder_enabler_release(struct inode *inode, struct file *file)
 {
-       struct lttng_event_enabler *event_enabler = file->private_data;
+       struct lttng_event_recorder_enabler *event_enabler = file->private_data;
 
        if (event_enabler)
                fput(event_enabler->chan->priv->parent.file);
@@ -2741,9 +2780,9 @@ static int put_u32(uint32_t val, unsigned long arg)
 static long lttng_stream_ring_buffer_ioctl(struct file *filp,
                unsigned int cmd, unsigned long arg)
 {
-       struct lib_ring_buffer *buf = filp->private_data;
+       struct lttng_kernel_ring_buffer *buf = filp->private_data;
        struct lttng_kernel_ring_buffer_channel *chan = buf->backend.chan;
-       const struct lib_ring_buffer_config *config = &chan->backend.config;
+       const struct lttng_kernel_ring_buffer_config *config = &chan->backend.config;
        const struct lttng_kernel_channel_buffer_ops *ops = chan->backend.priv_ops;
        int ret;
 
@@ -2845,9 +2884,9 @@ error:
 static long lttng_stream_ring_buffer_compat_ioctl(struct file *filp,
                unsigned int cmd, unsigned long arg)
 {
-       struct lib_ring_buffer *buf = filp->private_data;
+       struct lttng_kernel_ring_buffer *buf = filp->private_data;
        struct lttng_kernel_ring_buffer_channel *chan = buf->backend.chan;
-       const struct lib_ring_buffer_config *config = &chan->backend.config;
+       const struct lttng_kernel_ring_buffer_config *config = &chan->backend.config;
        const struct lttng_kernel_channel_buffer_ops *ops = chan->backend.priv_ops;
        int ret;
 
This page took 0.03202 seconds and 4 git commands to generate.