Refactoring: event create: use lttng_get_event_list_head_from_enabler
[lttng-modules.git] / src / lttng-syscalls.c
index 2c3b8af028b609a2839423c4f253168098f1511b..d26dd83fc15763b5ecbc5970ad5c29c3bc66d186 100644 (file)
@@ -554,8 +554,8 @@ int lttng_create_syscall_event_if_missing(const struct trace_syscall_entry *tabl
                        /* Unknown syscall */
                        continue;
                }
-               if (lttng_desc_match_enabler(desc,
-                               lttng_event_recorder_enabler_as_enabler(syscall_event_enabler)) <= 0)
+               if (!lttng_desc_match_enabler(desc,
+                               lttng_event_recorder_enabler_as_enabler(syscall_event_enabler)))
                        continue;
                /*
                 * Check if already created.
@@ -1397,6 +1397,29 @@ int lttng_syscall_filter_disable_event(struct lttng_kernel_event_common *event)
        return 0;
 }
 
+void lttng_syscall_table_set_wildcard_all(struct lttng_event_enabler_common *event_enabler)
+{
+       struct lttng_kernel_syscall_table *syscall_table = get_syscall_table_from_enabler(event_enabler);
+       enum lttng_kernel_abi_syscall_entryexit entryexit;
+       int enabled = event_enabler->enabled;
+
+       if (event_enabler->event_param.instrumentation != LTTNG_KERNEL_ABI_SYSCALL)
+               return;
+       if (event_enabler->event_param.u.syscall.abi != LTTNG_KERNEL_ABI_SYSCALL_ABI_ALL)
+               return;
+       if (event_enabler->event_param.u.syscall.match != LTTNG_KERNEL_ABI_SYSCALL_MATCH_NAME)
+               return;
+       if (strcmp(event_enabler->event_param.name, "*"))
+               return;
+
+       entryexit = event_enabler->event_param.u.syscall.entryexit;
+       if (entryexit == LTTNG_KERNEL_ABI_SYSCALL_ENTRY || entryexit == LTTNG_KERNEL_ABI_SYSCALL_ENTRYEXIT)
+               WRITE_ONCE(syscall_table->syscall_all_entry, enabled);
+
+       if (entryexit == LTTNG_KERNEL_ABI_SYSCALL_EXIT || entryexit == LTTNG_KERNEL_ABI_SYSCALL_ENTRYEXIT)
+               WRITE_ONCE(syscall_table->syscall_all_exit, enabled);
+}
+
 static
 const struct trace_syscall_entry *syscall_list_get_entry(loff_t *pos)
 {
This page took 0.023563 seconds and 4 git commands to generate.