Refactoring: syscall: move matching event creation before tracepoint registration
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 5 Nov 2021 14:56:30 +0000 (10:56 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 5 Nov 2021 14:56:30 +0000 (10:56 -0400)
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 <mathieu.desnoyers@efficios.com>
Change-Id: I1ddbbb765445509f8a1f571788528ff0fce3dace

src/lttng-syscalls.c

index de4dbacefc5c23e7331081696585e4a278b82a7c..b93fbbfdb8fd6cc5a8ff129a956b29f222dcd57e 100644 (file)
@@ -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;
 }
 
This page took 0.026909 seconds and 4 git commands to generate.