X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=lttng-abi.c;h=d4c5ea0fc8938d1d31b6639357546b24a5d19ffa;hb=f127e61ee231d002fb9a7803643a157e06f6d2e2;hp=beaad907d072ca5db410d8fc2a23e1feb0d17a25;hpb=07dfc1d0e4b093ad02682499a702dc11e54e8302;p=lttng-modules.git diff --git a/lttng-abi.c b/lttng-abi.c index beaad907..d4c5ea0f 100644 --- a/lttng-abi.c +++ b/lttng-abi.c @@ -144,6 +144,51 @@ fd_error: return ret; } +#ifndef CONFIG_HAVE_SYSCALL_TRACEPOINTS +static inline +int lttng_abi_syscall_list(void) +{ + return -ENOSYS; +} +#else +static +int lttng_abi_syscall_list(void) +{ + struct file *syscall_list_file; + int file_fd, ret; + + file_fd = lttng_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; +} +#endif + static void lttng_abi_tracer_version(struct lttng_kernel_tracer_version *v) {