Cleanup: Move patches.i to include/generated/
[lttng-modules.git] / lttng-syscalls.c
index 5fa66660b5f2532d715e80d90fb7c8feb6ec08ca..a5b5f403fe359e6531650111fc05cb82a6c60aba 100644 (file)
@@ -1,23 +1,10 @@
-/*
+/* SPDX-License-Identifier: (GPL-2.0-only or LGPL-2.1-only)
+ *
  * lttng-syscalls.c
  *
  * LTTng syscall probes.
  *
  * Copyright (C) 2010-2012 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; only
- * version 2.1 of the License.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <linux/module.h>
 #include <linux/stringify.h>
 #include <linux/file.h>
 #include <linux/anon_inodes.h>
+#include <linux/fcntl.h>
 #include <asm/ptrace.h>
 #include <asm/syscall.h>
 
-#include "lib/bitfield.h"
-#include "wrapper/tracepoint.h"
-#include "wrapper/file.h"
-#include "wrapper/rcu.h"
-#include "lttng-events.h"
+#include <lttng/bitfield.h>
+#include <wrapper/tracepoint.h>
+#include <wrapper/file.h>
+#include <wrapper/rcu.h>
+#include <wrapper/syscall.h>
+#include <lttng/events.h>
 
 #ifndef CONFIG_COMPAT
 # ifndef is_compat_task
 # 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,
@@ -78,6 +72,19 @@ struct old_utsname;
 struct sel_arg_struct;
 struct mmap_arg_struct;
 struct file_handle;
+struct user_msghdr;
+
+/*
+ * Forward declaration for kernels >= 5.6
+ */
+struct timex;
+struct timeval;
+struct itimerval;
+struct itimerspec;
+
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0))
+typedef __kernel_old_time_t time_t;
+#endif
 
 #ifdef IA32_NR_syscalls
 #define NR_compat_syscalls IA32_NR_syscalls
@@ -91,14 +98,14 @@ struct file_handle;
 #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/headers
 
 #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/headers/syscalls_unknown.h>
 #undef TRACE_SYSTEM
 
 #define SC_ENTER
@@ -118,25 +125,29 @@ struct file_handle;
 #define SC_LTTNG_TRACEPOINT_EVENT(_name, _proto, _args, _fields) \
        LTTNG_TRACEPOINT_EVENT(syscall_entry_##_name, PARAMS(_proto), PARAMS(_args), \
                PARAMS(_fields))
