From: Mathieu Desnoyers Date: Tue, 2 Nov 2021 17:52:42 +0000 (-0400) Subject: Refactoring: combine lttng_create_syscall_event_if_missing common code X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=053554ae9a8bb39e257446b2efa30905a06f6fb2;p=lttng-modules.git Refactoring: combine lttng_create_syscall_event_if_missing common code Signed-off-by: Mathieu Desnoyers Change-Id: I392c8dd39a956e2b46ce4dac76112249bccabf7b --- diff --git a/src/lttng-events.c b/src/lttng-events.c index 21f21549..647c7827 100644 --- a/src/lttng-events.c +++ b/src/lttng-events.c @@ -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: