+/*
+ * Allocate and initialize an UST context.
+ *
+ * Return pointer to structure or NULL.
+ */
+struct ltt_ust_context *trace_ust_create_context(
+ struct lttng_event_context *ctx)
+{
+ struct ltt_ust_context *uctx;
+
+ uctx = zmalloc(sizeof(struct ltt_ust_context));
+ if (uctx == NULL) {
+ PERROR("zmalloc ltt_ust_context");
+ goto error;
+ }
+
+ uctx->ctx.ctx = ctx->ctx;
+ lttng_ht_node_init_ulong(&uctx->node, (unsigned long) uctx->ctx.ctx);
+
+ return uctx;
+
+error:
+ return NULL;
+}
+