X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=src%2Flttng-syscalls.h;h=ce63973f8f6e430f8c09ca6a1d37ddd3eda3e7f6;hb=d4c1b1de04e5b67db563ed5dd3d229239720c3fb;hp=9a9d9173312fd9143872b6a882a62b82b5efff86;hpb=ebcc64cde7d40a8c9a57b410e209f012531975fe;p=lttng-modules.git diff --git a/src/lttng-syscalls.h b/src/lttng-syscalls.h index 9a9d9173..ce63973f 100644 --- a/src/lttng-syscalls.h +++ b/src/lttng-syscalls.h @@ -1,13 +1,90 @@ +/* SPDX-License-Identifier: (GPL-2.0-only or LGPL-2.1-only) + * + * lttng-syscalls.h + * + * LTTng syscall header. + * + * Copyright (C) 2021 Francis Deslauriers + */ + #ifndef LTTNG_SYSCALLS_H #define LTTNG_SYSCALLS_H -#include +#include +#include +#include +#include +#include +#include +#include #include +#include + +/* + * Forward declarations allowing LTTng to build its system call instrumentation + * against old kernels which do not declare the more recent system call + * argument structure types. + */ +struct clone_args; +struct file_handle; +struct futex_waitv; +struct io_uring_params; +struct mmap_arg_struct; +struct mmsghdr; +struct mount_attr; +struct oldold_utsname; +struct old_utsname; +struct old_itimerspec32; +struct old_timespec32; +struct old_timeval32; +struct old_timex32; +struct old_utimbuf32; +struct open_how; +struct rlimit64; +struct rseq; +struct sched_attr; +struct sel_arg_struct; +struct statx; +struct user_msghdr; + +struct __aio_sigset; +struct __kernel_old_itimerval; +struct __kernel_timespec; +struct __kernel_timex; +struct __kernel_old_timeval; +struct __kernel_itimerspec; + +union bpf_attr; + +#ifndef __kernel_long_t +typedef long __kernel_long_t; +#endif + +typedef __kernel_long_t __kernel_old_time_t; +typedef int __bitwise __kernel_rwf_t; +typedef __kernel_rwf_t rwf_t; +typedef s32 old_time32_t; + +#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,6,0)) +/* + * Forward declaration and typedef for old types expected by MIPS and POWER + * system call instrumentation when building against kernel >= 5.6.0. To be + * removed after those system call instrumentation headers are regenerated + * against a recent kernel. + */ +typedef __kernel_old_time_t time_t; + +struct itimerspec; +struct itimerval; +struct timeval; +struct timex; +#endif + struct trace_syscall_entry { void *event_func; const struct lttng_kernel_event_desc *desc; - const struct lttng_kernel_event_field **fields; + const struct lttng_kernel_event_field * const *fields; unsigned int nrargs; }; @@ -15,4 +92,18 @@ struct trace_syscall_table { const struct trace_syscall_entry *table; const size_t len; }; + +extern +void syscall_entry_event_probe(void *__data, struct pt_regs *regs, long id); + +extern +void syscall_exit_event_probe(void *__data, struct pt_regs *regs, long ret); + +extern +void syscall_entry_event_notifier_probe(void *__data, struct pt_regs *regs, + long id); +extern +void syscall_exit_event_notifier_probe(void *__data, struct pt_regs *regs, + long ret); + #endif /* LTTNG_SYSCALLS_H */