From 0bfb5cbd86f8dfe42c2f00f524e63de93133b2c9 Mon Sep 17 00:00:00 2001 From: JP Ikaheimonen Date: Thu, 7 Nov 2013 12:22:33 +0200 Subject: [PATCH] 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 --- include/lttng/ust-events.h | 2 ++ liblttng-ust/lttng-events.c | 9 +++++++++ liblttng-ust/lttng-ust-abi.c | 7 +++++++ 3 files changed, 18 insertions(+) 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; } -- 2.34.1