-#define SC_LTTNG_TRACEPOINT_EVENT_CODE(_name, _proto, _args, _locvar, _code, _fields) \
+#define SC_LTTNG_TRACEPOINT_EVENT_CODE(_name, _proto, _args, _locvar, _code_pre, _fields, _code_post) \
        LTTNG_TRACEPOINT_EVENT_CODE(syscall_entry_##_name, PARAMS(_proto), PARAMS(_args), \
-               PARAMS(_locvar), PARAMS(_code),                                 \
-               PARAMS(_fields))
+               PARAMS(_locvar), PARAMS(_code_pre),                             \
+               PARAMS(_fields), PARAMS(_code_post))
 #define SC_LTTNG_TRACEPOINT_EVENT_CLASS_NOARGS(_name, _fields) \
        LTTNG_TRACEPOINT_EVENT_CLASS_NOARGS(syscall_entry_##_name, PARAMS(_fields))
 #define SC_LTTNG_TRACEPOINT_EVENT_INSTANCE_NOARGS(_template, _name)            \
        LTTNG_TRACEPOINT_EVENT_INSTANCE_NOARGS(syscall_entry_##_template, syscall_entry_##_name)
+/* Enumerations only defined at first inclusion. */
+#define SC_LTTNG_TRACEPOINT_ENUM(_name, _values) \
+       LTTNG_TRACEPOINT_ENUM(_name, PARAMS(_values))
 #undef TRACE_SYSTEM
 #define TRACE_SYSTEM syscall_entry_integers
 #define TRACE_INCLUDE_FILE syscalls_integers
-#include "instrumentation/syscalls/headers/syscalls_integers.h"
+#include <instrumentation/syscalls/headers/syscalls_integers.h>
 #undef TRACE_INCLUDE_FILE
 #undef TRACE_SYSTEM
 #define TRACE_SYSTEM syscall_entry_pointers
 #define TRACE_INCLUDE_FILE syscalls_pointers
-#include "instrumentation/syscalls/headers/syscalls_pointers.h"
+#include <instrumentation/syscalls/headers/syscalls_pointers.h>
 #undef TRACE_INCLUDE_FILE
 #undef TRACE_SYSTEM
+#undef SC_LTTNG_TRACEPOINT_ENUM
 #undef SC_LTTNG_TRACEPOINT_EVENT_CODE
 #undef SC_LTTNG_TRACEPOINT_EVENT
 #undef SC_LTTNG_TRACEPOINT_EVENT_CLASS_NOARGS
@@ -147,27 +158,31 @@ struct file_handle;
 
 /* Hijack probe callback for compat system call enter */
 #define TP_PROBE_CB(_template)         &syscall_entry_probe
+#define LTTNG_SC_COMPAT
 #define SC_LTTNG_TRACEPOINT_EVENT(_name, _proto, _args, _fields) \
        LTTNG_TRACEPOINT_EVENT(compat_syscall_entry_##_name, PARAMS(_proto), PARAMS(_args), \
                PARAMS(_fields))
-#define SC_LTTNG_TRACEPOINT_EVENT_CODE(_name, _proto, _args, _locvar, _code, _fields) \
+#define SC_LTTNG_TRACEPOINT_EVENT_CODE(_name, _proto, _args, _locvar, _code_pre, _fields, _code_post) \
        LTTNG_TRACEPOINT_EVENT_CODE(compat_syscall_entry_##_name, PARAMS(_proto), PARAMS(_args), \
-               PARAMS(_locvar), PARAMS(_code), PARAMS(_fields))
+               PARAMS(_locvar), PARAMS(_code_pre), PARAMS(_fields), PARAMS(_code_post))
 #define SC_LTTNG_TRACEPOINT_EVENT_CLASS_NOARGS(_name, _fields) \
        LTTNG_TRACEPOINT_EVENT_CLASS_NOARGS(compat_syscall_entry_##_name, PARAMS(_fields))
 #define SC_LTTNG_TRACEPOINT_EVENT_INSTANCE_NOARGS(_template, _name)            \
        LTTNG_TRACEPOINT_EVENT_INSTANCE_NOARGS(compat_syscall_entry_##_template, \
                compat_syscall_entry_##_name)
+/* Enumerations only defined at inital inclusion (not here). */
+#define SC_LTTNG_TRACEPOINT_ENUM(_name, _values)
 #define TRACE_SYSTEM compat_syscall_entry_integers
 #define TRACE_INCLUDE_FILE compat_syscalls_integers
-#include "instrumentation/syscalls/headers/compat_syscalls_integers.h"
+#include <instrumentation/syscalls/headers/compat_syscalls_integers.h>
 #undef TRACE_INCLUDE_FILE
 #undef TRACE_SYSTEM
 #define TRACE_SYSTEM compat_syscall_entry_pointers
 #define TRACE_INCLUDE_FILE compat_syscalls_pointers
-#include "instrumentation/syscalls/headers/compat_syscalls_pointers.h"
+#include <instrumentation/syscalls/headers/compat_syscalls_pointers.h>
 #undef TRACE_INCLUDE_FILE
 #undef TRACE_SYSTEM
+#undef SC_LTTNG_TRACEPOINT_ENUM
 #undef SC_LTTNG_TRACEPOINT_EVENT_CODE
 #undef SC_LTTNG_TRACEPOINT_EVENT
 #undef SC_LTTNG_TRACEPOINT_EVENT_CLASS_NOARGS
@@ -175,6 +190,7 @@ struct file_handle;
 #undef TP_PROBE_CB
 #undef _TRACE_SYSCALLS_INTEGERS_H
 #undef _TRACE_SYSCALLS_POINTERS_H
+#undef LTTNG_SC_COMPAT
 
 #undef SC_ENTER
 
@@ -194,24 +210,27 @@ struct file_handle;
 #define SC_LTTNG_TRACEPOINT_EVENT(_name, _proto, _args, _fields) \
        LTTNG_TRACEPOINT_EVENT(syscall_exit_##_name, PARAMS(_proto), PARAMS(_args), \
                PARAMS(_fields))
-#define SC_LTTNG_TRACEPOINT_EVENT_CODE(_name, _proto, _args, _locvar, _code, _fields) \
+#define SC_LTTNG_TRACEPOINT_EVENT_CODE(_name, _proto, _args, _locvar, _code_pre, _fields, _code_post) \
        LTTNG_TRACEPOINT_EVENT_CODE(syscall_exit_##_name, PARAMS(_proto), PARAMS(_args), \
-               PARAMS(_locvar), PARAMS(_code), PARAMS(_fields))
+               PARAMS(_locvar), PARAMS(_code_pre), PARAMS(_fields), PARAMS(_code_post))
 #define SC_LTTNG_TRACEPOINT_EVENT_CLASS_NOARGS(_name, _fields) \
        LTTNG_TRACEPOINT_EVENT_CLASS_NOARGS(syscall_exit_##_name, PARAMS(_fields))
 #define SC_LTTNG_TRACEPOINT_EVENT_INSTANCE_NOARGS(_template, _name)            \
        LTTNG_TRACEPOINT_EVENT_INSTANCE_NOARGS(syscall_exit_##_template,        \
                syscall_exit_##_name)
+/* Enumerations only defined at inital inclusion (not here). */
+#define SC_LTTNG_TRACEPOINT_ENUM(_name, _values)
 #define TRACE_SYSTEM syscall_exit_integers
 #define TRACE_INCLUDE_FILE syscalls_integers
-#include "instrumentation/syscalls/headers/syscalls_integers.h"
+#include <instrumentation/syscalls/headers/syscalls_integers.h>
 #undef TRACE_INCLUDE_FILE
 #undef TRACE_SYSTEM
 #define TRACE_SYSTEM syscall_exit_pointers
 #define TRACE_INCLUDE_FILE syscalls_pointers
-#include "instrumentation/syscalls/headers/syscalls_pointers.h"
+#include <instrumentation/syscalls/headers/syscalls_pointers.h>
 #undef TRACE_INCLUDE_FILE
 #undef TRACE_SYSTEM
+#undef SC_LTTNG_TRACEPOINT_ENUM
 #undef SC_LTTNG_TRACEPOINT_EVENT_CODE
 #undef SC_LTTNG_TRACEPOINT_EVENT
 #undef SC_LTTNG_TRACEPOINT_EVENT_CLASS_NOARGS
@@ -223,27 +242,31 @@ struct file_handle;
 
 /* Hijack probe callback for compat system call exit */
 #define TP_PROBE_CB(_template)         &syscall_exit_probe
+#define LTTNG_SC_COMPAT
 #define SC_LTTNG_TRACEPOINT_EVENT(_name, _proto, _args, _fields) \
        LTTNG_TRACEPOINT_EVENT(compat_syscall_exit_##_name, PARAMS(_proto), PARAMS(_args), \
                PARAMS(_fields))
-#define SC_LTTNG_TRACEPOINT_EVENT_CODE(_name, _proto, _args, _locvar, _code, _fields) \
+#define SC_LTTNG_TRACEPOINT_EVENT_CODE(_name, _proto, _args, _locvar, _code_pre, _fields, _code_post) \
        LTTNG_TRACEPOINT_EVENT_CODE(compat_syscall_exit_##_name, PARAMS(_proto), PARAMS(_args), \
-               PARAMS(_locvar), PARAMS(_code), PARAMS(_fields))
+               PARAMS(_locvar), PARAMS(_code_pre), PARAMS(_fields), PARAMS(_code_post))
 #define SC_LTTNG_TRACEPOINT_EVENT_CLASS_NOARGS(_name, _fields) \
        LTTNG_TRACEPOINT_EVENT_CLASS_NOARGS(compat_syscall_exit_##_name, PARAMS(_fields))
 #define SC_LTTNG_TRACEPOINT_EVENT_INSTANCE_NOARGS(_template, _name)            \
        LTTNG_TRACEPOINT_EVENT_INSTANCE_NOARGS(compat_syscall_exit_##_template, \
                compat_syscall_exit_##_name)
+/* Enumerations only defined at inital inclusion (not here). */
+#define SC_LTTNG_TRACEPOINT_ENUM(_name, _values)
 #define TRACE_SYSTEM compat_syscall_exit_integers
 #define TRACE_INCLUDE_FILE compat_syscalls_integers
-#include "instrumentation/syscalls/headers/compat_syscalls_integers.h"
+#include <instrumentation/syscalls/headers/compat_syscalls_integers.h>
 #undef TRACE_INCLUDE_FILE
 #undef TRACE_SYSTEM
 #define TRACE_SYSTEM compat_syscall_exit_pointers
 #define TRACE_INCLUDE_FILE compat_syscalls_pointers
-#include "instrumentation/syscalls/headers/compat_syscalls_pointers.h"
+#include <instrumentation/syscalls/headers/compat_syscalls_pointers.h>
 #undef TRACE_INCLUDE_FILE
 #undef TRACE_SYSTEM
+#undef SC_LTTNG_TRACEPOINT_ENUM
 #undef SC_LTTNG_TRACEPOINT_EVENT_CODE
 #undef SC_LTTNG_TRACEPOINT_EVENT
 #undef SC_LTTNG_TRACEPOINT_EVENT_CLASS_NOARGS
@@ -251,6 +274,7 @@ struct file_handle;
 #undef TP_PROBE_CB
 #undef _TRACE_SYSCALLS_INTEGERS_H
 #undef _TRACE_SYSCALLS_POINTERS_H
+#undef LTTNG_SC_COMPAT
 
 #undef SC_EXIT
 
@@ -283,8 +307,8 @@ struct trace_syscall_entry {
 
 /* Syscall enter tracing table */
 static const struct trace_syscall_entry sc_table[] = {
-#include "instrumentation/syscalls/headers/syscalls_integers.h"
-#include "instrumentation/syscalls/headers/syscalls_pointers.h"
+#include <instrumentation/syscalls/headers/syscalls_integers.h>
+#include <instrumentation/syscalls/headers/syscalls_pointers.h>
 };
 
 #undef TRACE_SYSCALL_TABLE
@@ -298,8 +322,8 @@ static const struct trace_syscall_entry sc_table[] = {
 
 /* Compat syscall enter table */
 const struct trace_syscall_entry compat_sc_table[] = {
-#include "instrumentation/syscalls/headers/compat_syscalls_integers.h"
-#include "instrumentation/syscalls/headers/compat_syscalls_pointers.h"
+#include <instrumentation/syscalls/headers/compat_syscalls_integers.h>
+#include <instrumentation/syscalls/headers/compat_syscalls_pointers.h>
 };
 
 #undef SC_ENTER
@@ -320,8 +344,8 @@ const struct trace_syscall_entry compat_sc_table[] = {
 
 /* Syscall exit table */
 static const struct trace_syscall_entry sc_exit_table[] = {
-#include "instrumentation/syscalls/headers/syscalls_integers.h"
-#include "instrumentation/syscalls/headers/syscalls_pointers.h"
+#include <instrumentation/syscalls/headers/syscalls_integers.h>
+#include <instrumentation/syscalls/headers/syscalls_pointers.h>
 };
 
 #undef TRACE_SYSCALL_TABLE
@@ -335,8 +359,8 @@ static const struct trace_syscall_entry sc_exit_table[] = {
 
 /* Compat syscall exit table */
 const struct trace_syscall_entry compat_sc_exit_table[] = {
-#include "instrumentation/syscalls/headers/compat_syscalls_integers.h"
-#include "instrumentation/syscalls/headers/compat_syscalls_pointers.h"
+#include <instrumentation/syscalls/headers/compat_syscalls_integers.h>
+#include <instrumentation/syscalls/headers/compat_syscalls_pointers.h>
 };
 
 #undef SC_EXIT
@@ -351,10 +375,10 @@ struct lttng_syscall_filter {
 static void syscall_entry_unknown(struct lttng_event *event,
        struct pt_regs *regs, unsigned int id)
 {
-       unsigned long args[UNKNOWN_SYSCALL_NRARGS];
+       unsigned long args[LTTNG_SYSCALL_NR_ARGS];
 
-       syscall_get_arguments(current, regs, 0, UNKNOWN_SYSCALL_NRARGS, args);
-       if (unlikely(is_compat_task()))
+       lttng_syscall_get_arguments(current, regs, args);
+       if (unlikely(in_compat_syscall()))
                __event_probe__compat_syscall_entry_unknown(event, id, args);
        else
                __event_probe__syscall_entry_unknown(event, id, args);
@@ -367,7 +391,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);
@@ -400,7 +424,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];
@@ -422,9 +446,9 @@ void syscall_entry_probe(void *__data, struct pt_regs *regs, long id)
        case 1:
        {
                void (*fptr)(void *__data, unsigned long arg0) = entry->func;
-               unsigned long args[1];
+               unsigned long args[LTTNG_SYSCALL_NR_ARGS];
 
-               syscall_get_arguments(current, regs, 0, entry->nrargs, args);
+               lttng_syscall_get_arguments(current, regs, args);
                fptr(event, args[0]);
                break;
        }
@@ -433,9 +457,9 @@ void syscall_entry_probe(void *__data, struct pt_regs *regs, long id)
                void (*fptr)(void *__data,
                        unsigned long arg0,
                        unsigned long arg1) = entry->func;
-               unsigned long args[2];
+               unsigned long args[LTTNG_SYSCALL_NR_ARGS];
 
-               syscall_get_arguments(current, regs, 0, entry->nrargs, args);
+               lttng_syscall_get_arguments(current, regs, args);
                fptr(event, args[0], args[1]);
                break;
        }
@@ -445,9 +469,9 @@ void syscall_entry_probe(void *__data, struct pt_regs *regs, long id)
                        unsigned long arg0,
                        unsigned long arg1,
                        unsigned long arg2) = entry->func;
-               unsigned long args[3];
+               unsigned long args[LTTNG_SYSCALL_NR_ARGS];
 
-               syscall_get_arguments(current, regs, 0, entry->nrargs, args);
+               lttng_syscall_get_arguments(current, regs, args);
                fptr(event, args[0], args[1], args[2]);
                break;
        }
@@ -458,9 +482,9 @@ void syscall_entry_probe(void *__data, struct pt_regs *regs, long id)
                        unsigned long arg1,
                        unsigned long arg2,
                        unsigned long arg3) = entry->func;
-               unsigned long args[4];
+               unsigned long args[LTTNG_SYSCALL_NR_ARGS];
 
-               syscall_get_arguments(current, regs, 0, entry->nrargs, args);
+               lttng_syscall_get_arguments(current, regs, args);
                fptr(event, args[0], args[1], args[2], args[3]);
                break;
        }
@@ -472,9 +496,9 @@ void syscall_entry_probe(void *__data, struct pt_regs *regs, long id)
                        unsigned long arg2,
                        unsigned long arg3,
                        unsigned long arg4) = entry->func;
-               unsigned long args[5];
+               unsigned long args[LTTNG_SYSCALL_NR_ARGS];
 
-               syscall_get_arguments(current, regs, 0, entry->nrargs, args);
+               lttng_syscall_get_arguments(current, regs, args);
                fptr(event, args[0], args[1], args[2], args[3], args[4]);
                break;
        }
@@ -487,9 +511,9 @@ void syscall_entry_probe(void *__data, struct pt_regs *regs, long id)
                        unsigned long arg3,
                        unsigned long arg4,
                        unsigned long arg5) = entry->func;
-               unsigned long args[6];
+               unsigned long args[LTTNG_SYSCALL_NR_ARGS];
 
-               syscall_get_arguments(current, regs, 0, entry->nrargs, args);
+               lttng_syscall_get_arguments(current, regs, args);
                fptr(event, args[0], args[1], args[2],
                        args[3], args[4], args[5]);
                break;
@@ -502,10 +526,10 @@ void syscall_entry_probe(void *__data, struct pt_regs *regs, long id)
 static void syscall_exit_unknown(struct lttng_event *event,
        struct pt_regs *regs, int id, long ret)
 {
-       unsigned long args[UNKNOWN_SYSCALL_NRARGS];
+       unsigned long args[LTTNG_SYSCALL_NR_ARGS];
 
-       syscall_get_arguments(current, regs, 0, UNKNOWN_SYSCALL_NRARGS, args);
-       if (unlikely(is_compat_task()))
+       lttng_syscall_get_arguments(current, regs, args);
+       if (unlikely(in_compat_syscall()))
                __event_probe__compat_syscall_exit_unknown(event, id, ret,
                        args);
        else
@@ -521,7 +545,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);
@@ -554,7 +578,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];
@@ -578,9 +602,9 @@ void syscall_exit_probe(void *__data, struct pt_regs *regs, long ret)
                void (*fptr)(void *__data,
                        long ret,
                        unsigned long arg0) = entry->func;
