projects
/
lttng-modules.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
instrumentation: power: remove compatibility code
[lttng-modules.git]
/
lttng-syscalls.c
diff --git
a/lttng-syscalls.c
b/lttng-syscalls.c
index bcc06b5cd03759db0334756b3433e806c58e3093..3ecb42d98f01fd94a1ada5d3c8baf1404908f546 100644
(file)
--- a/
lttng-syscalls.c
+++ b/
lttng-syscalls.c
@@
-1,4
+1,4
@@
-/* SPDX-License-Identifier: (GPL-2.0
or LGPL-2.1
)
+/* SPDX-License-Identifier: (GPL-2.0
-only or LGPL-2.1-only
)
*
* lttng-syscalls.c
*
*
* lttng-syscalls.c
*
@@
-18,14
+18,15
@@
#include <linux/stringify.h>
#include <linux/file.h>
#include <linux/anon_inodes.h>
#include <linux/stringify.h>
#include <linux/file.h>
#include <linux/anon_inodes.h>
+#include <linux/fcntl.h>
#include <asm/ptrace.h>
#include <asm/syscall.h>
#include <lib/bitfield.h>
#include <asm/ptrace.h>
#include <asm/syscall.h>
#include <lib/bitfield.h>
-#include <wrapper/tracepoint.h>
-#include <wrapper/file.h>
-#include <wrapper/rcu.h>
#include <lttng-events.h>
#include <lttng-events.h>
+#include "lttng-tracepoint.h"
+
+#define LTTNG_SYSCALL_NR_ARGS 6
#ifndef CONFIG_COMPAT
# ifndef is_compat_task
#ifndef CONFIG_COMPAT
# ifndef is_compat_task
@@
-72,6
+73,18
@@
struct mmap_arg_struct;
struct file_handle;
struct user_msghdr;
struct file_handle;
struct user_msghdr;
+/*
+ * Forward declaration for kernels >= 5.6
+ */
+struct timex;
+struct timeval;
+struct itimerval;
+struct itimerspec;
+
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0))
+typedef __kernel_old_time_t time_t;
+#endif
+
#ifdef IA32_NR_syscalls
#define NR_compat_syscalls IA32_NR_syscalls
#else
#ifdef IA32_NR_syscalls
#define NR_compat_syscalls IA32_NR_syscalls
#else
@@
-361,9
+374,9
@@
struct lttng_syscall_filter {
static void syscall_entry_unknown(struct lttng_event *event,
struct pt_regs *regs, unsigned int id)
{
static void syscall_entry_unknown(struct lttng_event *event,
struct pt_regs *regs, unsigned int id)
{
- unsigned long args[
UNKNOWN_SYSCALL_NR
ARGS];
+ unsigned long args[
LTTNG_SYSCALL_NR_
ARGS];
- syscall_get_arguments(current, regs,
0, UNKNOWN_SYSCALL_NRARGS,
args);
+ syscall_get_arguments(current, regs, args);
if (unlikely(in_compat_syscall()))
__event_probe__compat_syscall_entry_unknown(event, id, args);
else
if (unlikely(in_compat_syscall()))
__event_probe__compat_syscall_entry_unknown(event, id, args);
else
@@
-432,9
+445,9
@@
void syscall_entry_probe(void *__data, struct pt_regs *regs, long id)
case 1:
{
void (*fptr)(void *__data, unsigned long arg0) = entry->func;
case 1:
{
void (*fptr)(void *__data, unsigned long arg0) = entry->func;
- unsigned long args[
1
];
+ unsigned long args[
LTTNG_SYSCALL_NR_ARGS
];
- syscall_get_arguments(current, regs,
0, entry->nrargs,
args);
+ syscall_get_arguments(current, regs, args);
fptr(event, args[0]);
break;
}
fptr(event, args[0]);
break;
}
@@
-443,9
+456,9
@@
void syscall_entry_probe(void *__data, struct pt_regs *regs, long id)
void (*fptr)(void *__data,
unsigned long arg0,
unsigned long arg1) = entry->func;
void (*fptr)(void *__data,
unsigned long arg0,
unsigned long arg1) = entry->func;
- unsigned long args[
2
];
+ unsigned long args[
LTTNG_SYSCALL_NR_ARGS
];
- syscall_get_arguments(current, regs,
0, entry->nrargs,
args);
+ syscall_get_arguments(current, regs, args);
fptr(event, args[0], args[1]);
break;
}
fptr(event, args[0], args[1]);
break;
}
@@
-455,9
+468,9
@@
void syscall_entry_probe(void *__data, struct pt_regs *regs, long id)
unsigned long arg0,
unsigned long arg1,
unsigned long arg2) = entry->func;
unsigned long arg0,
unsigned long arg1,
unsigned long arg2) = entry->func;
- unsigned long args[
3
];
+ unsigned long args[
LTTNG_SYSCALL_NR_ARGS
];
- syscall_get_arguments(current, regs,
0, entry->nrargs,
args);
+ syscall_get_arguments(current, regs, args);
fptr(event, args[0], args[1], args[2]);
break;
}
fptr(event, args[0], args[1], args[2]);
break;
}
@@
-468,9
+481,9
@@
void syscall_entry_probe(void *__data, struct pt_regs *regs, long id)
unsigned long arg1,
unsigned long arg2,
unsigned long arg3) = entry->func;
unsigned long arg1,
unsigned long arg2,
unsigned long arg3) = entry->func;
- unsigned long args[
4
];
+ unsigned long args[
LTTNG_SYSCALL_NR_ARGS
];
- syscall_get_arguments(current, regs,
0, entry->nrargs,
args);
+ syscall_get_arguments(current, regs, args);
fptr(event, args[0], args[1], args[2], args[3]);
break;
}
fptr(event, args[0], args[1], args[2], args[3]);
break;
}
@@
-482,9
+495,9
@@
void syscall_entry_probe(void *__data, struct pt_regs *regs, long id)
unsigned long arg2,
unsigned long arg3,
unsigned long arg4) = entry->func;
unsigned long arg2,
unsigned long arg3,
unsigned long arg4) = entry->func;
- unsigned long args[
5
];
+ unsigned long args[
LTTNG_SYSCALL_NR_ARGS
];
- syscall_get_arguments(current, regs,
0, entry->nrargs,
args);
+ syscall_get_arguments(current, regs, args);
fptr(event, args[0], args[1], args[2], args[3], args[4]);
break;
}
fptr(event, args[0], args[1], args[2], args[3], args[4]);
break;
}
@@
-497,9
+510,9
@@
void syscall_entry_probe(void *__data, struct pt_regs *regs, long id)
unsigned long arg3,
unsigned long arg4,
unsigned long arg5) = entry->func;
unsigned long arg3,
unsigned long arg4,
unsigned long arg5) = entry->func;
- unsigned long args[
6
];
+ unsigned long args[
LTTNG_SYSCALL_NR_ARGS
];
- syscall_get_arguments(current, regs,
0, entry->nrargs,
args);
+ syscall_get_arguments(current, regs, args);
fptr(event, args[0], args[1], args[2],
args[3], args[4], args[5]);
break;
fptr(event, args[0], args[1], args[2],
args[3], args[4], args[5]);
break;
@@
-512,9
+525,9
@@
void syscall_entry_probe(void *__data, struct pt_regs *regs, long id)
static void syscall_exit_unknown(struct lttng_event *event,
struct pt_regs *regs, int id, long ret)
{
static void syscall_exit_unknown(struct lttng_event *event,
struct pt_regs *regs, int id, long ret)
{
- unsigned long args[
UNKNOWN_SYSCALL_NR
ARGS];
+ unsigned long args[
LTTNG_SYSCALL_NR_
ARGS];
- syscall_get_arguments(current, regs,
0, UNKNOWN_SYSCALL_NRARGS,
args);
+ syscall_get_arguments(current, regs, args);
if (unlikely(in_compat_syscall()))
__event_probe__compat_syscall_exit_unknown(event, id, ret,
args);
if (unlikely(in_compat_syscall()))
__event_probe__compat_syscall_exit_unknown(event, id, ret,
args);
@@
-588,9
+601,9
@@
void syscall_exit_probe(void *__data, struct pt_regs *regs, long ret)
void (*fptr)(void *__data,
long ret,
unsigned long arg0) = entry->func;
void (*fptr)(void *__data,
long ret,
unsigned long arg0) = entry->func;
- unsigned long args[
1
];
+ unsigned long args[
LTTNG_SYSCALL_NR_ARGS
];
- syscall_get_arguments(current, regs,
0, entry->nrargs,
args);
+ syscall_get_arguments(current, regs, args);
fptr(event, ret, args[0]);
break;
}
fptr(event, ret, args[0]);
break;
}
@@
-600,9
+613,9
@@
void syscall_exit_probe(void *__data, struct pt_regs *regs, long ret)
long ret,
unsigned long arg0,
unsigned long arg1) = entry->func;
long ret,
unsigned long arg0,
unsigned long arg1) = entry->func;
- unsigned long args[
2
];
+ unsigned long args[
LTTNG_SYSCALL_NR_ARGS
];
- syscall_get_arguments(current, regs,
0, entry->nrargs,
args);
+ syscall_get_arguments(current, regs, args);
fptr(event, ret, args[0], args[1]);
break;
}
fptr(event, ret, args[0], args[1]);
break;
}
@@
-613,9
+626,9
@@
void syscall_exit_probe(void *__data, struct pt_regs *regs, long ret)
unsigned long arg0,
unsigned long arg1,
unsigned long arg2) = entry->func;
unsigned long arg0,
unsigned long arg1,
unsigned long arg2) = entry->func;
- unsigned long args[
3
];
+ unsigned long args[
LTTNG_SYSCALL_NR_ARGS
];
- syscall_get_arguments(current, regs,
0, entry->nrargs,
args);
+ syscall_get_arguments(current, regs, args);
fptr(event, ret, args[0], args[1], args[2]);
break;
}
fptr(event, ret, args[0], args[1], args[2]);
break;
}
@@
-627,9
+640,9
@@
void syscall_exit_probe(void *__data, struct pt_regs *regs, long ret)
unsigned long arg1,
unsigned long arg2,
unsigned long arg3) = entry->func;
unsigned long arg1,
unsigned long arg2,
unsigned long arg3) = entry->func;
- unsigned long args[
4
];
+ unsigned long args[
LTTNG_SYSCALL_NR_ARGS
];
- syscall_get_arguments(current, regs,
0, entry->nrargs,
args);
+ syscall_get_arguments(current, regs, args);
fptr(event, ret, args[0], args[1], args[2], args[3]);
break;
}
fptr(event, ret, args[0], args[1], args[2], args[3]);
break;
}
@@
-642,9
+655,9
@@
void syscall_exit_probe(void *__data, struct pt_regs *regs, long ret)
unsigned long arg2,
unsigned long arg3,
unsigned long arg4) = entry->func;
unsigned long arg2,
unsigned long arg3,
unsigned long arg4) = entry->func;
- unsigned long args[
5
];
+ unsigned long args[
LTTNG_SYSCALL_NR_ARGS
];
- syscall_get_arguments(current, regs,
0, entry->nrargs,
args);
+ syscall_get_arguments(current, regs, args);
fptr(event, ret, args[0], args[1], args[2], args[3], args[4]);
break;
}
fptr(event, ret, args[0], args[1], args[2], args[3], args[4]);
break;
}
@@
-658,9
+671,9
@@
void syscall_exit_probe(void *__data, struct pt_regs *regs, long ret)
unsigned long arg3,
unsigned long arg4,
unsigned long arg5) = entry->func;
unsigned long arg3,
unsigned long arg4,
unsigned long arg5) = entry->func;
- unsigned long args[
6
];
+ unsigned long args[
LTTNG_SYSCALL_NR_ARGS
];
- syscall_get_arguments(current, regs,
0, entry->nrargs,
args);
+ syscall_get_arguments(current, regs, args);
fptr(event, ret, args[0], args[1], args[2],
args[3], args[4], args[5]);
break;
fptr(event, ret, args[0], args[1], args[2],
args[3], args[4], args[5]);
break;
@@
-747,8
+760,6
@@
int lttng_syscalls_register(struct lttng_channel *chan, void *filter)
struct lttng_kernel_event ev;
int ret;
struct lttng_kernel_event ev;
int ret;
- wrapper_vmalloc_sync_all();
-
if (!chan->sc_table) {
/* create syscall table mapping syscall to events */
chan->sc_table = kzalloc(sizeof(struct lttng_event *)
if (!chan->sc_table) {
/* create syscall table mapping syscall to events */
chan->sc_table = kzalloc(sizeof(struct lttng_event *)
@@
-871,7
+882,7
@@
int lttng_syscalls_register(struct lttng_channel *chan, void *filter)
return ret;
#endif
if (!chan->sys_enter_registered) {
return ret;
#endif
if (!chan->sys_enter_registered) {
- ret = lttng_
wrapper_
tracepoint_probe_register("sys_enter",
+ ret = lttng_tracepoint_probe_register("sys_enter",
(void *) syscall_entry_probe, chan);
if (ret)
return ret;
(void *) syscall_entry_probe, chan);
if (ret)
return ret;
@@
-882,10
+893,10
@@
int lttng_syscalls_register(struct lttng_channel *chan, void *filter)
* conflict with sys_exit syscall entry.
*/
if (!chan->sys_exit_registered) {
* conflict with sys_exit syscall entry.
*/
if (!chan->sys_exit_registered) {
- ret = lttng_
wrapper_
tracepoint_probe_register("sys_exit",
+ ret = lttng_tracepoint_probe_register("sys_exit",
(void *) syscall_exit_probe, chan);
if (ret) {
(void *) syscall_exit_probe, chan);
if (ret) {
- WARN_ON_ONCE(lttng_
wrapper_
tracepoint_probe_unregister("sys_enter",
+ WARN_ON_ONCE(lttng_tracepoint_probe_unregister("sys_enter",
(void *) syscall_entry_probe, chan));
return ret;
}
(void *) syscall_entry_probe, chan));
return ret;
}
@@
-904,15
+915,15
@@
int lttng_syscalls_unregister(struct lttng_channel *chan)
if (!chan->sc_table)
return 0;
if (chan->sys_enter_registered) {
if (!chan->sc_table)
return 0;
if (chan->sys_enter_registered) {
- ret = lttng_
wrapper_tracepoint_probe_unregister("sys_exit
",
- (void *) syscall_e
xit
_probe, chan);
+ ret = lttng_
tracepoint_probe_unregister("sys_enter
",
+ (void *) syscall_e
ntry
_probe, chan);
if (ret)
return ret;
chan->sys_enter_registered = 0;
}
if (chan->sys_exit_registered) {
if (ret)
return ret;
chan->sys_enter_registered = 0;
}
if (chan->sys_exit_registered) {
- ret = lttng_
wrapper_tracepoint_probe_unregister("sys_enter
",
- (void *) syscall_e
ntry
_probe, chan);
+ ret = lttng_
tracepoint_probe_unregister("sys_exit
",
+ (void *) syscall_e
xit
_probe, chan);
if (ret)
return ret;
chan->sys_exit_registered = 0;
if (ret)
return ret;
chan->sys_exit_registered = 0;
@@
-1283,7
+1294,7
@@
int lttng_abi_syscall_list(void)
struct file *syscall_list_file;
int file_fd, ret;
struct file *syscall_list_file;
int file_fd, ret;
- file_fd =
lttng_get_unused_fd(
);
+ file_fd =
get_unused_fd_flags(0
);
if (file_fd < 0) {
ret = file_fd;
goto fd_error;
if (file_fd < 0) {
ret = file_fd;
goto fd_error;
This page took
0.02799 seconds
and
4
git commands to generate.