From: Francis Deslauriers Date: Wed, 1 Apr 2020 21:12:59 +0000 (-0400) Subject: Cleanup: Rename filter functions/fields to mention "filter" X-Git-Tag: v2.13.0-rc1~106 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=183e8b3ade0b58852561b334b3455988c743ebc9;p=lttng-modules.git Cleanup: Rename filter functions/fields to mention "filter" This will be cleaner when we introduce the capture bytecode functions and fields. Signed-off-by: Francis Deslauriers Signed-off-by: Mathieu Desnoyers Change-Id: I04aca5bfd31f2526b24fe3a4b2e8f2b1c1b482f9 --- diff --git a/include/lttng/events.h b/include/lttng/events.h index 6125f08b..194e8900 100644 --- a/include/lttng/events.h +++ b/include/lttng/events.h @@ -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); diff --git a/include/lttng/tracepoint-event-impl.h b/include/lttng/tracepoint-event-impl.h index d6448f0b..1a51cb39 100644 --- a/include/lttng/tracepoint-event-impl.h +++ b/include/lttng/tracepoint-event-impl.h @@ -1242,13 +1242,13 @@ static void __event_probe__##_name(void *__data, _proto) \ __orig_dynamic_len_offset = this_cpu_ptr(<tng_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(<tng_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; \ diff --git a/src/lttng-abi.c b/src/lttng-abi.c index 67f5aa87..be8bfe1e 100644 --- a/src/lttng-abi.c +++ b/src/lttng-abi.c @@ -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: diff --git a/src/lttng-events.c b/src/lttng-events.c index dff93ce6..85a064fc 100644 --- a/src/lttng-events.c +++ b/src/lttng-events.c @@ -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); } } diff --git a/src/lttng-filter.c b/src/lttng-filter.c index b33ae929..05eecd86 100644 --- a/src/lttng-filter.c +++ b/src/lttng-filter.c @@ -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); }