-               unsigned long args[1];
+               unsigned long args[LTTNG_SYSCALL_NR_ARGS];
 
-               syscall_get_arguments(current, regs, 0, entry->nrargs, args);
+               lttng_syscall_get_arguments(current, regs, args);
                fptr(event, ret, args[0]);
                break;
        }
@@ -590,9 +614,9 @@ void syscall_exit_probe(void *__data, struct pt_regs *regs, long ret)
                        long ret,
                        unsigned long arg0,
                        unsigned long arg1) = entry->func;
-               unsigned long args[2];
+               unsigned long args[LTTNG_SYSCALL_NR_ARGS];
 
-               syscall_get_arguments(current, regs, 0, entry->nrargs, args);
+               lttng_syscall_get_arguments(current, regs, args);
                fptr(event, ret, args[0], args[1]);
                break;
        }
@@ -603,9 +627,9 @@ void syscall_exit_probe(void *__data, struct pt_regs *regs, long ret)
                        unsigned long arg0,
                        unsigned long arg1,
                        unsigned long arg2) = entry->func;
-               unsigned long args[3];
+               unsigned long args[LTTNG_SYSCALL_NR_ARGS];
 
-               syscall_get_arguments(current, regs, 0, entry->nrargs, args);
+               lttng_syscall_get_arguments(current, regs, args);
                fptr(event, ret, args[0], args[1], args[2]);
                break;
        }
