ABI: use enable a syscall ABI field name
[lttng-modules.git] / lttng-abi.c
index 6dc59aed5c58465380c49980646236de03a2f94d..41e5e450b61babc1cda9d18a3b0594c417df1b66 100644 (file)
@@ -143,6 +143,43 @@ fd_error:
        return ret;
 }
 
+static
+int lttng_abi_syscall_list(void)
+{
+       struct file *syscall_list_file;
+       int file_fd, ret;
+
+       file_fd = get_unused_fd();
+       if (file_fd < 0) {
+               ret = file_fd;
+               goto fd_error;
+       }
+
+       syscall_list_file = anon_inode_getfile("[lttng_syscall_list]",
+                                         &lttng_syscall_list_fops,
+                                         NULL, O_RDWR);
+       if (IS_ERR(syscall_list_file)) {
+               ret = PTR_ERR(syscall_list_file);
+               goto file_error;
+       }
+       ret = lttng_syscall_list_fops.open(NULL, syscall_list_file);
+       if (ret < 0)
+               goto open_error;
+       fd_install(file_fd, syscall_list_file);
+       if (file_fd < 0) {
+               ret = file_fd;
+               goto fd_error;
+       }
+       return file_fd;
+
+open_error:
+       fput(syscall_list_file);
+file_error:
+       put_unused_fd(file_fd);
+fd_error:
+       return ret;
+}
+
 static
 void lttng_abi_tracer_version(struct lttng_kernel_tracer_version *v)
 {
@@ -249,6 +286,8 @@ long lttng_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
        case LTTNG_KERNEL_OLD_TRACEPOINT_LIST:
        case LTTNG_KERNEL_TRACEPOINT_LIST:
                return lttng_abi_tracepoint_list();
+       case LTTNG_KERNEL_SYSCALL_LIST:
+               return lttng_abi_syscall_list();
        case LTTNG_KERNEL_OLD_WAIT_QUIESCENT:
        case LTTNG_KERNEL_WAIT_QUIESCENT:
                synchronize_trace();
@@ -929,14 +968,15 @@ int lttng_abi_create_event(struct file *channel_file,
                if (ret)
                        goto fd_error;
                event_fd = 0;
-               if (event_param->u.syscall.disable) {
-                       ret = lttng_syscall_filter_disable(channel,
+               if (event_param->u.syscall.enable) {
+                       ret = lttng_syscall_filter_enable(channel,
                                event_param->name[0] == '\0' ?
                                        NULL : event_param->name);
                        if (ret)
                                goto fd_error;
+
                } else {
-                       ret = lttng_syscall_filter_enable(channel,
+                       ret = lttng_syscall_filter_disable(channel,
                                event_param->name[0] == '\0' ?
                                        NULL : event_param->name);
                        if (ret)
This page took 0.024347 seconds and 4 git commands to generate.