Extract input/output arguments from accept and connect syscalls
[lttng-modules.git] / lttng-syscalls.c
index 029c806bfb4595accea7eb9d893da412abc7f07f..1840caf57d6de50270e3bbac3e9d414c1b372410 100644 (file)
@@ -25,6 +25,8 @@
 #include <linux/compat.h>
 #include <linux/err.h>
 #include <linux/bitmap.h>
+#include <linux/in.h>
+#include <linux/in6.h>
 #include <asm/ptrace.h>
 #include <asm/syscall.h>
 
@@ -94,12 +96,14 @@ struct mmap_arg_struct;
 
 #define SC_ENTER
 
-#undef SC_EXIT_PROTO
-#define SC_EXIT_PROTO(...)
-#undef SC_EXIT_ARGS
-#define SC_EXIT_ARGS(...)
 #undef sc_exit
 #define sc_exit(...)
+#undef sc_in
+#define sc_in(...)     __VA_ARGS__
+#undef sc_out
+#define sc_out(...)
+#undef sc_inout
+#define sc_inout(...)  __VA_ARGS__
 
 /* Hijack probe callback for system call enter */
 #undef TP_PROBE_CB
@@ -107,6 +111,10 @@ struct mmap_arg_struct;
 #define SC_TRACE_EVENT(_name, _proto, _args, _struct, _assign, _printk)        \
        TRACE_EVENT(syscall_enter_##_name, PARAMS(_proto), PARAMS(_args),\
                PARAMS(_struct), PARAMS(_assign), PARAMS(_printk))
+#define SC_LTTNG_TRACE_EVENT(_name, _proto, _args, _locvar, _code, _struct, _assign, _printk) \
+       LTTNG_TRACE_EVENT(syscall_enter_##_name, PARAMS(_proto), PARAMS(_args),\
+               PARAMS(_locvar), PARAMS(_code),\
+               PARAMS(_struct), PARAMS(_assign), PARAMS(_printk))
 #define SC_DECLARE_EVENT_CLASS_NOARGS(_name, _struct, _assign, _printk)        \
        DECLARE_EVENT_CLASS_NOARGS(syscall_enter_##_name, PARAMS(_struct), PARAMS(_assign),\
                PARAMS(_printk))
@@ -123,6 +131,7 @@ struct mmap_arg_struct;
 #include "instrumentation/syscalls/headers/syscalls_pointers.h"
 #undef TRACE_INCLUDE_FILE
 #undef TRACE_SYSTEM
+#undef SC_LTTNG_TRACE_EVENT
 #undef SC_TRACE_EVENT
 #undef SC_DECLARE_EVENT_CLASS_NOARGS
 #undef SC_DEFINE_EVENT_NOARGS
@@ -137,6 +146,10 @@ struct mmap_arg_struct;
        TRACE_EVENT(compat_syscall_enter_##_name, PARAMS(_proto), PARAMS(_args), \
                PARAMS(_struct), PARAMS(_assign),                       \
                PARAMS(_printk))
+#define SC_LTTNG_TRACE_EVENT(_name, _proto, _args, _locvar, _code, _struct, _assign, _printk) \
+       LTTNG_TRACE_EVENT(compat_syscall_enter_##_name, PARAMS(_proto), PARAMS(_args),\
+               PARAMS(_locvar), PARAMS(_code),\
+               PARAMS(_struct), PARAMS(_assign), PARAMS(_printk))
 #define SC_DECLARE_EVENT_CLASS_NOARGS(_name, _struct, _assign, _printk) \
        DECLARE_EVENT_CLASS_NOARGS(compat_syscall_enter_##_name, PARAMS(_struct), \
                PARAMS(_assign), PARAMS(_printk))
@@ -153,6 +166,7 @@ struct mmap_arg_struct;
 #include "instrumentation/syscalls/headers/compat_syscalls_pointers.h"
 #undef TRACE_INCLUDE_FILE
 #undef TRACE_SYSTEM
