+ query = zmalloc(sizeof(*query));
+ if (!query) {
+ PERROR("Failed to allocate condition error query");
+ goto error;
+ }
+
+ query->parent.target_type = LTTNG_ERROR_QUERY_TARGET_TYPE_CONDITION;
+ query->trigger = trigger_copy;
+ trigger_copy = NULL;
+
+error:
+ lttng_trigger_put(trigger_copy);
+end:
+ return query ? &query->parent : NULL;
+}
+
+static
+struct lttng_action *get_trigger_action_from_path(
+ struct lttng_trigger *trigger,
+ const struct lttng_action_path *action_path)
+{
+ size_t index_count, i;
+ enum lttng_action_path_status path_status;
+ struct lttng_action *current_action = NULL;
+
+ path_status = lttng_action_path_get_index_count(
+ action_path, &index_count);
+ if (path_status != LTTNG_ACTION_PATH_STATUS_OK) {
+ goto end;
+ }
+
+ current_action = lttng_trigger_get_action(trigger);
+ for (i = 0; i < index_count; i++) {
+ uint64_t path_index;
+
+ path_status = lttng_action_path_get_index_at_index(
+ action_path, i, &path_index);
+ current_action = lttng_action_list_borrow_mutable_at_index(
+ current_action, path_index);
+ if (!current_action) {
+ /* Invalid action path. */
+ goto end;
+ }
+ }
+
+end:
+ return current_action;
+}
+
+static
+bool is_valid_action_path(const struct lttng_trigger *trigger,
+ const struct lttng_action_path *action_path)
+{