X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=lttng-syscalls.c;h=3ecb42d98f01fd94a1ada5d3c8baf1404908f546;hb=85e010ada4e06dafde676560c4c9991ff538c607;hp=a43c475e7b7f1f744018fd77f6ea179177ac7290;hpb=b7cdc18250880cc44edeef4a4b42c8ac7a135a6d;p=lttng-modules.git diff --git a/lttng-syscalls.c b/lttng-syscalls.c index a43c475e..3ecb42d9 100644 --- a/lttng-syscalls.c +++ b/lttng-syscalls.c @@ -23,11 +23,10 @@ #include #include -#include -#include -#include -#include #include +#include "lttng-tracepoint.h" + +#define LTTNG_SYSCALL_NR_ARGS 6 #ifndef CONFIG_COMPAT # ifndef is_compat_task @@ -377,7 +376,7 @@ static void syscall_entry_unknown(struct lttng_event *event, { unsigned long args[LTTNG_SYSCALL_NR_ARGS]; - lttng_syscall_get_arguments(current, regs, args); + syscall_get_arguments(current, regs, args); if (unlikely(in_compat_syscall())) __event_probe__compat_syscall_entry_unknown(event, id, args); else @@ -448,7 +447,7 @@ void syscall_entry_probe(void *__data, struct pt_regs *regs, long id) void (*fptr)(void *__data, unsigned long arg0) = entry->func; unsigned long args[LTTNG_SYSCALL_NR_ARGS]; - lttng_syscall_get_arguments(current, regs, args); + syscall_get_arguments(current, regs, args); fptr(event, args[0]); break; } @@ -459,7 +458,7 @@ void syscall_entry_probe(void *__data, struct pt_regs *regs, long id) unsigned long arg1) = entry->func; unsigned long args[LTTNG_SYSCALL_NR_ARGS]; - lttng_syscall_get_arguments(current, regs, args); + syscall_get_arguments(current, regs, args); fptr(event, args[0], args[1]); break; } @@ -471,7 +470,7 @@ void syscall_entry_probe(void *__data, struct pt_regs *regs, long id) unsigned long arg2) = entry->func; unsigned long args[LTTNG_SYSCALL_NR_ARGS]; - lttng_syscall_get_arguments(current, regs, args); + syscall_get_arguments(current, regs, args); fptr(event, args[0], args[1], args[2]); break; } @@ -484,7 +483,7 @@ void syscall_entry_probe(void *__data, struct pt_regs *regs, long id) unsigned long arg3) = entry->func; unsigned long args[LTTNG_SYSCALL_NR_ARGS]; - lttng_syscall_get_arguments(current, regs, args); + syscall_get_arguments(current, regs, args); fptr(event, args[0], args[1], args[2], args[3]); break; } @@ -498,7 +497,7 @@ void syscall_entry_probe(void *__data, struct pt_regs *regs, long id) unsigned long arg4) = entry->func; unsigned long args[LTTNG_SYSCALL_NR_ARGS]; - lttng_syscall_get_arguments(current, regs, args); + syscall_get_arguments(current, regs, args); fptr(event, args[0], args[1], args[2], args[3], args[4]); break; } @@ -513,7 +512,7 @@ void syscall_entry_probe(void *__data, struct pt_regs *regs, long id) unsigned long arg5) = entry->func; unsigned long args[LTTNG_SYSCALL_NR_ARGS]; - lttng_syscall_get_arguments(current, regs, args); + syscall_get_arguments(current, regs, args); fptr(event, args[0], args[1], args[2], args[3], args[4], args[5]); break; @@ -528,7 +527,7 @@ static void syscall_exit_unknown(struct lttng_event *event, { unsigned long args[LTTNG_SYSCALL_NR_ARGS]; - lttng_syscall_get_arguments(current, regs, args); + syscall_get_arguments(current, regs, args); if (unlikely(in_compat_syscall())) __event_probe__compat_syscall_exit_unknown(event, id, ret, args); @@ -604,7 +603,7 @@ void syscall_exit_probe(void *__data, struct pt_regs *regs, long ret) unsigned long arg0) = entry->func; unsigned long args[LTTNG_SYSCALL_NR_ARGS]; - lttng_syscall_get_arguments(current, regs, args); + syscall_get_arguments(current, regs, args); fptr(event, ret, args[0]); break; } @@ -616,7 +615,7 @@ void syscall_exit_probe(void *__data, struct pt_regs *regs, long ret) unsigned long arg1) = entry->func; unsigned long args[LTTNG_SYSCALL_NR_ARGS]; - lttng_syscall_get_arguments(current, regs, args); + syscall_get_arguments(current, regs, args); fptr(event, ret, args[0], args[1]); break; } @@ -629,7 +628,7 @@ void syscall_exit_probe(void *__data, struct pt_regs *regs, long ret) unsigned long arg2) = entry->func; unsigned long args[LTTNG_SYSCALL_NR_ARGS]; - lttng_syscall_get_arguments(current, regs, args); + syscall_get_arguments(current, regs, args); fptr(event, ret, args[0], args[1], args[2]); break; } @@ -643,7 +642,7 @@ void syscall_exit_probe(void *__data, struct pt_regs *regs, long ret) unsigned long arg3) = entry->func; unsigned long args[LTTNG_SYSCALL_NR_ARGS]; - lttng_syscall_get_arguments(current, regs, args); + syscall_get_arguments(current, regs, args); fptr(event, ret, args[0], args[1], args[2], args[3]); break; } @@ -658,7 +657,7 @@ void syscall_exit_probe(void *__data, struct pt_regs *regs, long ret) unsigned long arg4) = entry->func; unsigned long args[LTTNG_SYSCALL_NR_ARGS]; - lttng_syscall_get_arguments(current, regs, args); + syscall_get_arguments(current, regs, args); fptr(event, ret, args[0], args[1], args[2], args[3], args[4]); break; } @@ -674,7 +673,7 @@ void syscall_exit_probe(void *__data, struct pt_regs *regs, long ret) unsigned long arg5) = entry->func; unsigned long args[LTTNG_SYSCALL_NR_ARGS]; - lttng_syscall_get_arguments(current, regs, args); + syscall_get_arguments(current, regs, args); fptr(event, ret, args[0], args[1], args[2], args[3], args[4], args[5]); break; @@ -761,8 +760,6 @@ int lttng_syscalls_register(struct lttng_channel *chan, void *filter) 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 *) @@ -885,7 +882,7 @@ int lttng_syscalls_register(struct lttng_channel *chan, void *filter) 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; @@ -896,10 +893,10 @@ int lttng_syscalls_register(struct lttng_channel *chan, void *filter) * 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) { - 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; } @@ -918,14 +915,14 @@ int lttng_syscalls_unregister(struct lttng_channel *chan) if (!chan->sc_table) return 0; if (chan->sys_enter_registered) { - ret = lttng_wrapper_tracepoint_probe_unregister("sys_enter", + ret = lttng_tracepoint_probe_unregister("sys_enter", (void *) syscall_entry_probe, chan); if (ret) return ret; chan->sys_enter_registered = 0; } if (chan->sys_exit_registered) { - ret = lttng_wrapper_tracepoint_probe_unregister("sys_exit", + ret = lttng_tracepoint_probe_unregister("sys_exit", (void *) syscall_exit_probe, chan); if (ret) return ret; @@ -1297,7 +1294,7 @@ int lttng_abi_syscall_list(void) 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;