Rename "tsc" to "timestamp"
[lttng-modules.git] / src / lttng-syscalls.c
index 2fb6eda314390cefc10529a37332aaad6848f7d8..5ec6be5a498514375a17bd54669096fd37471709 100644 (file)
@@ -31,6 +31,7 @@
 #include <lttng/events.h>
 #include <lttng/events-internal.h>
 #include <lttng/utils.h>
+#include <lttng/kernel-version.h>
 
 #include "lttng-syscalls.h"
 
 
 /* in_compat_syscall appears in kernel 4.6. */
 #ifndef in_compat_syscall
- #define in_compat_syscall()   is_compat_task()
+# define in_compat_syscall()   is_compat_task()
+#endif
+
+/* in_x32_syscall appears in kernel 4.7. */
+#if (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(4,7,0))
+# ifdef CONFIG_X86_X32_ABI
+#  define in_x32_syscall()     is_x32_task()
+# endif
 #endif
 
 enum sc_type {
@@ -77,14 +85,14 @@ void syscall_exit_event_probe(void *__data, struct pt_regs *regs, long ret);
 #define LTTNG_PACKAGE_BUILD
 #define CREATE_TRACE_POINTS
 #define TP_MODULE_NOINIT
-#define TRACE_INCLUDE_PATH instrumentation/syscalls/headers
+#define TRACE_INCLUDE_PATH instrumentation/syscalls
 
 #define PARAMS(args...)        args
 
 /* Handle unknown syscalls */
 #undef TRACE_SYSTEM
 #define TRACE_SYSTEM syscalls_unknown
-#include <instrumentation/syscalls/headers/syscalls_unknown.h>
+#include <instrumentation/syscalls/syscalls_unknown.h>
 #undef TRACE_SYSTEM
 
 #undef TP_PROBE_CB
@@ -241,6 +249,12 @@ void syscall_entry_event_probe(void *__data, struct pt_regs *regs, long id)
        const struct trace_syscall_entry *table, *entry;
        size_t table_len;
 
+#ifdef CONFIG_X86_X32_ABI
+       if (in_x32_syscall()) {
+               /* x32 system calls are not supported. */
+               return;
+       }
+#endif
        if (unlikely(in_compat_syscall())) {
                struct lttng_syscall_filter *filter = syscall_table->sc_filter;
 
@@ -419,6 +433,12 @@ void syscall_exit_event_probe(void *__data, struct pt_regs *regs, long ret)
        size_t table_len;
        long id;
 
+#ifdef CONFIG_X86_X32_ABI
+       if (in_x32_syscall()) {
+               /* x32 system calls are not supported. */
+               return;
+       }
+#endif
        id = syscall_get_nr(current, regs);
 
        if (unlikely(in_compat_syscall())) {
This page took 0.024151 seconds and 4 git commands to generate.