@@ -617,9 +641,9 @@ void syscall_exit_probe(void *__data, struct pt_regs *regs, long ret)
                        unsigned long arg1,
                        unsigned long arg2,
                        unsigned long arg3) = entry->func;
-               unsigned long args[4];
+               unsigned long args[LTTNG_SYSCALL_NR_ARGS];
 
-               syscall_get_arguments(current, regs, 0, entry->nrargs, args);
+               lttng_syscall_get_arguments(current, regs, args);
                fptr(event, ret, args[0], args[1], args[2], args[3]);
                break;
        }
@@ -632,9 +656,9 @@ void syscall_exit_probe(void *__data, struct pt_regs *regs, long ret)
                        unsigned long arg2,
                        unsigned long arg3,
                        unsigned long arg4) = entry->func;
-               unsigned long args[5];
+               unsigned long args[LTTNG_SYSCALL_NR_ARGS];
 
-               syscall_get_arguments(current, regs, 0, entry->nrargs, args);
+               lttng_syscall_get_arguments(current, regs, args);
                fptr(event, ret, args[0], args[1], args[2], args[3], args[4]);
                break;
        }
@@ -648,9 +672,9 @@ void syscall_exit_probe(void *__data, struct pt_regs *regs, long ret)
                        unsigned long arg3,
                        unsigned long arg4,
                        unsigned long arg5) = entry->func;
