Commit | Line | Data |
---|---|---|
e42c4f49 FD |
1 | /* SPDX-License-Identifier: (GPL-2.0-only or LGPL-2.1-only) |
2 | * | |
3 | * lttng-syscalls.h | |
4 | * | |
5 | * LTTng syscall header. | |
6 | * | |
7 | * Copyright (C) 2021 Francis Deslauriers <francis.deslauriers@efficios.com> | |
8 | */ | |
9 | ||
ebcc64cd FD |
10 | #ifndef LTTNG_SYSCALLS_H |
11 | #define LTTNG_SYSCALLS_H | |
12 | ||
e42c4f49 | 13 | #include <asm/ptrace.h> |
87ad3fdc FD |
14 | #include <linux/compat.h> |
15 | #include <linux/fcntl.h> | |
16 | #include <linux/in.h> | |
17 | #include <linux/in6.h> | |
18 | #include <linux/mman.h> | |
d8539681 | 19 | #include <linux/posix_types.h> |
e42c4f49 | 20 | |
ebcc64cd | 21 | #include <lttng/events.h> |
e42c4f49 FD |
22 | #include <lttng/kernel-version.h> |
23 | ||
e42c4f49 | 24 | /* |
d8539681 MD |
25 | * Forward declarations allowing LTTng to build its system call instrumentation |
26 | * against old kernels which do not declare the more recent system call | |
27 | * argument structure types. | |
e42c4f49 | 28 | */ |
d8539681 MD |
29 | struct clone_args; |
30 | struct file_handle; | |
31 | struct futex_waitv; | |
32 | struct io_uring_params; | |
33 | struct mmap_arg_struct; | |
e42c4f49 | 34 | struct mmsghdr; |
d8539681 | 35 | struct mount_attr; |
e42c4f49 FD |
36 | struct oldold_utsname; |
37 | struct old_utsname; | |
d8539681 MD |
38 | struct old_itimerspec32; |
39 | struct old_timespec32; | |
40 | struct old_timeval32; | |
41 | struct old_timex32; | |
42 | struct old_utimbuf32; | |
43 | struct open_how; | |
44 | struct rlimit64; | |
45 | struct rseq; | |
e42c4f49 | 46 | struct sel_arg_struct; |
d8539681 | 47 | struct statx; |
e42c4f49 | 48 | struct user_msghdr; |
d8539681 MD |
49 | |
50 | struct __aio_sigset; | |
7aedbe65 | 51 | struct __kernel_old_itimerval; |
d8539681 MD |
52 | struct __kernel_timespec; |
53 | struct __kernel_timex; | |
54 | struct __kernel_old_timeval; | |
55 | struct __kernel_itimerspec; | |
e42c4f49 | 56 | |
d8539681 MD |
57 | typedef __kernel_long_t __kernel_old_time_t; |
58 | typedef int __bitwise __kernel_rwf_t; | |
59 | typedef __kernel_rwf_t rwf_t; | |
60 | typedef s32 old_time32_t; | |
e42c4f49 FD |
61 | |
62 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,6,0)) | |
d8539681 MD |
63 | /* |
64 | * Forward declaration and typedef for old types expected by MIPS and POWER | |
65 | * system call instrumentation when building against kernel >= 5.6.0. To be | |
66 | * removed after those system call instrumentation headers are regenerated | |
67 | * against a recent kernel. | |
68 | */ | |
e42c4f49 | 69 | typedef __kernel_old_time_t time_t; |
d8539681 MD |
70 | |
71 | struct itimerspec; | |
72 | struct itimerval; | |
73 | struct timeval; | |
74 | struct timex; | |
e42c4f49 FD |
75 | #endif |
76 | ||
ebcc64cd FD |
77 | struct trace_syscall_entry { |
78 | void *event_func; | |
79 | const struct lttng_kernel_event_desc *desc; | |
4f1d1ee5 | 80 | const struct lttng_kernel_event_field * const *fields; |
ebcc64cd FD |
81 | unsigned int nrargs; |
82 | }; | |
83 | ||
84 | struct trace_syscall_table { | |
85 | const struct trace_syscall_entry *table; | |
86 | const size_t len; | |
87 | }; | |
e42c4f49 FD |
88 | |
89 | extern | |
90 | void syscall_entry_event_probe(void *__data, struct pt_regs *regs, long id); | |
91 | ||
92 | extern | |
93 | void syscall_exit_event_probe(void *__data, struct pt_regs *regs, long ret); | |
94 | ||
95 | extern | |
96 | void syscall_entry_event_notifier_probe(void *__data, struct pt_regs *regs, | |
97 | long id); | |
98 | extern | |
99 | void syscall_exit_event_notifier_probe(void *__data, struct pt_regs *regs, | |
100 | long ret); | |
101 | ||
ebcc64cd | 102 | #endif /* LTTNG_SYSCALLS_H */ |