Drop 'linux/file.h' wrapper
[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
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
29struct clone_args;
30struct file_handle;
31struct futex_waitv;
32struct io_uring_params;
33struct mmap_arg_struct;
e42c4f49 34struct mmsghdr;
d8539681 35struct mount_attr;
e42c4f49
FD
36struct oldold_utsname;
37struct old_utsname;
d8539681
MD
38struct old_itimerspec32;
39struct old_timespec32;
40struct old_timeval32;
41struct old_timex32;
42struct old_utimbuf32;
43struct open_how;
44struct rlimit64;
45struct rseq;
b3ab2950 46struct sched_attr;
e42c4f49 47struct sel_arg_struct;
d8539681 48struct statx;
e42c4f49 49struct user_msghdr;
d8539681
MD
50
51struct __aio_sigset;
7aedbe65 52struct __kernel_old_itimerval;
d8539681
MD
53struct __kernel_timespec;
54struct __kernel_timex;
55struct __kernel_old_timeval;
56struct __kernel_itimerspec;
e42c4f49 57
b3ab2950
MD
58union bpf_attr;
59
60#ifndef __kernel_long_t
61typedef long __kernel_long_t;
62#endif
63
d8539681
MD
64typedef __kernel_long_t __kernel_old_time_t;
65typedef int __bitwise __kernel_rwf_t;
66typedef __kernel_rwf_t rwf_t;
67typedef s32 old_time32_t;
e42c4f49
FD
68
69#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,6,0))
d8539681
MD
70/*
71 * Forward declaration and typedef for old types expected by MIPS and POWER
72 * system call instrumentation when building against kernel >= 5.6.0. To be
73 * removed after those system call instrumentation headers are regenerated
74 * against a recent kernel.
75 */
e42c4f49 76typedef __kernel_old_time_t time_t;
d8539681
MD
77
78struct itimerspec;
79struct itimerval;
80struct timeval;
81struct timex;
e42c4f49
FD
82#endif
83
ebcc64cd
FD
84struct trace_syscall_entry {
85 void *event_func;
86 const struct lttng_kernel_event_desc *desc;
4f1d1ee5 87 const struct lttng_kernel_event_field * const *fields;
ebcc64cd
FD
88 unsigned int nrargs;
89};
90
91struct trace_syscall_table {
92 const struct trace_syscall_entry *table;
93 const size_t len;
94};
e42c4f49
FD
95
96extern
97void syscall_entry_event_probe(void *__data, struct pt_regs *regs, long id);
98
99extern
100void syscall_exit_event_probe(void *__data, struct pt_regs *regs, long ret);
101
102extern
103void syscall_entry_event_notifier_probe(void *__data, struct pt_regs *regs,
104 long id);
105extern
106void syscall_exit_event_notifier_probe(void *__data, struct pt_regs *regs,
107 long ret);
108
ebcc64cd 109#endif /* LTTNG_SYSCALLS_H */
This page took 0.03479 seconds and 4 git commands to generate.