-               unsigned long args[6];
+               unsigned long args[LTTNG_SYSCALL_NR_ARGS];
 
-               syscall_get_arguments(current, regs, 0, entry->nrargs, args);
+               lttng_syscall_get_arguments(current, regs, args);
                fptr(event, ret, args[0], args[1], args[2],
                        args[3], args[4], args[5]);
                break;
@@ -737,7 +761,7 @@ int lttng_syscalls_register(struct lttng_channel *chan, void *filter)
        struct lttng_kernel_event ev;
        int ret;
 
-       wrapper_vmalloc_sync_all();
+       wrapper_vmalloc_sync_mappings();
 
        if (!chan->sc_table) {
                /* create syscall table mapping syscall to events */
@@ -894,15 +918,15 @@ int lttng_syscalls_unregister(struct lttng_channel *chan)
        if (!chan->sc_table)
                return 0;
        if (chan->sys_enter_registered) {
-               ret = lttng_wrapper_tracepoint_probe_unregister("sys_exit",
-                               (void *) syscall_exit_probe, chan);
+               ret = lttng_wrapper_tracepoint_probe_unregister("sys_enter",
+                               (void *) syscall_entry_probe, chan);
                if (ret)
                        return ret;
                chan->sys_enter_registered = 0;
        }
        if (chan->sys_exit_registered) {
-               ret = lttng_wrapper_tracepoint_probe_unregister("sys_enter",
-                               (void *) syscall_entry_probe, chan);
+               ret = lttng_wrapper_tracepoint_probe_unregister("sys_exit",
+                               (void *) syscall_exit_probe, chan);
                if (ret)
                        return ret;
                chan->sys_exit_registered = 0;
@@ -1236,7 +1260,7 @@ long lttng_channel_syscall_mask(struct lttng_channel *channel,
        filter = channel->sc_filter;
 
        for (bit = 0; bit < ARRAY_SIZE(sc_table); bit++) {
-               bool state;
+               char state;
 
                if (channel->sc_table) {
                        if (filter)
@@ -1249,7 +1273,7 @@ long lttng_channel_syscall_mask(struct lttng_channel *channel,
                bt_bitfield_write_be(tmp_mask, char, bit, 1, state);
        }
        for (; bit < sc_tables_len; bit++) {
-               bool state;
+               char state;
 
                if (channel->compat_sc_table) {
                        if (filter)
This page took 0.035186 seconds and 4 git commands to generate.