Fix: 4.6 kernel: use in_compat_syscall
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 4 Apr 2016 19:55:28 +0000 (15:55 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 4 Apr 2016 19:55:28 +0000 (15:55 -0400)
in_compat_sycall appears in kernel 4.6. Use it instead of
is_compat_task(), but use is_compat_task() as fallback.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
lttng-syscalls.c

index f4e05b080f5de3356b4f3f8ce7bfd59f486ef34a..a3149d0d01caa4260bc2e0442907207f4f4aac4b 100644 (file)
 # endif
 #endif
 
+/* in_compat_syscall appears in kernel 4.6. */
+#ifndef in_compat_syscall
+ #define in_compat_syscall()   is_compat_task()
+#endif
+
 enum sc_type {
        SC_TYPE_ENTRY,
        SC_TYPE_EXIT,
@@ -355,7 +360,7 @@ static void syscall_entry_unknown(struct lttng_event *event,
        unsigned long args[UNKNOWN_SYSCALL_NRARGS];
 
        syscall_get_arguments(current, regs, 0, UNKNOWN_SYSCALL_NRARGS, args);
-       if (unlikely(is_compat_task()))
+       if (unlikely(in_compat_syscall()))
                __event_probe__compat_syscall_entry_unknown(event, id, args);
        else
                __event_probe__syscall_entry_unknown(event, id, args);
@@ -368,7 +373,7 @@ void syscall_entry_probe(void *__data, struct pt_regs *regs, long id)
        const struct trace_syscall_entry *table, *entry;
        size_t table_len;
 
-       if (unlikely(is_compat_task())) {
+       if (unlikely(in_compat_syscall())) {
                struct lttng_syscall_filter *filter;
 
                filter = lttng_rcu_dereference(chan->sc_filter);
@@ -401,7 +406,7 @@ void syscall_entry_probe(void *__data, struct pt_regs *regs, long id)
                syscall_entry_unknown(unknown_event, regs, id);
                return;
        }
-       if (unlikely(is_compat_task()))
+       if (unlikely(in_compat_syscall()))
                event = chan->compat_sc_table[id];
        else
                event = chan->sc_table[id];
@@ -506,7 +511,7 @@ static void syscall_exit_unknown(struct lttng_event *event,
        unsigned long args[UNKNOWN_SYSCALL_NRARGS];
 
        syscall_get_arguments(current, regs, 0, UNKNOWN_SYSCALL_NRARGS, args);
-       if (unlikely(is_compat_task()))
+       if (unlikely(in_compat_syscall()))
                __event_probe__compat_syscall_exit_unknown(event, id, ret,
                        args);
        else
@@ -522,7 +527,7 @@ void syscall_exit_probe(void *__data, struct pt_regs *regs, long ret)
        long id;
 
        id = syscall_get_nr(current, regs);
-       if (unlikely(is_compat_task())) {
+       if (unlikely(in_compat_syscall())) {
                struct lttng_syscall_filter *filter;
 
                filter = lttng_rcu_dereference(chan->sc_filter);
@@ -555,7 +560,7 @@ void syscall_exit_probe(void *__data, struct pt_regs *regs, long ret)
                syscall_exit_unknown(unknown_event, regs, id, ret);
                return;
        }
-       if (unlikely(is_compat_task()))
+       if (unlikely(in_compat_syscall()))
                event = chan->compat_sc_exit_table[id];
        else
                event = chan->sc_exit_table[id];
This page took 0.026936 seconds and 5 git commands to generate.