socketpair: extend syscall socketpair tracing information
authorJan Willeke <jan.willeke@harman.com>
Thu, 16 Feb 2017 13:42:51 +0000 (14:42 +0100)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 6 Mar 2017 17:29:03 +0000 (12:29 -0500)
Decode the socketpair vector pointer into two file descriptors.
This exposes the connected file descriptors to analyses.

As sockerpair is a sub syscall of socketcall in x86_32,
sockerpair override must be disabled for x86_32 and x86_compatmode

Signed-off-by: Jan Willeke <jan.willeke@harman.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
instrumentation/syscalls/headers/syscalls_pointers_override.h
lttng-syscalls.c

index 6b12a5623fa4e059c666f56c18f9c55018a011be..8e4d4c7f31776651527080ac754cdaf6e6255767 100644 (file)
@@ -871,4 +871,20 @@ SC_LTTNG_TRACEPOINT_EVENT_CODE(epoll_pwait,
 )
 #endif /* defined(CONFIG_X86_32) || defined(CONFIG_X86_64) || defined(CONFIG_ARM64) || defined(CONFIG_ARM) */
 
+#if (defined(CONFIG_X86_64) && !defined(LTTNG_SC_COMPAT)) || defined(CONFIG_ARM64) || defined(CONFIG_ARM)
+#define OVERRIDE_32_socketpair
+#define OVERRIDE_64_socketpair
+SC_LTTNG_TRACEPOINT_EVENT(socketpair,
+       TP_PROTO(sc_exit(long ret,) int family, int type, int protocol, int *usockvec),
+       TP_ARGS(sc_exit(ret,) family, type, protocol, usockvec),
+       TP_FIELDS(
+               sc_exit(ctf_integer(long, ret, ret))
+               sc_in(ctf_integer(int, family, family))
+               sc_in(ctf_integer(int, type, type))
+               sc_in(ctf_integer(int, protocol, protocol))
+               sc_out(ctf_user_array(int, socket, usockvec, 2))
+       )
+)
+#endif /* (defined(CONFIG_X86_64) && !defined(LTTNG_SC_COMPAT)) || defined(CONFIG_ARM64) || defined(CONFIG_ARM) */
+
 #endif /* CREATE_SYSCALL_TABLE */
index 080355f4e00408922e609df45948c044dc1116a1..11f904af88d0717509d73cf6f3d4e90ae390b933 100644 (file)
@@ -157,6 +157,7 @@ struct user_msghdr;
 
 /* Hijack probe callback for compat system call enter */
 #define TP_PROBE_CB(_template)         &syscall_entry_probe
+#define LTTNG_SC_COMPAT
 #define SC_LTTNG_TRACEPOINT_EVENT(_name, _proto, _args, _fields) \
        LTTNG_TRACEPOINT_EVENT(compat_syscall_entry_##_name, PARAMS(_proto), PARAMS(_args), \
                PARAMS(_fields))
@@ -188,6 +189,7 @@ struct user_msghdr;
 #undef TP_PROBE_CB
 #undef _TRACE_SYSCALLS_INTEGERS_H
 #undef _TRACE_SYSCALLS_POINTERS_H
+#undef LTTNG_SC_COMPAT
 
 #undef SC_ENTER
 
@@ -239,6 +241,7 @@ struct user_msghdr;
 
 /* Hijack probe callback for compat system call exit */
 #define TP_PROBE_CB(_template)         &syscall_exit_probe
+#define LTTNG_SC_COMPAT
 #define SC_LTTNG_TRACEPOINT_EVENT(_name, _proto, _args, _fields) \
        LTTNG_TRACEPOINT_EVENT(compat_syscall_exit_##_name, PARAMS(_proto), PARAMS(_args), \
                PARAMS(_fields))
@@ -270,6 +273,7 @@ struct user_msghdr;
 #undef TP_PROBE_CB
 #undef _TRACE_SYSCALLS_INTEGERS_H
 #undef _TRACE_SYSCALLS_POINTERS_H
+#undef LTTNG_SC_COMPAT
 
 #undef SC_EXIT
 
This page took 0.028273 seconds and 4 git commands to generate.