- /* Lookup context before adding it */
- lttng_ht_lookup(uchan->ctx, (void *)((unsigned long)uctx->ctx.ctx), &iter);
- uctx_node = lttng_ht_iter_get_node_ulong(&iter);
- if (uctx_node != NULL) {
- ret = -EEXIST;
- goto error;
- }
-
- /* Add ltt UST context node to ltt UST channel */
- lttng_ht_add_unique_ulong(uchan->ctx, &uctx->node);
-
- DBG("Context UST %d added to channel %s", uctx->ctx.ctx, uchan->name);
-
- return 0;
-
-error:
- free(uctx);
- return ret;
-}
-
-/*
- * Add UST context to event.
- */
-static int add_uctx_to_event(struct ltt_ust_session *usess, int domain,
- struct ltt_ust_channel *uchan, struct ltt_ust_event *uevent,
- struct lttng_event_context *ctx)
-{
- int ret;
- struct ltt_ust_context *uctx;
- struct lttng_ht_iter iter;
- struct lttng_ht_node_ulong *uctx_node;
-