Implement a function that adds exclusions to the list in the enabler.
Call this function in the enabler command handler when the
LTTNG_UST_EXCLUSION command is received.
Signed-off-by: JP Ikaheimonen <jp_ikaheimonen@mentor.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
struct lttng_ust_filter_bytecode_node *bytecode);
int lttng_enabler_attach_context(struct lttng_enabler *enabler,
struct lttng_ust_context *ctx);
+int lttng_enabler_attach_exclusion(struct lttng_enabler *enabler,
+ struct lttng_ust_excluder_node *excluder);
int lttng_attach_context(struct lttng_ust_context *context_param,
struct lttng_ctx **ctx, struct lttng_session *session);
return 0;
}
+int lttng_enabler_attach_exclusion(struct lttng_enabler *enabler,
+ struct lttng_ust_excluder_node *excluder)
+{
+ excluder->enabler = enabler;
+ cds_list_add_tail(&excluder->node, &enabler->excluder_head);
+ lttng_session_lazy_sync_enablers(enabler->chan->session);
+ return 0;
+}
+
int lttng_attach_context(struct lttng_ust_context *context_param,
struct lttng_ctx **ctx, struct lttng_session *session)
{
* Disable recording for this enabler
* LTTNG_UST_FILTER
* Attach a filter to an enabler.
+ * LTTNG_UST_EXCLUSION
+ * Attach exclusions to an enabler.
*/
static
long lttng_enabler_cmd(int objd, unsigned int cmd, unsigned long arg,
return ret;
return 0;
}
+ case LTTNG_UST_EXCLUSION:
+ {
+ return lttng_enabler_attach_exclusion(enabler,
+ (struct lttng_ust_excluder_node *) arg);
+ }
default:
return -EINVAL;
}