Cleanup: Rename filter functions/fields to mention "filter"
authorFrancis Deslauriers <francis.deslauriers@efficios.com>
Wed, 1 Apr 2020 21:12:59 +0000 (17:12 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 25 Nov 2020 17:33:53 +0000 (12:33 -0500)
This will be cleaner when we introduce the capture bytecode functions
and fields.

Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I04aca5bfd31f2526b24fe3a4b2e8f2b1c1b482f9

include/lttng/events.h
include/lttng/tracepoint-event-impl.h
src/lttng-abi.c
src/lttng-events.c
src/lttng-filter.c

index 6125f08bc1d63a90c26cdfe446e7f6470abc7b04..194e89004cb3b451c17719990c3266e9deb9f139 100644 (file)
@@ -332,7 +332,7 @@ struct lttng_event {
        struct hlist_node hlist;        /* session ht of events */
        int registered;                 /* has reg'd tracepoint probe */
        /* list of struct lttng_bytecode_runtime, sorted by seqnum */
-       struct list_head bytecode_runtime_head;
+       struct list_head filter_bytecode_runtime_head;
        int has_enablers_without_bytecode;
 };
 
@@ -363,7 +363,7 @@ struct lttng_event_notifier {
        struct list_head enablers_ref_head;
        struct hlist_node hlist;        /* session ht of event_notifiers */
        /* list of struct lttng_bytecode_runtime, sorted by seqnum */
-       struct list_head bytecode_runtime_head;
+       struct list_head filter_bytecode_runtime_head;
        int has_enablers_without_bytecode;
 
        void (*send_notification)(struct lttng_event_notifier *event_notifier);
@@ -887,9 +887,9 @@ static inline int lttng_syscall_filter_disable_event_notifier(
 #endif
 
 void lttng_filter_sync_state(struct lttng_bytecode_runtime *runtime);
-int lttng_event_enabler_attach_bytecode(struct lttng_event_enabler *event_enabler,
+int lttng_event_enabler_attach_filter_bytecode(struct lttng_event_enabler *event_enabler,
                struct lttng_kernel_filter_bytecode __user *bytecode);
-int lttng_event_notifier_enabler_attach_bytecode(
+int lttng_event_notifier_enabler_attach_filter_bytecode(
                struct lttng_event_notifier_enabler *event_notifier_enabler,
                struct lttng_kernel_filter_bytecode __user *bytecode);
 
index d6448f0bdb37e742cb9c2155193070f83e47a471..1a51cb39634d8d962660333c18f85f3d4f85b426 100644 (file)
@@ -1242,13 +1242,13 @@ static void __event_probe__##_name(void *__data, _proto)                      \
        __orig_dynamic_len_offset = this_cpu_ptr(&lttng_dynamic_len_stack)->offset; \
        __dynamic_len_idx = __orig_dynamic_len_offset;                        \
        _code_pre                                                             \
-       if (unlikely(!list_empty(&__event->bytecode_runtime_head))) {         \
+       if (unlikely(!list_empty(&__event->filter_bytecode_runtime_head))) {          \
                struct lttng_bytecode_runtime *bc_runtime;                    \
                int __filter_record = __event->has_enablers_without_bytecode; \
                                                                              \
                __event_prepare_filter_stack__##_name(__stackvar.__filter_stack_data, \
                                tp_locvar, _args);                                    \
-               lttng_list_for_each_entry_rcu(bc_runtime, &__event->bytecode_runtime_head, node) { \
+               lttng_list_for_each_entry_rcu(bc_runtime, &__event->filter_bytecode_runtime_head, node) { \
                        if (unlikely(bc_runtime->filter(bc_runtime, &__lttng_probe_ctx,       \
                                        __stackvar.__filter_stack_data) & LTTNG_FILTER_RECORD_FLAG)) { \
                                __filter_record = 1;                          \
@@ -1338,13 +1338,13 @@ static void __event_probe__##_name(void *__data)                              \
        __orig_dynamic_len_offset = this_cpu_ptr(&lttng_dynamic_len_stack)->offset; \
        __dynamic_len_idx = __orig_dynamic_len_offset;                        \
        _code_pre                                                             \
-       if (unlikely(!list_empty(&__event->bytecode_runtime_head))) {         \
+       if (unlikely(!list_empty(&__event->filter_bytecode_runtime_head))) {          \
                struct lttng_bytecode_runtime *bc_runtime;                    \
                int __filter_record = __event->has_enablers_without_bytecode; \
                                                                              \
                __event_prepare_filter_stack__##_name(__stackvar.__filter_stack_data, \
                                tp_locvar);                                   \
-               lttng_list_for_each_entry_rcu(bc_runtime, &__event->bytecode_runtime_head, node) { \
+               lttng_list_for_each_entry_rcu(bc_runtime, &__event->filter_bytecode_runtime_head, node) { \
                        if (unlikely(bc_runtime->filter(bc_runtime, &__lttng_probe_ctx, \
                                        __stackvar.__filter_stack_data) & LTTNG_FILTER_RECORD_FLAG)) { \
                                __filter_record = 1;                          \
@@ -1434,13 +1434,13 @@ static void __event_notifier_probe__##_name(void *__data, _proto)             \
        if (unlikely(!READ_ONCE(__event_notifier->enabled)))                  \
                return;                                                       \
        _code_pre                                                             \
-       if (unlikely(!list_empty(&__event_notifier->bytecode_runtime_head))) {          \
+       if (unlikely(!list_empty(&__event_notifier->filter_bytecode_runtime_head))) {   \
                struct lttng_bytecode_runtime *bc_runtime;                              \
                int __filter_record = __event_notifier->has_enablers_without_bytecode;  \
                                                                                        \
                __event_prepare_filter_stack__##_name(__stackvar.__filter_stack_data,   \
                                tp_locvar, _args);                                      \
-               lttng_list_for_each_entry_rcu(bc_runtime, &__event_notifier->bytecode_runtime_head, node) { \
+               lttng_list_for_each_entry_rcu(bc_runtime, &__event_notifier->filter_bytecode_runtime_head, node) { \
                        if (unlikely(bc_runtime->filter(bc_runtime, &__lttng_probe_ctx, \
                                        __stackvar.__filter_stack_data) & LTTNG_FILTER_RECORD_FLAG)) \
                                __filter_record = 1;                          \
@@ -1477,13 +1477,13 @@ static void __event_notifier_probe__##_name(void *__data)                     \
        if (unlikely(!READ_ONCE(__event_notifier->enabled)))                  \
                return;                                                       \
        _code_pre                                                             \
-       if (unlikely(!list_empty(&__event_notifier->bytecode_runtime_head))) {                \
+       if (unlikely(!list_empty(&__event_notifier->filter_bytecode_runtime_head))) {         \
                struct lttng_bytecode_runtime *bc_runtime;                                    \
                int __filter_record = __event_notifier->has_enablers_without_bytecode;        \
                                                                                              \
                __event_prepare_filter_stack__##_name(__stackvar.__filter_stack_data,         \
                                tp_locvar);                                                   \
-               lttng_list_for_each_entry_rcu(bc_runtime, &__event_notifier->bytecode_runtime_head, node) { \
+               lttng_list_for_each_entry_rcu(bc_runtime, &__event_notifier->filter_bytecode_runtime_head, node) { \
                        if (unlikely(bc_runtime->filter(bc_runtime, &__lttng_probe_ctx,       \
                                        __stackvar.__filter_stack_data) & LTTNG_FILTER_RECORD_FLAG)) \
                                __filter_record = 1;                          \
index 67f5aa87e010b9dafe10cd42d2f27356bbccae39..be8bfe1e5027e23ec42acd8cccba99813b517a32 100644 (file)
@@ -1748,7 +1748,8 @@ long lttng_event_notifier_ioctl(struct file *file, unsigned int cmd, unsigned lo
                        return -EINVAL;
                case LTTNG_TYPE_ENABLER:
                        event_notifier_enabler = file->private_data;
-                       return lttng_event_notifier_enabler_attach_bytecode(event_notifier_enabler,
+                       return lttng_event_notifier_enabler_attach_filter_bytecode(
+                                       event_notifier_enabler,
                                (struct lttng_kernel_filter_bytecode __user *) arg);
                default:
                        WARN_ON_ONCE(1);
@@ -2301,7 +2302,8 @@ long lttng_event_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
                case LTTNG_TYPE_ENABLER:
                {
                        event_enabler = file->private_data;
-                       return lttng_event_enabler_attach_bytecode(event_enabler,
+                       return lttng_event_enabler_attach_filter_bytecode(
+                               event_enabler,
                                (struct lttng_kernel_filter_bytecode __user *) arg);
                }
                default:
index dff93ce6d93c3fabc838c4a33364a185e8a1c562..85a064fc686cc1d13cd4bf3a9775a36a9820b5e4 100644 (file)
@@ -819,7 +819,7 @@ struct lttng_event *_lttng_event_create(struct lttng_channel *chan,
        event->id = chan->free_event_id++;
        event->instrumentation = itype;
        event->evtype = LTTNG_TYPE_EVENT;
-       INIT_LIST_HEAD(&event->bytecode_runtime_head);
+       INIT_LIST_HEAD(&event->filter_bytecode_runtime_head);
        INIT_LIST_HEAD(&event->enablers_ref_head);
 
        switch (itype) {
@@ -1051,7 +1051,7 @@ struct lttng_event_notifier *_lttng_event_notifier_create(
        event_notifier->instrumentation = itype;
        event_notifier->evtype = LTTNG_TYPE_EVENT;
        event_notifier->send_notification = lttng_event_notifier_notification_send;
-       INIT_LIST_HEAD(&event_notifier->bytecode_runtime_head);
+       INIT_LIST_HEAD(&event_notifier->filter_bytecode_runtime_head);
        INIT_LIST_HEAD(&event_notifier->enablers_ref_head);
 
        switch (itype) {
@@ -2030,7 +2030,7 @@ int lttng_event_enabler_ref_events(struct lttng_event_enabler *event_enabler)
                 */
                lttng_enabler_link_bytecode(event->desc,
                        lttng_static_ctx,
-                       &event->bytecode_runtime_head,
+                       &event->filter_bytecode_runtime_head,
                        lttng_event_enabler_as_enabler(event_enabler));
 
                /* TODO: merge event context. */
@@ -2117,7 +2117,7 @@ int lttng_event_notifier_enabler_ref_event_notifiers(
                 * Link filter bytecodes if not linked yet.
                 */
                lttng_enabler_link_bytecode(event_notifier->desc,
-                       lttng_static_ctx, &event_notifier->bytecode_runtime_head,
+                       lttng_static_ctx, &event_notifier->filter_bytecode_runtime_head,
                        lttng_event_notifier_enabler_as_enabler(event_notifier_enabler));
        }
        return 0;
@@ -2214,7 +2214,7 @@ int lttng_event_enabler_disable(struct lttng_event_enabler *event_enabler)
 }
 
 static
-int lttng_enabler_attach_bytecode(struct lttng_enabler *enabler,
+int lttng_enabler_attach_filter_bytecode(struct lttng_enabler *enabler,
                struct lttng_kernel_filter_bytecode __user *bytecode)
 {
        struct lttng_filter_bytecode_node *bytecode_node;
@@ -2245,11 +2245,11 @@ error_free:
        return ret;
 }
 
-int lttng_event_enabler_attach_bytecode(struct lttng_event_enabler *event_enabler,
+int lttng_event_enabler_attach_filter_bytecode(struct lttng_event_enabler *event_enabler,
                struct lttng_kernel_filter_bytecode __user *bytecode)
 {
        int ret;
-       ret = lttng_enabler_attach_bytecode(
+       ret = lttng_enabler_attach_filter_bytecode(
                lttng_event_enabler_as_enabler(event_enabler), bytecode);
        if (ret)
                goto error;
@@ -2354,13 +2354,13 @@ int lttng_event_notifier_enabler_disable(
        return 0;
 }
 
-int lttng_event_notifier_enabler_attach_bytecode(
+int lttng_event_notifier_enabler_attach_filter_bytecode(
                struct lttng_event_notifier_enabler *event_notifier_enabler,
                struct lttng_kernel_filter_bytecode __user *bytecode)
 {
        int ret;
 
-       ret = lttng_enabler_attach_bytecode(
+       ret = lttng_enabler_attach_filter_bytecode(
                lttng_event_notifier_enabler_as_enabler(event_notifier_enabler),
                bytecode);
        if (ret)
@@ -2478,7 +2478,7 @@ void lttng_session_sync_event_enablers(struct lttng_session *session)
 
                /* Enable filters */
                list_for_each_entry(runtime,
-                               &event->bytecode_runtime_head, node)
+                               &event->filter_bytecode_runtime_head, node)
                        lttng_filter_sync_state(runtime);
        }
 }
@@ -2561,8 +2561,8 @@ void lttng_event_notifier_group_sync_enablers(struct lttng_event_notifier_group
 
                /* Enable filters */
                list_for_each_entry(runtime,
-                               &event_notifier->bytecode_runtime_head, node)
-                       lttng_filter_sync_state(runtime);
+                               &event_notifier->filter_bytecode_runtime_head, node)
+                               lttng_filter_sync_state(runtime);
        }
 }
 
index b33ae9296a6d4142ecc06381fa50af33c67b38b6..05eecd868b67c116010723affa28812bd559d72f 100644 (file)
@@ -557,7 +557,7 @@ void lttng_free_event_filter_runtime(struct lttng_event *event)
        struct bytecode_runtime *runtime, *tmp;
 
        list_for_each_entry_safe(runtime, tmp,
-                       &event->bytecode_runtime_head, p.node) {
+                       &event->filter_bytecode_runtime_head, p.node) {
                kfree(runtime->data);
                kfree(runtime);
        }
This page took 0.032003 seconds and 4 git commands to generate.