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 | ||
13 | #include <stddef.h> | |
14 | ||
e42c4f49 | 15 | #include <asm/ptrace.h> |
87ad3fdc FD |
16 | #include <linux/compat.h> |
17 | #include <linux/fcntl.h> | |
18 | #include <linux/in.h> | |
19 | #include <linux/in6.h> | |
20 | #include <linux/mman.h> | |
e42c4f49 | 21 | |
ebcc64cd | 22 | #include <lttng/events.h> |
e42c4f49 FD |
23 | #include <lttng/kernel-version.h> |
24 | ||
25 | ||
26 | /* | |
27 | * Forward declarations for old kernels. | |
28 | */ | |
29 | struct mmsghdr; | |
30 | struct rlimit64; | |
31 | struct oldold_utsname; | |
32 | struct old_utsname; | |
33 | struct sel_arg_struct; | |
34 | struct mmap_arg_struct; | |
35 | struct file_handle; | |
36 | struct user_msghdr; | |
37 | ||
38 | /* | |
39 | * Forward declaration for kernels >= 5.6 | |
40 | */ | |
41 | struct timex; | |
42 | struct timeval; | |
43 | struct itimerval; | |
44 | struct itimerspec; | |
45 | ||
46 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,6,0)) | |
47 | typedef __kernel_old_time_t time_t; | |
48 | #endif | |
49 | ||
ebcc64cd FD |
50 | struct trace_syscall_entry { |
51 | void *event_func; | |
52 | const struct lttng_kernel_event_desc *desc; | |
4f1d1ee5 | 53 | const struct lttng_kernel_event_field * const *fields; |
ebcc64cd FD |
54 | unsigned int nrargs; |
55 | }; | |
56 | ||
57 | struct trace_syscall_table { | |
58 | const struct trace_syscall_entry *table; | |
59 | const size_t len; | |
60 | }; | |
e42c4f49 FD |
61 | |
62 | extern | |
63 | void syscall_entry_event_probe(void *__data, struct pt_regs *regs, long id); | |
64 | ||
65 | extern | |
66 | void syscall_exit_event_probe(void *__data, struct pt_regs *regs, long ret); | |
67 | ||
68 | extern | |
69 | void syscall_entry_event_notifier_probe(void *__data, struct pt_regs *regs, | |
70 | long id); | |
71 | extern | |
72 | void syscall_exit_event_notifier_probe(void *__data, struct pt_regs *regs, | |
73 | long ret); | |
74 | ||
ebcc64cd | 75 | #endif /* LTTNG_SYSCALLS_H */ |