X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=lttng-abi.c;h=41e5e450b61babc1cda9d18a3b0594c417df1b66;hb=f046a95d1c0f66297332962fb5fd1b715367b69d;hp=cffebcd8b0fc60a646101d02553bc87a269a6272;hpb=de23d59d5992b7354b57a533b4d582809ef8d43c;p=lttng-modules.git diff --git a/lttng-abi.c b/lttng-abi.c index cffebcd8..41e5e450 100644 --- a/lttng-abi.c +++ b/lttng-abi.c @@ -118,7 +118,7 @@ int lttng_abi_tracepoint_list(void) goto fd_error; } - tracepoint_list_file = anon_inode_getfile("[lttng_session]", + tracepoint_list_file = anon_inode_getfile("[lttng_tracepoint_list]", <tng_tracepoint_list_fops, NULL, O_RDWR); if (IS_ERR(tracepoint_list_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]", + <tng_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(); @@ -925,15 +964,24 @@ int lttng_abi_create_event(struct file *channel_file, atomic_long_inc(&channel_file->f_count); break; case LTTNG_KERNEL_SYSCALL: - /* - * Only all-syscall tracing supported for now. - */ - if (event_param->name[0] != '\0') - return -EINVAL; ret = lttng_syscalls_register(channel, NULL); if (ret) goto fd_error; event_fd = 0; + 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_disable(channel, + event_param->name[0] == '\0' ? + NULL : event_param->name); + if (ret) + goto fd_error; + } break; } return event_fd;