From: Mathieu Desnoyers Date: Fri, 5 Nov 2021 14:56:30 +0000 (-0400) Subject: Refactoring: syscall: move matching event creation before tracepoint registration X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=dbe402a88a0342a00fae8ffc4948131e7379352e;p=lttng-modules.git Refactoring: syscall: move matching event creation before tracepoint registration There is no point in doing the event notifier creation after tracepoint registration for syscall tracing. Move it prior to tracepoint registration, similarly to event recorder. Signed-off-by: Mathieu Desnoyers Change-Id: I1ddbbb765445509f8a1f571788528ff0fce3dace --- diff --git a/src/lttng-syscalls.c b/src/lttng-syscalls.c index de4dbace..b93fbbfd 100644 --- a/src/lttng-syscalls.c +++ b/src/lttng-syscalls.c @@ -796,6 +796,10 @@ int lttng_event_enabler_create_syscall_events_if_missing(struct lttng_event_enab if (ret) return ret; + ret = lttng_syscalls_create_matching_event_notifiers(syscall_event_enabler); + if (ret) + return ret; + if (!syscall_table->sys_enter_registered) { ret = lttng_wrapper_tracepoint_probe_register("sys_enter", (void *) syscall_entry_event_probe, syscall_table); @@ -814,10 +818,6 @@ int lttng_event_enabler_create_syscall_events_if_missing(struct lttng_event_enab syscall_table->sys_exit_registered = 1; } - ret = lttng_syscalls_create_matching_event_notifiers(syscall_event_enabler); - if (ret) - return ret; - return ret; }