Fix: add missing typedef and forward declarations for old kernels
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 17 Nov 2022 20:28:12 +0000 (15:28 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 17 Nov 2022 21:31:52 +0000 (16:31 -0500)
While we are updating this, remove duplicated code between header and
implementation.

Reorganise list by alphabetical order.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I79f1877d965084a77a1fdd573f8e227cd7f5ce74

src/lttng-syscalls.c
src/lttng-syscalls.h

index ceba4e065cc1c2629762167424ea741c15521b4f..9cd11ea6e9b8394f77354be40cc320dd9e230a92 100644 (file)
@@ -66,34 +66,6 @@ enum sc_type {
 void syscall_entry_event_probe(void *__data, struct pt_regs *regs, long id);
 void syscall_exit_event_probe(void *__data, struct pt_regs *regs, long ret);
 
-/*
- * Forward declarations for old kernels.
- */
-struct mmsghdr;
-struct rlimit64;
-struct oldold_utsname;
-struct old_utsname;
-struct sel_arg_struct;
-struct mmap_arg_struct;
-struct file_handle;
-struct user_msghdr;
-struct __kernel_old_itimerval;
-struct open_how;
-struct mount_attr;
-struct futex_waitv;
-
-/*
- * Forward declaration for kernels >= 5.6
- */
-struct timex;
-struct timeval;
-struct itimerval;
-struct itimerspec;
-
-#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,6,0))
-typedef __kernel_old_time_t time_t;
-#endif
-
 #ifdef IA32_NR_syscalls
 #define NR_compat_syscalls IA32_NR_syscalls
 #else
index c9888bd24ef57dc181e8a017dbbe55aa6756ba8e..e0f340efc550f82d03d8bfb86bfcce8e19d3313b 100644 (file)
 #include <linux/in.h>
 #include <linux/in6.h>
 #include <linux/mman.h>
+#include <linux/posix_types.h>
 
 #include <lttng/events.h>
 #include <lttng/kernel-version.h>
 
-
 /*
- * Forward declarations for old kernels.
+ * Forward declarations allowing LTTng to build its system call instrumentation
+ * against old kernels which do not declare the more recent system call
+ * argument structure types.
  */
+struct clone_args;
+struct file_handle;
+struct futex_waitv;
+struct io_uring_params;
+struct mmap_arg_struct;
 struct mmsghdr;
-struct rlimit64;
+struct mount_attr;
 struct oldold_utsname;
 struct old_utsname;
+struct old_itimerspec32;
+struct old_timespec32;
+struct old_timeval32;
+struct old_timex32;
+struct old_utimbuf32;
+struct open_how;
+struct rlimit64;
+struct rseq;
 struct sel_arg_struct;
-struct mmap_arg_struct;
-struct file_handle;
+struct statx;
 struct user_msghdr;
+
+struct __aio_sigset;
 struct __kernel_old_itimerval;
-struct open_how;
-struct mount_attr;
-struct futex_waitv;
+struct __kernel_timespec;
+struct __kernel_timex;
+struct __kernel_old_timeval;
+struct __kernel_itimerspec;
 
-/*
- * Forward declaration for kernels >= 5.6
- */
-struct timex;
-struct timeval;
-struct itimerval;
-struct itimerspec;
+typedef __kernel_long_t __kernel_old_time_t;
+typedef int __bitwise __kernel_rwf_t;
+typedef __kernel_rwf_t rwf_t;
+typedef s32 old_time32_t;
 
 #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,6,0))
+/*
+ * Forward declaration and typedef for old types expected by MIPS and POWER
+ * system call instrumentation when building against kernel >= 5.6.0. To be
+ * removed after those system call instrumentation headers are regenerated
+ * against a recent kernel.
+ */
 typedef __kernel_old_time_t time_t;
+
+struct itimerspec;
+struct itimerval;
+struct timeval;
+struct timex;
 #endif
 
 struct trace_syscall_entry {
This page took 0.027502 seconds and 4 git commands to generate.