Rename "tsc" to "timestamp"
[lttng-modules.git] / src / lttng-syscalls.h
CommitLineData
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
a2819bd6
JG
24#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,13,0))
25#include <linux/landlock.h>
26#else
27struct landlock_ruleset_attr;
28
29enum landlock_rule_type {
30 LANDLOCK_RULE_PATH_BENEATH = 1,
31};
32#endif
33
e42c4f49 34/*
d8539681
MD
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.
e42c4f49 38 */
d8539681
MD
39struct clone_args;
40struct file_handle;
41struct futex_waitv;
42struct io_uring_params;
43struct mmap_arg_struct;
e42c4f49 44struct mmsghdr;
d8539681 45struct mount_attr;
e42c4f49
FD
46struct oldold_utsname;
47struct old_utsname;
d8539681
MD
48struct old_itimerspec32;
49struct old_timespec32;
50struct old_timeval32;
51struct old_timex32;
52struct old_utimbuf32;
53struct open_how;
54struct rlimit64;
55struct rseq;
b3ab2950 56struct sched_attr;
e42c4f49 57struct sel_arg_struct;
d8539681 58struct statx;
e42c4f49 59struct user_msghdr;
d8539681
MD
60
61struct __aio_sigset;
7aedbe65 62struct __kernel_old_itimerval;
d8539681
MD
63struct __kernel_timespec;
64struct __kernel_timex;
65struct __kernel_old_timeval;
66struct __kernel_itimerspec;
e42c4f49 67
b3ab2950
MD
68union bpf_attr;
69
70#ifndef __kernel_long_t
71typedef long __kernel_long_t;
72#endif
73
d8539681
MD
74typedef __kernel_long_t __kernel_old_time_t;
75typedef int __bitwise __kernel_rwf_t;
76typedef __kernel_rwf_t rwf_t;
77typedef s32 old_time32_t;
e42c4f49
FD
78
79#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,6,0))
d8539681
MD
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 */
e42c4f49 86typedef __kernel_old_time_t time_t;
d8539681
MD
87
88struct itimerspec;
89struct itimerval;
90struct timeval;
91struct timex;
e42c4f49
FD
92#endif
93
ebcc64cd
FD
94struct trace_syscall_entry {
95 void *event_func;
96 const struct lttng_kernel_event_desc *desc;
4f1d1ee5 97 const struct lttng_kernel_event_field * const *fields;
ebcc64cd
FD
98 unsigned int nrargs;
99};
100
101struct trace_syscall_table {
102 const struct trace_syscall_entry *table;
103 const size_t len;
104};
e42c4f49
FD
105
106extern
107void syscall_entry_event_probe(void *__data, struct pt_regs *regs, long id);
108
109extern
110void syscall_exit_event_probe(void *__data, struct pt_regs *regs, long ret);
111
112extern
113void syscall_entry_event_notifier_probe(void *__data, struct pt_regs *regs,
114 long id);
115extern
116void syscall_exit_event_notifier_probe(void *__data, struct pt_regs *regs,
117 long ret);
118
ebcc64cd 119#endif /* LTTNG_SYSCALLS_H */
This page took 0.042162 seconds and 4 git commands to generate.