Fix: build for architectures without HAVE_SYSCALL_TRACEPOINTS
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 12 Nov 2014 19:29:47 +0000 (14:29 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 12 Nov 2014 19:30:56 +0000 (14:30 -0500)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
lttng-abi.c
lttng-events.h
lttng-syscalls.c

index b83ed3d211defb747447469fc40bba06d816242b..381a73904dfe60e6e6d0a8bc66a0cecf5fd65bf8 100644 (file)
@@ -143,43 +143,6 @@ 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)
 {
index a537673ab605b92cad3ce00c0747800a516d00b4..e5cd0eeadeb6198b20958c34f68f517b13aa6710 100644 (file)
@@ -407,6 +407,7 @@ int lttng_syscall_filter_disable(struct lttng_channel *chan,
                const char *name);
 long lttng_channel_syscall_mask(struct lttng_channel *channel,
                struct lttng_kernel_syscall_mask __user *usyscall_mask);
+int lttng_abi_syscall_list(void);
 #else
 static inline int lttng_syscalls_register(struct lttng_channel *chan, void *filter)
 {
@@ -418,26 +419,32 @@ static inline int lttng_syscalls_unregister(struct lttng_channel *chan)
        return 0;
 }
 
-static
+static inline
 int lttng_syscall_filter_enable(struct lttng_channel *chan,
                const char *name)
 {
        return -ENOSYS;
 }
 
-static
+static inline
 int lttng_syscall_filter_disable(struct lttng_channel *chan,
                const char *name)
 {
        return -ENOSYS;
 }
 
-static
+static inline
 long lttng_channel_syscall_mask(struct lttng_channel *channel,
                struct lttng_kernel_syscall_mask __user *usyscall_mask)
 {
        return -ENOSYS;
 }
+
+static inline
+int lttng_abi_syscall_list(void)
+{
+       return -ENOSYS;
+}
 #endif
 
 struct lttng_ctx_field *lttng_append_context(struct lttng_ctx **ctx);
index 622da6e206a5c683a5c1b006387789c46ac0126e..1fc86c8eed5a84502d05b0efd893b052975d06ca 100644 (file)
@@ -29,6 +29,8 @@
 #include <linux/in6.h>
 #include <linux/seq_file.h>
 #include <linux/stringify.h>
+#include <linux/file.h>
+#include <linux/anon_inodes.h>
 #include <asm/ptrace.h>
 #include <asm/syscall.h>
 
@@ -1261,3 +1263,39 @@ long lttng_channel_syscall_mask(struct lttng_channel *channel,
        kfree(tmp_mask);
        return ret;
 }
+
+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;
+}
This page took 0.028529 seconds and 4 git commands to generate.