+/* SPDX-License-Identifier: (GPL-2.0 or LGPL-2.1) */
+
#ifndef CREATE_SYSCALL_TABLE
#define OVERRIDE_32_execve
} \
\
if (inp) { \
- tp_locvar->fds_in = kmalloc( \
- tp_locvar->nr_ulong * sizeof(unsigned long), \
- GFP_ATOMIC | GFP_NOWAIT); \
+ tp_locvar->fds_in = lttng_tp_mempool_alloc( \
+ tp_locvar->nr_ulong * sizeof(unsigned long)); \
if (!tp_locvar->fds_in) \
goto error; \
\
goto error; \
} \
if (outp) { \
- tp_locvar->fds_out = kmalloc( \
- tp_locvar->nr_ulong * sizeof(unsigned long), \
- GFP_ATOMIC | GFP_NOWAIT); \
+ tp_locvar->fds_out = lttng_tp_mempool_alloc( \
+ tp_locvar->nr_ulong * sizeof(unsigned long)); \
if (!tp_locvar->fds_out) \
goto error; \
\
goto error; \
} \
if (exp) { \
- tp_locvar->fds_ex = kmalloc( \
- tp_locvar->nr_ulong * sizeof(unsigned long), \
- GFP_ATOMIC | GFP_NOWAIT); \
+ tp_locvar->fds_ex = lttng_tp_mempool_alloc( \
+ tp_locvar->nr_ulong * sizeof(unsigned long)); \
if (!tp_locvar->fds_ex) \
goto error; \
\
)
#define LTTNG_SYSCALL_SELECT_code_post \
- kfree(tp_locvar->fds_in); \
- kfree(tp_locvar->fds_out); \
- kfree(tp_locvar->fds_ex);
+ lttng_tp_mempool_free(tp_locvar->fds_in); \
+ lttng_tp_mempool_free(tp_locvar->fds_out); \
+ lttng_tp_mempool_free(tp_locvar->fds_ex);
-#if defined(CONFIG_X86_32) || defined(CONFIG_X86_64)
+#if defined(CONFIG_X86_32) || defined(CONFIG_X86_64) || defined(CONFIG_ARM)
#define OVERRIDE_32_select
#define OVERRIDE_64_select
SC_LTTNG_TRACEPOINT_EVENT_CODE(select,
LTTNG_SYSCALL_SELECT_code_post
)
)
-#endif /* defined(CONFIG_X86_32) || defined(CONFIG_X86_64) */
+#endif /* defined(CONFIG_X86_32) || defined(CONFIG_X86_64) || defined(CONFIG_ARM) */
#if defined(CONFIG_X86_32) || defined(CONFIG_X86_64) || defined(CONFIG_ARM64) || defined(CONFIG_ARM)
#define OVERRIDE_32_pselect6
{ \
int err; \
\
- tp_locvar->fds = kmalloc(tp_locvar->alloc_fds, \
- GFP_ATOMIC | GFP_NOWAIT); \
+ tp_locvar->fds = lttng_tp_mempool_alloc(tp_locvar->alloc_fds); \
if (!tp_locvar->fds) \
goto error; \
err = lib_ring_buffer_copy_from_user_check_nofault( \
)
#define LTTNG_SYSCALL_POLL_code_post \
- kfree(tp_locvar->fds);
+ lttng_tp_mempool_free(tp_locvar->fds);
-#if defined(CONFIG_X86_32) || defined(CONFIG_X86_64)
+#if defined(CONFIG_X86_32) || defined(CONFIG_X86_64) || defined(CONFIG_ARM)
#define OVERRIDE_32_poll
#define OVERRIDE_64_poll
SC_LTTNG_TRACEPOINT_EVENT_CODE(poll,
LTTNG_SYSCALL_POLL_code_post
)
)
-#endif /* defined(CONFIG_X86_32) || defined(CONFIG_X86_64) */
+#endif /* defined(CONFIG_X86_32) || defined(CONFIG_X86_64) || defined(CONFIG_ARM) */
#if defined(CONFIG_X86_32) || defined(CONFIG_X86_64) || defined(CONFIG_ARM64) || defined(CONFIG_ARM)
#define OVERRIDE_32_ppoll
tp_locvar->fds_length = ret; \
} \
\
- tp_locvar->events = kmalloc( \
- maxalloc * sizeof(struct epoll_event), \
- GFP_ATOMIC | GFP_NOWAIT); \
+ tp_locvar->events = lttng_tp_mempool_alloc( \
+ maxalloc * sizeof(struct epoll_event)); \
if (!tp_locvar->events) { \
tp_locvar->fds_length = 0; \
goto skip_code; \
#define LTTNG_SYSCALL_EPOLL_WAIT_code_post \
sc_out( \
- kfree(tp_locvar->events); \
+ lttng_tp_mempool_free(tp_locvar->events); \
)
-#if defined(CONFIG_X86_32) || defined(CONFIG_X86_64)
+#if defined(CONFIG_X86_32) || defined(CONFIG_X86_64) || defined(CONFIG_ARM)
#define OVERRIDE_32_epoll_wait
#define OVERRIDE_64_epoll_wait
SC_LTTNG_TRACEPOINT_EVENT_CODE(epoll_wait,
LTTNG_SYSCALL_EPOLL_WAIT_code_post
)
)
-#endif /* defined(CONFIG_X86_32) || defined(CONFIG_X86_64) */
+#endif /* defined(CONFIG_X86_32) || defined(CONFIG_X86_64) || defined(CONFIG_ARM) */
#if defined(CONFIG_X86_32) || defined(CONFIG_X86_64) || defined(CONFIG_ARM64) || defined(CONFIG_ARM)
#define OVERRIDE_32_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 */