Rename "tsc" to "timestamp"
[lttng-modules.git] / src / lttng-syscalls.h
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
10 #ifndef LTTNG_SYSCALLS_H
11 #define LTTNG_SYSCALLS_H
12
13 #include <asm/ptrace.h>
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>
19 #include <linux/posix_types.h>
20
21 #include <lttng/events.h>
22 #include <lttng/kernel-version.h>
23
24 #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,13,0))
25 #include <linux/landlock.h>
26 #else
27 struct landlock_ruleset_attr;
28
29 enum landlock_rule_type {
30 LANDLOCK_RULE_PATH_BENEATH = 1,
31 };
32 #endif
33
34 /*
35 * Forward declarations allowing LTTng to build its system call instrumentation
36 * against old kernels which do not declare the more recent system call
37 * argument structure types.
38 */
39 struct clone_args;
40 struct file_handle;
41 struct futex_waitv;
42 struct io_uring_params;
43 struct mmap_arg_struct;
44 struct mmsghdr;
45 struct mount_attr;
46 struct oldold_utsname;
47 struct old_utsname;
48 struct old_itimerspec32;
49 struct old_timespec32;
50 struct old_timeval32;
51 struct old_timex32;
52 struct old_utimbuf32;
53 struct open_how;
54 struct rlimit64;
55 struct rseq;
56 struct sched_attr;
57 struct sel_arg_struct;
58 struct statx;
59 struct user_msghdr;
60
61 struct __aio_sigset;
62 struct __kernel_old_itimerval;
63 struct __kernel_timespec;
64 struct __kernel_timex;
65 struct __kernel_old_timeval;
66 struct __kernel_itimerspec;
67
68 union bpf_attr;
69
70 #ifndef __kernel_long_t
71 typedef long __kernel_long_t;
72 #endif
73
74 typedef __kernel_long_t __kernel_old_time_t;
75 typedef int __bitwise __kernel_rwf_t;
76 typedef __kernel_rwf_t rwf_t;
77 typedef s32 old_time32_t;
78
79 #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,6,0))
80 /*
81 * Forward declaration and typedef for old types expected by MIPS and POWER
82 * system call instrumentation when building against kernel >= 5.6.0. To be
83 * removed after those system call instrumentation headers are regenerated
84 * against a recent kernel.
85 */
86 typedef __kernel_old_time_t time_t;
87
88 struct itimerspec;
89 struct itimerval;
90 struct timeval;
91 struct timex;
92 #endif
93
94 struct trace_syscall_entry {
95 void *event_func;
96 const struct lttng_kernel_event_desc *desc;
97 const struct lttng_kernel_event_field * const *fields;
98 unsigned int nrargs;
99 };
100
101 struct trace_syscall_table {
102 const struct trace_syscall_entry *table;
103 const size_t len;
104 };
105
106 extern
107 void syscall_entry_event_probe(void *__data, struct pt_regs *regs, long id);
108
109 extern
110 void syscall_exit_event_probe(void *__data, struct pt_regs *regs, long ret);
111
112 extern
113 void syscall_entry_event_notifier_probe(void *__data, struct pt_regs *regs,
114 long id);
115 extern
116 void syscall_exit_event_notifier_probe(void *__data, struct pt_regs *regs,
117 long ret);
118
119 #endif /* LTTNG_SYSCALLS_H */
This page took 0.030795 seconds and 4 git commands to generate.