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=a947dada5b8972b574d304e5504009718a7dcdaa;hb=69892bbba677a6695b216046d586e58bfa0f82c9;hpb=10a8a2237343699e3923d87e24dbf2d7fe225377 diff --git a/src/bin/lttng-sessiond/trace-ust.c b/src/bin/lttng-sessiond/trace-ust.c index a947dada5..0858f47d5 100644 --- a/src/bin/lttng-sessiond/trace-ust.c +++ b/src/bin/lttng-sessiond/trace-ust.c @@ -21,8 +21,8 @@ #include #include -#include -#include +#include +#include #include "trace-ust.h" @@ -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;