From f83be61d63aaf5ea70b850737da436fe4ae80e51 Mon Sep 17 00:00:00 2001 From: Jonathan Rajotte Date: Wed, 8 Apr 2020 21:40:41 -0400 Subject: [PATCH] sessiond: ust-app: set capture bytecode on event notifier on creation MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jonathan Rajotte Signed-off-by: Jérémie Galarneau Change-Id: I82d2dd27da92c4dc1587b22628f8e1a8097e06c2 Depends-on: lttng-ust: I8423c510bf6af2f9bf85256e8d6f931d36f7054b --- src/bin/lttng-sessiond/ust-app.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/bin/lttng-sessiond/ust-app.c b/src/bin/lttng-sessiond/ust-app.c index 01fa7fc93..cc027be99 100644 --- a/src/bin/lttng-sessiond/ust-app.c +++ b/src/bin/lttng-sessiond/ust-app.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include "buffer-registry.h" @@ -2077,6 +2078,8 @@ static int create_ust_event_notifier(struct ust_app *app, const struct lttng_condition *condition = NULL; struct lttng_ust_event_notifier event_notifier; const struct lttng_event_rule *event_rule = NULL; + unsigned int capture_bytecode_count = 0, i; + enum lttng_condition_status cond_status; health_code_update(); assert(app->event_notifier_group.object); @@ -2146,6 +2149,23 @@ static int create_ust_event_notifier(struct ust_app *app, } } + /* Set the capture bytecodes. */ + cond_status = lttng_condition_event_rule_get_capture_descriptor_count( + condition, &capture_bytecode_count); + assert(cond_status == LTTNG_CONDITION_STATUS_OK); + + for (i = 0; i < capture_bytecode_count; i++) { + const struct lttng_bytecode *capture_bytecode = + lttng_condition_event_rule_get_capture_bytecode_at_index( + condition, i); + + ret = set_ust_capture(app, capture_bytecode, + ua_event_notifier_rule->obj); + if (ret < 0) { + goto error; + } + } + /* * We now need to explicitly enable the event, since it * is disabled at creation. -- 2.34.1