+static
+int trace_ust_context_type_event_to_ust(enum lttng_event_context_type type)
+{
+ int utype;
+
+ switch (type) {
+ 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;
+ case LTTNG_EVENT_CONTEXT_IP:
+ utype = LTTNG_UST_CONTEXT_IP;
+ break;
+ case LTTNG_EVENT_CONTEXT_PERF_THREAD_COUNTER:
+ utype = LTTNG_UST_CONTEXT_PERF_THREAD_COUNTER;
+ break;
+ default:
+ ERR("Invalid UST context");
+ utype = -1;
+ break;
+ }
+ return utype;
+}
+