__attribute__((visibility("hidden")));
/*
- * Attach filter bytecode program to `struct lttng_event_enabler` and all
+ * Attach filter bytecode program to `struct lttng_event_enabler_common` and all
* events related to this enabler.
*/
int lttng_event_enabler_attach_filter_bytecode(
- struct lttng_event_enabler_session_common *enabler,
+ struct lttng_event_enabler_common *enabler,
struct lttng_ust_bytecode_node **bytecode)
__attribute__((visibility("hidden")));
struct lttng_ust_abi_event_notifier *event_notifier_param)
__attribute__((visibility("hidden")));
-/*
- * Attach filter bytecode program to `struct lttng_event_notifier_enabler` and
- * all event notifiers related to this enabler.
- */
-int lttng_event_notifier_enabler_attach_filter_bytecode(
- struct lttng_event_notifier_enabler *event_notifier_enabler,
- struct lttng_ust_bytecode_node **bytecode)
- __attribute__((visibility("hidden")));
-
/*
* Attach capture bytecode program to `struct lttng_event_notifier_enabler` and
* all event_notifiers related to this enabler.
return 0;
}
-static
-void _lttng_enabler_attach_filter_bytecode(struct lttng_event_enabler_common *enabler,
+int lttng_event_enabler_attach_filter_bytecode(struct lttng_event_enabler_common *event_enabler,
struct lttng_ust_bytecode_node **bytecode)
{
- (*bytecode)->enabler = enabler;
- cds_list_add_tail(&(*bytecode)->node, &enabler->filter_bytecode_head);
+ (*bytecode)->enabler = event_enabler;
+ cds_list_add_tail(&(*bytecode)->node, &event_enabler->filter_bytecode_head);
/* Take ownership of bytecode */
*bytecode = NULL;
-}
-
-int lttng_event_enabler_attach_filter_bytecode(struct lttng_event_enabler_session_common *event_enabler,
- struct lttng_ust_bytecode_node **bytecode)
-{
- _lttng_enabler_attach_filter_bytecode(&event_enabler->parent, bytecode);
-
- lttng_session_lazy_sync_event_enablers(event_enabler->chan->session);
+ lttng_event_enabler_sync(event_enabler);
return 0;
}
return 0;
}
-int lttng_event_notifier_enabler_attach_filter_bytecode(
- struct lttng_event_notifier_enabler *event_notifier_enabler,
- struct lttng_ust_bytecode_node **bytecode)
-{
- _lttng_enabler_attach_filter_bytecode(
- lttng_event_notifier_enabler_as_enabler(event_notifier_enabler),
- bytecode);
-
- lttng_event_notifier_group_sync_enablers(event_notifier_enabler->group);
- return 0;
-}
-
int lttng_event_notifier_enabler_attach_capture_bytecode(
struct lttng_event_notifier_enabler *event_notifier_enabler,
struct lttng_ust_bytecode_node **bytecode)
struct lttng_event_notifier_enabler *event_notifier_enabler = objd_private(objd);
switch (cmd) {
case LTTNG_UST_ABI_FILTER:
- return lttng_event_notifier_enabler_attach_filter_bytecode(
- event_notifier_enabler,
+ return lttng_event_enabler_attach_filter_bytecode(
+ &event_notifier_enabler->parent,
(struct lttng_ust_bytecode_node **) arg);
case LTTNG_UST_ABI_EXCLUSION:
return lttng_event_notifier_enabler_attach_exclusion(event_notifier_enabler,
{
int ret;
- ret = lttng_event_enabler_attach_filter_bytecode(enabler,
+ ret = lttng_event_enabler_attach_filter_bytecode(&enabler->parent,
(struct lttng_ust_bytecode_node **) arg);
if (ret)
return ret;