Cleanup: syscall filter enable/disable event
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 1 Nov 2021 19:14:44 +0000 (15:14 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 1 Nov 2021 19:16:37 +0000 (15:16 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I36f683e209a51ef0ca9e3a490f52f2c270f9b297

include/lttng/events-internal.h
src/lttng-events.c
src/lttng-syscalls.c

index 416e0fea0839e08af70280387fd523dec1ca3c68..b9f0a4148ac288d1b230c5d077722901d8f188cf 100644 (file)
@@ -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;
 }
index f5c0fa95a5233e604e4312c2b6c773dc6a87960f..19262b4195e96a8f1cec968537229d3b54f5f70d 100644 (file)
@@ -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:
index 3133ec710556d53a344ee9dfe00f9d9d1b442126..62761b8286b620bd54564b234144820a03a1a1b2 100644 (file)
@@ -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,
This page took 0.029721 seconds and 4 git commands to generate.