+#undef SC_LTTNG_TRACE_EVENT
 #undef SC_TRACE_EVENT
 #undef SC_DECLARE_EVENT_CLASS_NOARGS
 #undef SC_DEFINE_EVENT_NOARGS
@@ -164,18 +178,24 @@ struct mmap_arg_struct;
 
 #define SC_EXIT
 
-#undef SC_EXIT_PROTO
-#define SC_EXIT_PROTO(...)     __VA_ARGS__
-#undef SC_EXIT_ARGS
-#define SC_EXIT_ARGS(...)      __VA_ARGS__
 #undef sc_exit
 #define sc_exit(...)           __VA_ARGS__
+#undef sc_in
+#define sc_in(...)
+#undef sc_out
+#define sc_out(...)            __VA_ARGS__
+#undef sc_inout
+#define sc_inout(...)          __VA_ARGS__
 
 /* Hijack probe callback for system call exit */
 #define TP_PROBE_CB(_template)         &syscall_exit_probe
 #define SC_TRACE_EVENT(_name, _proto, _args, _struct, _assign, _printk)        \
        TRACE_EVENT(syscall_exit_##_name, PARAMS(_proto), PARAMS(_args),\
                PARAMS(_struct), PARAMS(_assign), PARAMS(_printk))
+#define SC_LTTNG_TRACE_EVENT(_name, _proto, _args, _locvar, _code, _struct, _assign, _printk) \
+       LTTNG_TRACE_EVENT(syscall_exit_##_name, PARAMS(_proto), PARAMS(_args),\
+               PARAMS(_locvar), PARAMS(_code),\
+               PARAMS(_struct), PARAMS(_assign), PARAMS(_printk))
 #define SC_DECLARE_EVENT_CLASS_NOARGS(_name, _struct, _assign, _printk) \
        DECLARE_EVENT_CLASS_NOARGS(syscall_exit_##_name, PARAMS(_struct), \
                PARAMS(_assign), PARAMS(_printk))
@@ -192,6 +212,7 @@ struct mmap_arg_struct;
 #include "instrumentation/syscalls/headers/syscalls_pointers.h"
 #undef TRACE_INCLUDE_FILE
 #undef TRACE_SYSTEM
+#undef SC_LTTNG_TRACE_EVENT
 #undef SC_TRACE_EVENT
 #undef SC_DECLARE_EVENT_CLASS_NOARGS
 #undef SC_DEFINE_EVENT_NOARGS
@@ -205,6 +226,10 @@ struct mmap_arg_struct;
 #define SC_TRACE_EVENT(_name, _proto, _args, _struct, _assign, _printk)        \
        TRACE_EVENT(compat_syscall_exit_##_name, PARAMS(_proto), PARAMS(_args), \
                PARAMS(_struct), PARAMS(_assign), PARAMS(_printk))
+#define SC_LTTNG_TRACE_EVENT(_name, _proto, _args, _locvar, _code, _struct, _assign, _printk) \
+       LTTNG_TRACE_EVENT(compat_syscall_exit_##_name, PARAMS(_proto), PARAMS(_args),\
+               PARAMS(_locvar), PARAMS(_code),\
+               PARAMS(_struct), PARAMS(_assign), PARAMS(_printk))
 #define SC_DECLARE_EVENT_CLASS_NOARGS(_name, _struct, _assign, _printk) \
        DECLARE_EVENT_CLASS_NOARGS(compat_syscall_exit_##_name, PARAMS(_struct), \
                PARAMS(_assign), PARAMS(_printk))
@@ -221,6 +246,7 @@ struct mmap_arg_struct;
 #include "instrumentation/syscalls/headers/compat_syscalls_pointers.h"
 #undef TRACE_INCLUDE_FILE
 #undef TRACE_SYSTEM
+#undef SC_LTTNG_TRACE_EVENT
 #undef SC_TRACE_EVENT
 #undef SC_DECLARE_EVENT_CLASS_NOARGS
 #undef SC_DEFINE_EVENT_NOARGS
This page took 0.025468 seconds and 4 git commands to generate.