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=ed6658d7f8a6389e2e4f74e7d2a876c26db16ee0;hb=69892bbba677a6695b216046d586e58bfa0f82c9;hpb=990570edd474b304d4c935d82be6201d872025e4 diff --git a/src/bin/lttng-sessiond/trace-ust.c b/src/bin/lttng-sessiond/trace-ust.c index ed6658d7f..0858f47d5 100644 --- a/src/bin/lttng-sessiond/trace-ust.c +++ b/src/bin/lttng-sessiond/trace-ust.c @@ -21,7 +21,6 @@ #include #include -#include #include #include @@ -290,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) { @@ -297,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;