static
void _lttng_enabler_attach_exclusion(struct lttng_enabler *enabler,
- struct lttng_ust_excluder_node *excluder)
+ struct lttng_ust_excluder_node **excluder)
{
- excluder->enabler = enabler;
- cds_list_add_tail(&excluder->node, &enabler->excluder_head);
+ (*excluder)->enabler = enabler;
+ cds_list_add_tail(&(*excluder)->node, &enabler->excluder_head);
+ /* Take ownership of excluder */
+ *excluder = NULL;
}
int lttng_event_enabler_attach_exclusion(struct lttng_event_enabler *event_enabler,
- struct lttng_ust_excluder_node *excluder)
+ struct lttng_ust_excluder_node **excluder)
{
_lttng_enabler_attach_exclusion(
lttng_event_enabler_as_enabler(event_enabler), excluder);
int lttng_event_notifier_enabler_attach_exclusion(
struct lttng_event_notifier_enabler *event_notifier_enabler,
- struct lttng_ust_excluder_node *excluder)
+ struct lttng_ust_excluder_node **excluder)
{
_lttng_enabler_attach_exclusion(
lttng_event_notifier_enabler_as_enabler(event_notifier_enabler),
(struct lttng_ust_bytecode_node *) arg);
case LTTNG_UST_EXCLUSION:
return lttng_event_notifier_enabler_attach_exclusion(event_notifier_enabler,
- (struct lttng_ust_excluder_node *) arg);
+ (struct lttng_ust_excluder_node **) arg);
case LTTNG_UST_CAPTURE:
return lttng_event_notifier_enabler_attach_capture_bytecode(
event_notifier_enabler,
case LTTNG_UST_EXCLUSION:
{
return lttng_event_enabler_attach_exclusion(enabler,
- (struct lttng_ust_excluder_node *) arg);
+ (struct lttng_ust_excluder_node **) arg);
}
default:
return -EINVAL;
goto error;
}
}
- if (ops->cmd) {
+ if (ops->cmd)
ret = ops->cmd(lum->handle, lum->cmd,
- (unsigned long) node,
+ (unsigned long) &node,
&args, sock_info);
- if (ret) {
- free(node);
- }
- /* Don't free exclusion data if everything went fine. */
- } else {
+ else
ret = -ENOSYS;
- free(node);
- }
+ free(node);
break;
}
case LTTNG_UST_EVENT_NOTIFIER_GROUP_CREATE:
*/
LTTNG_HIDDEN
int lttng_event_enabler_attach_exclusion(struct lttng_event_enabler *enabler,
- struct lttng_ust_excluder_node *excluder);
+ struct lttng_ust_excluder_node **excluder);
/*
* Synchronize bytecodes for the enabler and the instance (event or
LTTNG_HIDDEN
int lttng_event_notifier_enabler_attach_exclusion(
struct lttng_event_notifier_enabler *event_notifier_enabler,
- struct lttng_ust_excluder_node *excluder);
+ struct lttng_ust_excluder_node **excluder);
LTTNG_HIDDEN
void lttng_free_event_notifier_filter_runtime(