Fix: add missing typedef and forward declarations for old kernels
[lttng-modules.git] / src / lttng-syscalls.h
... / ...
CommitLineData
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/*
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.
28 */
29struct clone_args;
30struct file_handle;
31struct futex_waitv;
32struct io_uring_params;
33struct mmap_arg_struct;
34struct mmsghdr;
35struct mount_attr;
36struct oldold_utsname;
37struct old_utsname;
38struct old_itimerspec32;
39struct old_timespec32;
40struct old_timeval32;
41struct old_timex32;
42struct old_utimbuf32;
43struct open_how;
44struct rlimit64;
45struct rseq;
46struct sel_arg_struct;
47struct statx;
48struct user_msghdr;
49
50struct __aio_sigset;
51struct __kernel_old_itimerval;
52struct __kernel_timespec;
53struct __kernel_timex;
54struct __kernel_old_timeval;
55struct __kernel_itimerspec;
56
57typedef __kernel_long_t __kernel_old_time_t;
58typedef int __bitwise __kernel_rwf_t;
59typedef __kernel_rwf_t rwf_t;
60typedef s32 old_time32_t;
61
62#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,6,0))
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 */
69typedef __kernel_old_time_t time_t;
70
71struct itimerspec;
72struct itimerval;
73struct timeval;
74struct timex;
75#endif
76
77struct trace_syscall_entry {
78 void *event_func;
79 const struct lttng_kernel_event_desc *desc;
80 const struct lttng_kernel_event_field * const *fields;
81 unsigned int nrargs;
82};
83
84struct trace_syscall_table {
85 const struct trace_syscall_entry *table;
86 const size_t len;
87};
88
89extern
90void syscall_entry_event_probe(void *__data, struct pt_regs *regs, long id);
91
92extern
93void syscall_exit_event_probe(void *__data, struct pt_regs *regs, long ret);
94
95extern
96void syscall_entry_event_notifier_probe(void *__data, struct pt_regs *regs,
97 long id);
98extern
99void syscall_exit_event_notifier_probe(void *__data, struct pt_regs *regs,
100 long ret);
101
102#endif /* LTTNG_SYSCALLS_H */
This page took 0.022942 seconds and 4 git commands to generate.