Refactoring: combine event hash tables common code
[lttng-modules.git] / src / lttng-syscalls.c
index 33f05ea358b13a45e0dbd115acfd8f666b5f3b1b..ff14dbbb0998782de88d72feae3aeef86c82f711 100644 (file)
@@ -132,6 +132,9 @@ struct lttng_syscall_filter {
        DECLARE_BITMAP(sc_compat_exit, NR_compat_syscalls);
 };
 
+static
+int lttng_syscalls_create_matching_event_notifiers(struct lttng_event_enabler_common *event_enabler);
+
 static void syscall_entry_event_unknown(struct hlist_head *unknown_action_list_head,
        struct pt_regs *regs, long id)
 {
@@ -613,46 +616,20 @@ int lttng_create_syscall_event_if_missing(const struct trace_syscall_entry *tabl
        return 0;
 }
 
-/*
- * Should be called with sessions lock held.
- */
-int lttng_syscalls_register_event(struct lttng_event_recorder_enabler *syscall_event_enabler)
+static
+int lttng_syscalls_populate_events(struct lttng_event_enabler_common *syscall_event_enabler)
 {
-       struct lttng_kernel_syscall_table *syscall_table = get_syscall_table_from_enabler(&syscall_event_enabler->parent);
+       struct lttng_kernel_syscall_table *syscall_table = get_syscall_table_from_enabler(syscall_event_enabler);
+       struct lttng_event_recorder_enabler *event_recorder_enabler;
+       struct lttng_kernel_channel_buffer *chan;
        struct lttng_kernel_abi_event ev;
        int ret;
 
-       wrapper_vmalloc_sync_mappings();
-
-       if (!syscall_table->syscall_dispatch) {
-               /* create syscall table mapping syscall to events */
-               syscall_table->syscall_dispatch = kzalloc(sizeof(struct hlist_head) * sc_table.len, GFP_KERNEL);
-               if (!syscall_table->syscall_dispatch)
-                       return -ENOMEM;
-       }
-       if (!syscall_table->syscall_exit_dispatch) {
-               /* create syscall table mapping syscall to events */
-               syscall_table->syscall_exit_dispatch = kzalloc(sizeof(struct hlist_head) * sc_exit_table.len, GFP_KERNEL);
-               if (!syscall_table->syscall_exit_dispatch)
-                       return -ENOMEM;
-       }
-
-
-#ifdef CONFIG_COMPAT
-       if (!syscall_table->compat_syscall_dispatch) {
-               /* create syscall table mapping compat syscall to events */
-               syscall_table->compat_syscall_dispatch = kzalloc(sizeof(struct hlist_head) * compat_sc_table.len, GFP_KERNEL);
-               if (!syscall_table->compat_syscall_dispatch)
-                       return -ENOMEM;
-       }
+       if (syscall_event_enabler->enabler_type != LTTNG_EVENT_ENABLER_TYPE_RECORDER)
+               return 0;
+       event_recorder_enabler = container_of(syscall_event_enabler, struct lttng_event_recorder_enabler, parent);
+       chan = event_recorder_enabler->chan;
 
-       if (!syscall_table->compat_syscall_exit_dispatch) {
-               /* create syscall table mapping compat syscall to events */
-               syscall_table->compat_syscall_exit_dispatch = kzalloc(sizeof(struct hlist_head) * compat_sc_exit_table.len, GFP_KERNEL);
-               if (!syscall_table->compat_syscall_exit_dispatch)
-                       return -ENOMEM;
-       }
-#endif
        if (hlist_empty(&syscall_table->unknown_syscall_dispatch)) {
                const struct lttng_kernel_event_desc *desc =
                        &__event_desc___syscall_entry_unknown;
@@ -665,7 +642,7 @@ int lttng_syscalls_register_event(struct lttng_event_recorder_enabler *syscall_e
                ev.instrumentation = LTTNG_KERNEL_ABI_SYSCALL;
                ev.u.syscall.entryexit = LTTNG_KERNEL_ABI_SYSCALL_ENTRY;
                ev.u.syscall.abi = LTTNG_KERNEL_ABI_SYSCALL_ABI_NATIVE;
-               event_enabler = lttng_event_recorder_enabler_create(LTTNG_ENABLER_FORMAT_NAME, &ev, syscall_event_enabler->chan);
+               event_enabler = lttng_event_recorder_enabler_create(LTTNG_ENABLER_FORMAT_NAME, &ev, chan);
                if (!event_enabler) {
                        return -ENOMEM;
                }
@@ -690,7 +667,7 @@ int lttng_syscalls_register_event(struct lttng_event_recorder_enabler *syscall_e
                ev.instrumentation = LTTNG_KERNEL_ABI_SYSCALL;
                ev.u.syscall.entryexit = LTTNG_KERNEL_ABI_SYSCALL_ENTRY;
                ev.u.syscall.abi = LTTNG_KERNEL_ABI_SYSCALL_ABI_COMPAT;
-               event_enabler = lttng_event_recorder_enabler_create(LTTNG_ENABLER_FORMAT_NAME, &ev, syscall_event_enabler->chan);
+               event_enabler = lttng_event_recorder_enabler_create(LTTNG_ENABLER_FORMAT_NAME, &ev, chan);
                if (!event_enabler) {
                        return -ENOMEM;
                }
@@ -715,7 +692,7 @@ int lttng_syscalls_register_event(struct lttng_event_recorder_enabler *syscall_e
                ev.instrumentation = LTTNG_KERNEL_ABI_SYSCALL;
                ev.u.syscall.entryexit = LTTNG_KERNEL_ABI_SYSCALL_EXIT;
                ev.u.syscall.abi = LTTNG_KERNEL_ABI_SYSCALL_ABI_COMPAT;
-               event_enabler = lttng_event_recorder_enabler_create(LTTNG_ENABLER_FORMAT_NAME, &ev, syscall_event_enabler->chan);
+               event_enabler = lttng_event_recorder_enabler_create(LTTNG_ENABLER_FORMAT_NAME, &ev, chan);
                if (!event_enabler) {
                        return -ENOMEM;
                }
@@ -740,7 +717,7 @@ int lttng_syscalls_register_event(struct lttng_event_recorder_enabler *syscall_e
                ev.instrumentation = LTTNG_KERNEL_ABI_SYSCALL;
                ev.u.syscall.entryexit = LTTNG_KERNEL_ABI_SYSCALL_EXIT;
                ev.u.syscall.abi = LTTNG_KERNEL_ABI_SYSCALL_ABI_NATIVE;
-               event_enabler = lttng_event_recorder_enabler_create(LTTNG_ENABLER_FORMAT_NAME, &ev, syscall_event_enabler->chan);
+               event_enabler = lttng_event_recorder_enabler_create(LTTNG_ENABLER_FORMAT_NAME, &ev, chan);
                if (!event_enabler) {
                        return -ENOMEM;
                }
@@ -754,96 +731,64 @@ int lttng_syscalls_register_event(struct lttng_event_recorder_enabler *syscall_e
        }
 
        ret = lttng_create_syscall_event_if_missing(sc_table.table, sc_table.len,
-                       syscall_table->syscall_dispatch, syscall_event_enabler, SC_TYPE_ENTRY);
+                       syscall_table->syscall_dispatch, event_recorder_enabler, SC_TYPE_ENTRY);
        if (ret)
                return ret;
        ret = lttng_create_syscall_event_if_missing(sc_exit_table.table, sc_exit_table.len,
-                       syscall_table->syscall_exit_dispatch, syscall_event_enabler, SC_TYPE_EXIT);
+                       syscall_table->syscall_exit_dispatch, event_recorder_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,
-                       syscall_table->compat_syscall_dispatch, syscall_event_enabler, SC_TYPE_COMPAT_ENTRY);
+                       syscall_table->compat_syscall_dispatch, event_recorder_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,
-                       syscall_table->compat_syscall_exit_dispatch, syscall_event_enabler, SC_TYPE_COMPAT_EXIT);
+                       syscall_table->compat_syscall_exit_dispatch, event_recorder_enabler, SC_TYPE_COMPAT_EXIT);
        if (ret)
                return ret;
 #endif
-
-       if (!syscall_table->sc_filter) {
-               syscall_table->sc_filter = kzalloc(sizeof(struct lttng_syscall_filter),
-                               GFP_KERNEL);
-               if (!syscall_table->sc_filter)
-                       return -ENOMEM;
-       }
-
-       if (!syscall_table->sys_enter_registered) {
-               ret = lttng_wrapper_tracepoint_probe_register("sys_enter",
-                               (void *) syscall_entry_event_probe, syscall_table);
-               if (ret)
-                       return ret;
-               syscall_table->sys_enter_registered = 1;
-       }
-       /*
-        * We change the name of sys_exit tracepoint due to namespace
-        * conflict with sys_exit syscall entry.
-        */
-       if (!syscall_table->sys_exit_registered) {
-               ret = lttng_wrapper_tracepoint_probe_register("sys_exit",
-                               (void *) syscall_exit_event_probe, syscall_table);
-               if (ret) {
-                       WARN_ON_ONCE(lttng_wrapper_tracepoint_probe_unregister("sys_enter",
-                               (void *) syscall_entry_event_probe, syscall_table));
-                       return ret;
-               }
-               syscall_table->sys_exit_registered = 1;
-       }
        return ret;
 }
 
 /*
  * Should be called with sessions lock held.
  */
-int lttng_syscalls_register_event_notifier(
-               struct lttng_event_notifier_enabler *event_notifier_enabler)
+int lttng_syscalls_register_event(struct lttng_event_enabler_common *syscall_event_enabler)
 {
-       struct lttng_event_notifier_group *group = event_notifier_enabler->group;
-       struct lttng_kernel_syscall_table *syscall_table = &group->syscall_table;
-       int ret = 0;
-
-       wrapper_vmalloc_sync_mappings();
+       struct lttng_kernel_syscall_table *syscall_table = get_syscall_table_from_enabler(syscall_event_enabler);
+       int ret;
 
        if (!syscall_table->syscall_dispatch) {
+               /* create syscall table mapping syscall to events */
                syscall_table->syscall_dispatch = kzalloc(sizeof(struct hlist_head) * sc_table.len, GFP_KERNEL);
                if (!syscall_table->syscall_dispatch)
                        return -ENOMEM;
        }
-
        if (!syscall_table->syscall_exit_dispatch) {
-               syscall_table->syscall_exit_dispatch = kzalloc(sizeof(struct hlist_head) * sc_table.len, GFP_KERNEL);
+               /* create syscall table mapping syscall to events */
+               syscall_table->syscall_exit_dispatch = kzalloc(sizeof(struct hlist_head) * sc_exit_table.len, GFP_KERNEL);
                if (!syscall_table->syscall_exit_dispatch)
                        return -ENOMEM;
        }
 
+
 #ifdef CONFIG_COMPAT
        if (!syscall_table->compat_syscall_dispatch) {
+               /* create syscall table mapping compat syscall to events */
                syscall_table->compat_syscall_dispatch = kzalloc(sizeof(struct hlist_head) * compat_sc_table.len, GFP_KERNEL);
                if (!syscall_table->compat_syscall_dispatch)
                        return -ENOMEM;
        }
 
        if (!syscall_table->compat_syscall_exit_dispatch) {
-               syscall_table->compat_syscall_exit_dispatch =
-                               kzalloc(sizeof(struct hlist_head) * compat_sc_exit_table.len,
-                                       GFP_KERNEL);
+               /* create syscall table mapping compat syscall to events */
+               syscall_table->compat_syscall_exit_dispatch = kzalloc(sizeof(struct hlist_head) * compat_sc_exit_table.len, GFP_KERNEL);
                if (!syscall_table->compat_syscall_exit_dispatch)
                        return -ENOMEM;
        }
 #endif
-
        if (!syscall_table->sc_filter) {
                syscall_table->sc_filter = kzalloc(sizeof(struct lttng_syscall_filter),
                                GFP_KERNEL);
@@ -851,6 +796,12 @@ int lttng_syscalls_register_event_notifier(
                        return -ENOMEM;
        }
 
+       ret = lttng_syscalls_populate_events(syscall_event_enabler);
+       if (ret)
+               return ret;
+
+       wrapper_vmalloc_sync_mappings();
+
        if (!syscall_table->sys_enter_registered) {
                ret = lttng_wrapper_tracepoint_probe_register("sys_enter",
                                (void *) syscall_entry_event_probe, syscall_table);
@@ -858,7 +809,6 @@ int lttng_syscalls_register_event_notifier(
                        return ret;
                syscall_table->sys_enter_registered = 1;
        }
-
        if (!syscall_table->sys_exit_registered) {
                ret = lttng_wrapper_tracepoint_probe_register("sys_exit",
                                (void *) syscall_exit_event_probe, syscall_table);
@@ -870,6 +820,10 @@ int lttng_syscalls_register_event_notifier(
                syscall_table->sys_exit_registered = 1;
        }
 
+       ret = lttng_syscalls_create_matching_event_notifiers(syscall_event_enabler);
+       if (ret)
+               return ret;
+
        return ret;
 }
 
@@ -927,8 +881,8 @@ int create_unknown_event_notifier(
        /*
         * Check if already created.
         */
-       head = utils_borrow_hash_table_bucket(group->event_notifiers_ht.table,
-               LTTNG_EVENT_NOTIFIER_HT_SIZE, desc->event_name);
+       head = utils_borrow_hash_table_bucket(group->events_ht.table,
+               LTTNG_EVENT_HT_SIZE, desc->event_name);
        lttng_hlist_for_each_entry(event_notifier_priv, head, hlist) {
                if (event_notifier_priv->parent.desc == desc &&
                                event_notifier_priv->parent.user_token == base_enabler->user_token)
@@ -996,8 +950,8 @@ static int create_matching_event_notifiers(
                /*
                 * Check if already created.
                 */
-               head = utils_borrow_hash_table_bucket(group->event_notifiers_ht.table,
-                       LTTNG_EVENT_NOTIFIER_HT_SIZE, desc->event_name);
+               head = utils_borrow_hash_table_bucket(group->events_ht.table,
+                       LTTNG_EVENT_HT_SIZE, desc->event_name);
                lttng_hlist_for_each_entry(event_notifier_priv, head, hlist) {
                        if (event_notifier_priv->parent.desc == desc
                                && event_notifier_priv->parent.user_token == event_notifier_enabler->parent.user_token)
@@ -1048,14 +1002,17 @@ end:
 
 }
 
-int lttng_syscalls_create_matching_event_notifiers(
-               struct lttng_event_notifier_enabler *event_notifier_enabler)
+static
+int lttng_syscalls_create_matching_event_notifiers(struct lttng_event_enabler_common *event_enabler)
 {
        int ret;
-       struct lttng_event_enabler_common *base_enabler =
-                       lttng_event_notifier_enabler_as_enabler(event_notifier_enabler);
        enum lttng_kernel_abi_syscall_entryexit entryexit =
-                       base_enabler->event_param.u.syscall.entryexit;
+                       event_enabler->event_param.u.syscall.entryexit;
+       struct lttng_event_notifier_enabler *event_notifier_enabler;
+
+       if (event_enabler->enabler_type != LTTNG_EVENT_ENABLER_TYPE_NOTIFIER)
+               return 0;
+       event_notifier_enabler = container_of(event_enabler, struct lttng_event_notifier_enabler, parent);
 
        if (entryexit == LTTNG_KERNEL_ABI_SYSCALL_ENTRY || entryexit == LTTNG_KERNEL_ABI_SYSCALL_ENTRYEXIT) {
                ret = create_matching_event_notifiers(event_notifier_enabler,
@@ -1108,47 +1065,8 @@ end:
        return ret;
 }
 
-/*
- * Unregister the syscall event_notifier probes from the callsites.
- */
-int lttng_syscalls_unregister_event_notifier_group(
-               struct lttng_event_notifier_group *event_notifier_group)
+int lttng_syscalls_unregister_syscall_table(struct lttng_kernel_syscall_table *syscall_table)
 {
-       struct lttng_kernel_syscall_table *syscall_table = &event_notifier_group->syscall_table;
-       int ret;
-
-       /*
-        * Only register the event_notifier probe on the `sys_enter` callsite for now.
-        * At the moment, we don't think it's desirable to have one fired
-        * event_notifier for the entry and one for the exit of a syscall.
-        */
-       if (syscall_table->sys_enter_registered) {
-               ret = lttng_wrapper_tracepoint_probe_unregister("sys_enter",
-                               (void *) syscall_entry_event_probe, syscall_table);
-               if (ret)
-                       return ret;
-               syscall_table->sys_enter_registered = 0;
-       }
-       if (syscall_table->sys_exit_registered) {
-               ret = lttng_wrapper_tracepoint_probe_unregister("sys_exit",
-                               (void *) syscall_exit_event_probe, syscall_table);
-               if (ret)
-                       return ret;
-               syscall_table->sys_enter_registered = 0;
-       }
-
-       kfree(syscall_table->syscall_dispatch);
-       kfree(syscall_table->syscall_exit_dispatch);
-#ifdef CONFIG_COMPAT
-       kfree(syscall_table->compat_syscall_dispatch);
-       kfree(syscall_table->compat_syscall_exit_dispatch);
-#endif
-       return 0;
-}
-
-int lttng_syscalls_unregister_channel(struct lttng_kernel_channel_buffer *chan)
-{
-       struct lttng_kernel_syscall_table *syscall_table = &chan->priv->parent.syscall_table;
        int ret;
 
        if (!syscall_table->syscall_dispatch)
@@ -1170,10 +1088,8 @@ int lttng_syscalls_unregister_channel(struct lttng_kernel_channel_buffer *chan)
        return 0;
 }
 
-int lttng_syscalls_destroy_channel(struct lttng_kernel_channel_buffer *chan)
+int lttng_syscalls_destroy_syscall_table(struct lttng_kernel_syscall_table *syscall_table)
 {
-       struct lttng_kernel_syscall_table *syscall_table = &chan->priv->parent.syscall_table;
-
        kfree(syscall_table->syscall_dispatch);
        kfree(syscall_table->syscall_exit_dispatch);
 #ifdef CONFIG_COMPAT
@@ -1329,73 +1245,68 @@ int lttng_syscall_filter_enable(
        return 0;
 }
 
-int lttng_syscall_filter_enable_event_notifier(struct lttng_kernel_event_notifier *event_notifier)
+int lttng_syscall_filter_enable_event(struct lttng_kernel_event_common *event)
 {
-       struct lttng_event_notifier_group *group = event_notifier->priv->group;
-       struct lttng_kernel_syscall_table *syscall_table = &group->syscall_table;
-       unsigned int syscall_id = event_notifier->priv->parent.u.syscall.syscall_id;
-       struct hlist_head *dispatch_list;
-       int ret = 0;
+       struct lttng_kernel_syscall_table *syscall_table = get_syscall_table_from_event(event);
+       int ret;
 
-       WARN_ON_ONCE(event_notifier->priv->parent.instrumentation != LTTNG_KERNEL_ABI_SYSCALL);
+       WARN_ON_ONCE(event->priv->instrumentation != LTTNG_KERNEL_ABI_SYSCALL);
 
        ret = lttng_syscall_filter_enable(syscall_table->sc_filter,
-               event_notifier->priv->parent.desc->event_name,
-               event_notifier->priv->parent.u.syscall.abi,
-               event_notifier->priv->parent.u.syscall.entryexit);
-       if (ret) {
-               goto end;
-       }
+               event->priv->desc->event_name, event->priv->u.syscall.abi,
+               event->priv->u.syscall.entryexit);
+       if (ret)
+               return ret;
 
-       switch (event_notifier->priv->parent.u.syscall.entryexit) {
-       case LTTNG_SYSCALL_ENTRY:
-               switch (event_notifier->priv->parent.u.syscall.abi) {
-               case LTTNG_SYSCALL_ABI_NATIVE:
-                       dispatch_list = &syscall_table->syscall_dispatch[syscall_id];
-                       break;
-               case LTTNG_SYSCALL_ABI_COMPAT:
-                       dispatch_list = &syscall_table->compat_syscall_dispatch[syscall_id];
-                       break;
-               default:
-                       ret = -EINVAL;
-                       goto end;
-               }
+       switch (event->type) {
+       case LTTNG_KERNEL_EVENT_TYPE_RECORDER:
                break;
-       case LTTNG_SYSCALL_EXIT:
-               switch (event_notifier->priv->parent.u.syscall.abi) {
-               case LTTNG_SYSCALL_ABI_NATIVE:
-                       dispatch_list = &syscall_table->syscall_exit_dispatch[syscall_id];
+       case LTTNG_KERNEL_EVENT_TYPE_NOTIFIER:
+       {
+               unsigned int syscall_id = event->priv->u.syscall.syscall_id;
+               struct hlist_head *dispatch_list;
+
+               switch (event->priv->u.syscall.entryexit) {
+               case LTTNG_SYSCALL_ENTRY:
+                       switch (event->priv->u.syscall.abi) {
+                       case LTTNG_SYSCALL_ABI_NATIVE:
+                               dispatch_list = &syscall_table->syscall_dispatch[syscall_id];
+                               break;
+                       case LTTNG_SYSCALL_ABI_COMPAT:
+                               dispatch_list = &syscall_table->compat_syscall_dispatch[syscall_id];
+                               break;
+                       default:
+                               ret = -EINVAL;
+                               goto end;
+                       }
                        break;
-               case LTTNG_SYSCALL_ABI_COMPAT:
-                       dispatch_list = &syscall_table->compat_syscall_exit_dispatch[syscall_id];
+               case LTTNG_SYSCALL_EXIT:
+                       switch (event->priv->u.syscall.abi) {
+                       case LTTNG_SYSCALL_ABI_NATIVE:
+                               dispatch_list = &syscall_table->syscall_exit_dispatch[syscall_id];
+                               break;
+                       case LTTNG_SYSCALL_ABI_COMPAT:
+                               dispatch_list = &syscall_table->compat_syscall_exit_dispatch[syscall_id];
+                               break;
+                       default:
+                               ret = -EINVAL;
+                               goto end;
+                       }
                        break;
                default:
                        ret = -EINVAL;
                        goto end;
                }
+
+               hlist_add_head_rcu(&event->priv->u.syscall.node, dispatch_list);
                break;
+       }
        default:
-               ret = -EINVAL;
-               goto end;
+               WARN_ON_ONCE(1);
+               return -ENOSYS;
        }
-
-       hlist_add_head_rcu(&event_notifier->priv->parent.u.syscall.node, dispatch_list);
-
 end:
-       return ret ;
-}
-
-int lttng_syscall_filter_enable_event_recorder(struct lttng_kernel_event_recorder *event_recorder)
-{
-       struct lttng_kernel_channel_buffer *channel = event_recorder->chan;
-       struct lttng_kernel_syscall_table *syscall_table = &channel->priv->parent.syscall_table;
-
-       WARN_ON_ONCE(event_recorder->priv->parent.instrumentation != LTTNG_KERNEL_ABI_SYSCALL);
-
-       return lttng_syscall_filter_enable(syscall_table->sc_filter,
-               event_recorder->priv->parent.desc->event_name,
-               event_recorder->priv->parent.u.syscall.abi,
-               event_recorder->priv->parent.u.syscall.entryexit);
+       return ret;
 }
 
 static
@@ -1457,35 +1368,32 @@ int lttng_syscall_filter_disable(struct lttng_syscall_filter *filter,
        return 0;
 }
 
-int lttng_syscall_filter_disable_event_notifier(struct lttng_kernel_event_notifier *event_notifier)
+int lttng_syscall_filter_disable_event(struct lttng_kernel_event_common *event)
 {
-       struct lttng_event_notifier_group *group = event_notifier->priv->group;
-       struct lttng_kernel_syscall_table *syscall_table = &group->syscall_table;
+       struct lttng_kernel_syscall_table *syscall_table = get_syscall_table_from_event(event);
        int ret;
 
-       WARN_ON_ONCE(event_notifier->priv->parent.instrumentation != LTTNG_KERNEL_ABI_SYSCALL);
-
        ret = lttng_syscall_filter_disable(syscall_table->sc_filter,
-               event_notifier->priv->parent.desc->event_name,
-               event_notifier->priv->parent.u.syscall.abi,
-               event_notifier->priv->parent.u.syscall.entryexit);
-       WARN_ON_ONCE(ret != 0);
+               event->priv->desc->event_name, event->priv->u.syscall.abi,
+               event->priv->u.syscall.entryexit);
+       if (ret)
+               return ret;
 
-       hlist_del_rcu(&event_notifier->priv->parent.u.syscall.node);
+       switch (event->type) {
+       case LTTNG_KERNEL_EVENT_TYPE_RECORDER:
+               break;
+       case LTTNG_KERNEL_EVENT_TYPE_NOTIFIER:
+       {
+               hlist_del_rcu(&event->priv->u.syscall.node);
+               break;
+       }
+       default:
+               WARN_ON_ONCE(1);
+               return -ENOSYS;
+       }
        return 0;
 }
 
-int lttng_syscall_filter_disable_event_recorder(struct lttng_kernel_event_recorder *event_recorder)
-{
-       struct lttng_kernel_channel_buffer *channel = event_recorder->chan;
-       struct lttng_kernel_syscall_table *syscall_table = &channel->priv->parent.syscall_table;
-
-       return lttng_syscall_filter_disable(syscall_table->sc_filter,
-               event_recorder->priv->parent.desc->event_name,
-               event_recorder->priv->parent.u.syscall.abi,
-               event_recorder->priv->parent.u.syscall.entryexit);
-}
-
 static
 const struct trace_syscall_entry *syscall_list_get_entry(loff_t *pos)
 {
@@ -1600,10 +1508,9 @@ 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_kernel_channel_buffer *channel,
+long lttng_syscall_table_get_active_mask(struct lttng_kernel_syscall_table *syscall_table,
                struct lttng_kernel_abi_syscall_mask __user *usyscall_mask)
 {
-       struct lttng_kernel_syscall_table *syscall_table = &channel->priv->parent.syscall_table;
        uint32_t len, sc_tables_len, bitmask_len;
        int ret = 0, bit;
        char *tmp_mask;
This page took 0.029123 seconds and 4 git commands to generate.