From: Mathieu Desnoyers Date: Mon, 1 Nov 2021 19:14:44 +0000 (-0400) Subject: Cleanup: syscall filter enable/disable event X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=f2db8be348380b48e3795d14e49cc585b3c357fd;p=lttng-modules.git Cleanup: syscall filter enable/disable event Signed-off-by: Mathieu Desnoyers Change-Id: I36f683e209a51ef0ca9e3a490f52f2c270f9b297 --- diff --git a/include/lttng/events-internal.h b/include/lttng/events-internal.h index 416e0fea..b9f0a414 100644 --- a/include/lttng/events-internal.h +++ b/include/lttng/events-internal.h @@ -812,12 +812,8 @@ void lttng_enabler_link_bytecode(const struct lttng_kernel_event_desc *event_des int lttng_syscalls_register_event(struct lttng_event_recorder_enabler *event_enabler); int lttng_syscalls_unregister_channel(struct lttng_kernel_channel_buffer *chan); int lttng_syscalls_destroy_event(struct lttng_kernel_channel_buffer *chan); -int lttng_syscall_filter_enable_event( - struct lttng_kernel_channel_buffer *chan, - struct lttng_kernel_event_recorder *event); -int lttng_syscall_filter_disable_event( - struct lttng_kernel_channel_buffer *chan, - struct lttng_kernel_event_recorder *event); +int lttng_syscall_filter_enable_event_recorder(struct lttng_kernel_event_recorder *event_recorder); +int lttng_syscall_filter_disable_event_recorder(struct lttng_kernel_event_recorder *event_recorder); long lttng_channel_syscall_mask(struct lttng_kernel_channel_buffer *channel, struct lttng_kernel_abi_syscall_mask __user *usyscall_mask); @@ -846,14 +842,12 @@ static inline int lttng_syscalls_destroy(struct lttng_kernel_channel_buffer *cha return 0; } -static inline int lttng_syscall_filter_enable_event(struct lttng_kernel_channel_buffer *chan, - struct lttng_kernel_event_recorder *event); +static inline int lttng_syscall_filter_enable_event_recorder(struct lttng_kernel_event_recorder *event_recorder) { return -ENOSYS; } -static inline int lttng_syscall_filter_disable_event(struct lttng_kernel_channel_buffer *chan, - struct lttng_kernel_event_recorder *event); +static inline int lttng_syscall_filter_disable_event_recorder(struct lttng_kernel_event_recorder *event_recorder) { return -ENOSYS; } @@ -876,16 +870,12 @@ static inline int lttng_syscalls_unregister_event_notifier_group( return 0; } -static inline int lttng_syscall_filter_enable_event_notifier( - struct lttng_event_notifier_group *group, - const char *name) +static inline int lttng_syscall_filter_enable_event_notifier(struct lttng_kernel_event_notifier *event_notifier) { return -ENOSYS; } -static inline int lttng_syscall_filter_disable_event_notifier( - struct lttng_event_notifier_group *group, - const char *name) +static inline int lttng_syscall_filter_disable_event_notifier(struct lttng_kernel_event_notifier *event_notifier) { return -ENOSYS; } diff --git a/src/lttng-events.c b/src/lttng-events.c index f5c0fa95..19262b41 100644 --- a/src/lttng-events.c +++ b/src/lttng-events.c @@ -1442,7 +1442,7 @@ void register_event(struct lttng_kernel_event_recorder *event_recorder) break; case LTTNG_KERNEL_ABI_SYSCALL: - ret = lttng_syscall_filter_enable_event(event_recorder->chan, event_recorder); + ret = lttng_syscall_filter_enable_event_recorder(event_recorder); break; case LTTNG_KERNEL_ABI_KPROBE: @@ -1495,7 +1495,7 @@ int _lttng_event_unregister(struct lttng_kernel_event_recorder *event_recorder) break; case LTTNG_KERNEL_ABI_SYSCALL: - ret = lttng_syscall_filter_disable_event(event_recorder->chan, event_recorder); + ret = lttng_syscall_filter_disable_event_recorder(event_recorder); break; case LTTNG_KERNEL_ABI_NOOP: diff --git a/src/lttng-syscalls.c b/src/lttng-syscalls.c index 3133ec71..62761b82 100644 --- a/src/lttng-syscalls.c +++ b/src/lttng-syscalls.c @@ -1329,8 +1329,7 @@ int lttng_syscall_filter_enable( return 0; } -int lttng_syscall_filter_enable_event_notifier( - struct lttng_kernel_event_notifier *event_notifier) +int lttng_syscall_filter_enable_event_notifier(struct lttng_kernel_event_notifier *event_notifier) { struct lttng_event_notifier_group *group = event_notifier->priv->group; struct lttng_kernel_syscall_table *syscall_table = &group->syscall_table; @@ -1386,10 +1385,9 @@ end: return ret ; } -int lttng_syscall_filter_enable_event( - struct lttng_kernel_channel_buffer *channel, - struct lttng_kernel_event_recorder *event_recorder) +int lttng_syscall_filter_enable_event_recorder(struct lttng_kernel_event_recorder *event_recorder) { + struct lttng_kernel_channel_buffer *channel = event_recorder->chan; struct lttng_kernel_syscall_table *syscall_table = &channel->priv->parent.syscall_table; WARN_ON_ONCE(event_recorder->priv->parent.instrumentation != LTTNG_KERNEL_ABI_SYSCALL); @@ -1401,8 +1399,7 @@ int lttng_syscall_filter_enable_event( } static -int lttng_syscall_filter_disable( - struct lttng_syscall_filter *filter, +int lttng_syscall_filter_disable(struct lttng_syscall_filter *filter, const char *desc_name, enum lttng_syscall_abi abi, enum lttng_syscall_entryexit entryexit) { @@ -1460,8 +1457,7 @@ int lttng_syscall_filter_disable( return 0; } -int lttng_syscall_filter_disable_event_notifier( - struct lttng_kernel_event_notifier *event_notifier) +int lttng_syscall_filter_disable_event_notifier(struct lttng_kernel_event_notifier *event_notifier) { struct lttng_event_notifier_group *group = event_notifier->priv->group; struct lttng_kernel_syscall_table *syscall_table = &group->syscall_table; @@ -1479,10 +1475,9 @@ int lttng_syscall_filter_disable_event_notifier( return 0; } -int lttng_syscall_filter_disable_event( - struct lttng_kernel_channel_buffer *channel, - struct lttng_kernel_event_recorder *event_recorder) +int lttng_syscall_filter_disable_event_recorder(struct lttng_kernel_event_recorder *event_recorder) { + struct lttng_kernel_channel_buffer *channel = event_recorder->chan; struct lttng_kernel_syscall_table *syscall_table = &channel->priv->parent.syscall_table; return lttng_syscall_filter_disable(syscall_table->sc_filter,