Refactoring: combine lttng_create_syscall_event_if_missing common code
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 2 Nov 2021 17:52:42 +0000 (13:52 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 2 Nov 2021 17:52:42 +0000 (13:52 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I392c8dd39a956e2b46ce4dac76112249bccabf7b

src/lttng-events.c

index 21f215492fde8dca231447ca8700d7f8e3bf495d..647c7827e45241d42dd466cf7c07ecd5b65bc897 100644 (file)
@@ -2238,20 +2238,11 @@ void lttng_create_tracepoint_event_notifier_if_missing(struct lttng_event_notifi
 }
 
 static
-void lttng_create_syscall_event_if_missing(struct lttng_event_recorder_enabler *event_enabler)
+void lttng_create_syscall_event_if_missing(struct lttng_event_enabler_common *event_enabler)
 {
        int ret;
 
-       ret = lttng_syscalls_register_event(&event_enabler->parent);
-       WARN_ON_ONCE(ret);
-}
-
-static
-void lttng_create_syscall_event_notifier_if_missing(struct lttng_event_notifier_enabler *event_notifier_enabler)
-{
-       int ret;
-
-       ret = lttng_syscalls_register_event(&event_notifier_enabler->parent);
+       ret = lttng_syscalls_register_event(event_enabler);
        WARN_ON_ONCE(ret);
 }
 
@@ -2269,7 +2260,7 @@ void lttng_create_event_if_missing(struct lttng_event_recorder_enabler *event_en
                break;
 
        case LTTNG_KERNEL_ABI_SYSCALL:
-               lttng_create_syscall_event_if_missing(event_enabler);
+               lttng_create_syscall_event_if_missing(&event_enabler->parent);
                break;
 
        default:
@@ -2355,7 +2346,7 @@ void lttng_create_event_notifier_if_missing(struct lttng_event_notifier_enabler
                break;
 
        case LTTNG_KERNEL_ABI_SYSCALL:
-               lttng_create_syscall_event_notifier_if_missing(event_notifier_enabler);
+               lttng_create_syscall_event_if_missing(&event_notifier_enabler->parent);
                break;
 
        default:
This page took 0.029233 seconds and 4 git commands to generate.