X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Ftrace-ust.c;h=0858f47d53b29ea598f94471b4271d029ba1a2bd;hp=80644ac8330b438da015b7f149ff10cee002bb5b;hb=69892bbba677a6695b216046d586e58bfa0f82c9;hpb=db7586006bc1a2b9057a2c108bf1e7d20fd6903f diff --git a/src/bin/lttng-sessiond/trace-ust.c b/src/bin/lttng-sessiond/trace-ust.c index 80644ac83..0858f47d5 100644 --- a/src/bin/lttng-sessiond/trace-ust.c +++ b/src/bin/lttng-sessiond/trace-ust.c @@ -289,6 +289,25 @@ struct ltt_ust_context *trace_ust_create_context( struct lttng_event_context *ctx) { struct ltt_ust_context *uctx; + enum lttng_ust_context_type utype; + + switch (ctx->ctx) { + case LTTNG_EVENT_CONTEXT_VTID: + utype = LTTNG_UST_CONTEXT_VTID; + break; + case LTTNG_EVENT_CONTEXT_VPID: + utype = LTTNG_UST_CONTEXT_VPID; + break; + case LTTNG_EVENT_CONTEXT_PTHREAD_ID: + utype = LTTNG_UST_CONTEXT_PTHREAD_ID; + break; + case LTTNG_EVENT_CONTEXT_PROCNAME: + utype = LTTNG_UST_CONTEXT_PROCNAME; + break; + default: + ERR("Invalid UST context"); + return NULL; + } uctx = zmalloc(sizeof(struct ltt_ust_context)); if (uctx == NULL) { @@ -296,7 +315,7 @@ struct ltt_ust_context *trace_ust_create_context( goto error; } - uctx->ctx.ctx = ctx->ctx; + uctx->ctx.ctx = utype; lttng_ht_node_init_ulong(&uctx->node, (unsigned long) uctx->ctx.ctx); return uctx;