From: JP Ikaheimonen Date: Thu, 7 Nov 2013 10:22:33 +0000 (+0200) Subject: Store exclusions to enablers X-Git-Tag: v2.4.0-rc1~13 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=0bfb5cbd86f8dfe42c2f00f524e63de93133b2c9;p=lttng-ust.git Store exclusions to enablers 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 Signed-off-by: Mathieu Desnoyers --- diff --git a/include/lttng/ust-events.h b/include/lttng/ust-events.h index db8b9dc1..5d435708 100644 --- a/include/lttng/ust-events.h +++ b/include/lttng/ust-events.h @@ -549,6 +549,8 @@ int lttng_enabler_attach_bytecode(struct lttng_enabler *enabler, 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); diff --git a/liblttng-ust/lttng-events.c b/liblttng-ust/lttng-events.c index ad374f3b..915cffb7 100644 --- a/liblttng-ust/lttng-events.c +++ b/liblttng-ust/lttng-events.c @@ -721,6 +721,15 @@ int lttng_enabler_attach_bytecode(struct lttng_enabler *enabler, 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) { diff --git a/liblttng-ust/lttng-ust-abi.c b/liblttng-ust/lttng-ust-abi.c index a852aaef..61245a88 100644 --- a/liblttng-ust/lttng-ust-abi.c +++ b/liblttng-ust/lttng-ust-abi.c @@ -933,6 +933,8 @@ static const struct lttng_ust_objd_ops lttng_channel_ops = { * 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, @@ -958,6 +960,11 @@ 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; }