From: Francis Deslauriers Date: Tue, 17 Mar 2020 14:55:43 +0000 (-0400) Subject: Cleanup: Rename filter functions/fields to mention "filter" X-Git-Tag: v2.13.0-rc1~444 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=a56fd376c76b448c9f639b8ace821471a2fb7b40;p=lttng-ust.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: I81a986386908212bf7a6814413204b54da6950c8 --- diff --git a/include/lttng/ust-events.h b/include/lttng/ust-events.h index d89ddea6..7fa992ef 100644 --- a/include/lttng/ust-events.h +++ b/include/lttng/ust-events.h @@ -491,7 +491,7 @@ struct lttng_event { /* LTTng-UST 2.1 starts here */ /* list of struct lttng_bytecode_runtime, sorted by seqnum */ - struct cds_list_head bytecode_runtime_head; + struct cds_list_head filter_bytecode_runtime_head; int has_enablers_without_bytecode; /* Backward references: list of lttng_enabler_ref (ref to enablers) */ struct cds_list_head enablers_ref_head; diff --git a/include/lttng/ust-tracepoint-event.h b/include/lttng/ust-tracepoint-event.h index c9c75929..5e9245f1 100644 --- a/include/lttng/ust-tracepoint-event.h +++ b/include/lttng/ust-tracepoint-event.h @@ -871,14 +871,14 @@ void __event_probe__##_provider##___##_name(_TP_ARGS_DATA_PROTO(_args)) \ return; \ if (caa_unlikely(!TP_RCU_LINK_TEST())) \ return; \ - if (caa_unlikely(!cds_list_empty(&__event->bytecode_runtime_head))) { \ - struct lttng_bytecode_runtime *bc_runtime; \ + if (caa_unlikely(!cds_list_empty(&__event->filter_bytecode_runtime_head))) { \ + struct lttng_bytecode_runtime *__filter_bc_runtime; \ int __filter_record = __event->has_enablers_without_bytecode; \ \ __event_prepare_filter_stack__##_provider##___##_name(__stackvar.__filter_stack_data, \ _TP_ARGS_DATA_VAR(_args)); \ - tp_list_for_each_entry_rcu(bc_runtime, &__event->bytecode_runtime_head, node) { \ - if (caa_unlikely(bc_runtime->filter(bc_runtime, \ + tp_list_for_each_entry_rcu(__filter_bc_runtime, &__event->filter_bytecode_runtime_head, node) { \ + if (caa_unlikely(__filter_bc_runtime->filter(__filter_bc_runtime, \ __stackvar.__filter_stack_data) & LTTNG_FILTER_RECORD_FLAG)) { \ __filter_record = 1; \ break; \ diff --git a/liblttng-ust/lttng-events.c b/liblttng-ust/lttng-events.c index 98def9a5..49553676 100644 --- a/liblttng-ust/lttng-events.c +++ b/liblttng-ust/lttng-events.c @@ -745,7 +745,7 @@ int lttng_event_create(const struct lttng_event_desc *desc, /* Event will be enabled by enabler sync. */ event->enabled = 0; event->registered = 0; - CDS_INIT_LIST_HEAD(&event->bytecode_runtime_head); + CDS_INIT_LIST_HEAD(&event->filter_bytecode_runtime_head); CDS_INIT_LIST_HEAD(&event->enablers_ref_head); event->desc = desc; @@ -1221,7 +1221,7 @@ int lttng_event_enabler_ref_events(struct lttng_event_enabler *event_enabler) */ lttng_enabler_link_bytecode(event->desc, &session->ctx, - &event->bytecode_runtime_head, + &event->filter_bytecode_runtime_head, lttng_event_enabler_as_enabler(event_enabler)); /* TODO: merge event context. */ @@ -1402,17 +1402,17 @@ int lttng_event_enabler_disable(struct lttng_event_enabler *event_enabler) } static -void _lttng_enabler_attach_bytecode(struct lttng_enabler *enabler, +void _lttng_enabler_attach_filter_bytecode(struct lttng_enabler *enabler, struct lttng_ust_filter_bytecode_node *bytecode) { bytecode->enabler = enabler; cds_list_add_tail(&bytecode->node, &enabler->filter_bytecode_head); } -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_ust_filter_bytecode_node *bytecode) { - _lttng_enabler_attach_bytecode( + _lttng_enabler_attach_filter_bytecode( lttng_event_enabler_as_enabler(event_enabler), bytecode); lttng_session_lazy_sync_event_enablers(event_enabler->chan->session); @@ -1455,11 +1455,11 @@ 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_ust_filter_bytecode_node *bytecode) { - _lttng_enabler_attach_bytecode( + _lttng_enabler_attach_filter_bytecode( lttng_event_notifier_enabler_as_enabler(event_notifier_enabler), bytecode); @@ -1634,7 +1634,7 @@ void lttng_session_sync_event_enablers(struct lttng_session *session) /* Enable filters */ cds_list_for_each_entry(runtime, - &event->bytecode_runtime_head, node) { + &event->filter_bytecode_runtime_head, node) { lttng_filter_sync_state(runtime); } } diff --git a/liblttng-ust/lttng-filter.c b/liblttng-ust/lttng-filter.c index c25df62a..aa258e5c 100644 --- a/liblttng-ust/lttng-filter.c +++ b/liblttng-ust/lttng-filter.c @@ -582,7 +582,7 @@ void free_filter_runtime(struct cds_list_head *bytecode_runtime_head) void lttng_free_event_filter_runtime(struct lttng_event *event) { - free_filter_runtime(&event->bytecode_runtime_head); + free_filter_runtime(&event->filter_bytecode_runtime_head); } void lttng_free_event_notifier_filter_runtime( diff --git a/liblttng-ust/lttng-ust-abi.c b/liblttng-ust/lttng-ust-abi.c index d5877c3d..1361f5cc 100644 --- a/liblttng-ust/lttng-ust-abi.c +++ b/liblttng-ust/lttng-ust-abi.c @@ -716,7 +716,8 @@ long lttng_event_notifier_enabler_cmd(int objd, unsigned int cmd, unsigned long struct lttng_event_notifier_enabler *event_notifier_enabler = objd_private(objd); switch (cmd) { case LTTNG_UST_FILTER: - return lttng_event_notifier_enabler_attach_bytecode(event_notifier_enabler, + return lttng_event_notifier_enabler_attach_filter_bytecode( + event_notifier_enabler, (struct lttng_ust_filter_bytecode_node *) arg); case LTTNG_UST_EXCLUSION: return lttng_event_notifier_enabler_attach_exclusion(event_notifier_enabler, @@ -1146,7 +1147,7 @@ long lttng_event_enabler_cmd(int objd, unsigned int cmd, unsigned long arg, { int ret; - ret = lttng_event_enabler_attach_bytecode(enabler, + ret = lttng_event_enabler_attach_filter_bytecode(enabler, (struct lttng_ust_filter_bytecode_node *) arg); if (ret) return ret; diff --git a/liblttng-ust/ust-events-internal.h b/liblttng-ust/ust-events-internal.h index 074a7b69..eea9c666 100644 --- a/liblttng-ust/ust-events-internal.h +++ b/liblttng-ust/ust-events-internal.h @@ -122,7 +122,8 @@ int lttng_event_enabler_disable(struct lttng_event_enabler *enabler); * events related to this enabler. */ LTTNG_HIDDEN -int lttng_event_enabler_attach_bytecode(struct lttng_event_enabler *enabler, +int lttng_event_enabler_attach_filter_bytecode( + struct lttng_event_enabler *enabler, struct lttng_ust_filter_bytecode_node *bytecode); /* @@ -210,7 +211,7 @@ int lttng_event_notifier_enabler_disable( * all event notifiers related to this enabler. */ LTTNG_HIDDEN -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_ust_filter_bytecode_node *bytecode);