enum lttng_event_context_type {
LTTNG_EVENT_CONTEXT_PID = 0,
LTTNG_EVENT_CONTEXT_PERF_COUNTER = 1,
- LTTNG_EVENT_CONTEXT_COMM = 2,
+ LTTNG_EVENT_CONTEXT_PROCNAME = 2,
LTTNG_EVENT_CONTEXT_PRIO = 3,
LTTNG_EVENT_CONTEXT_NICE = 4,
LTTNG_EVENT_CONTEXT_VPID = 5,
LTTNG_EVENT_CONTEXT_VTID = 7,
LTTNG_EVENT_CONTEXT_PPID = 8,
LTTNG_EVENT_CONTEXT_VPPID = 9,
+ LTTNG_EVENT_CONTEXT_PTHREAD_ID = 10,
};
enum lttng_calibrate_type {
struct lttng_kernel_context kctx;
/* Setup kernel context structure */
- kctx.ctx = ctx->ctx;
+ switch (ctx->ctx) {
+ case LTTNG_EVENT_CONTEXT_PID:
+ kctx.ctx = LTTNG_KERNEL_CONTEXT_PID;
+ break;
+ case LTTNG_EVENT_CONTEXT_PERF_COUNTER:
+ kctx.ctx = LTTNG_KERNEL_CONTEXT_PERF_COUNTER;
+ break;
+ case LTTNG_EVENT_CONTEXT_PROCNAME:
+ kctx.ctx = LTTNG_KERNEL_CONTEXT_PROCNAME;
+ break;
+ case LTTNG_EVENT_CONTEXT_PRIO:
+ kctx.ctx = LTTNG_KERNEL_CONTEXT_PRIO;
+ break;
+ case LTTNG_EVENT_CONTEXT_NICE:
+ kctx.ctx = LTTNG_KERNEL_CONTEXT_NICE;
+ break;
+ case LTTNG_EVENT_CONTEXT_VPID:
+ kctx.ctx = LTTNG_KERNEL_CONTEXT_VPID;
+ break;
+ case LTTNG_EVENT_CONTEXT_TID:
+ kctx.ctx = LTTNG_KERNEL_CONTEXT_TID;
+ break;
+ case LTTNG_EVENT_CONTEXT_VTID:
+ kctx.ctx = LTTNG_KERNEL_CONTEXT_VTID;
+ break;
+ case LTTNG_EVENT_CONTEXT_PPID:
+ kctx.ctx = LTTNG_KERNEL_CONTEXT_PPID;
+ break;
+ case LTTNG_EVENT_CONTEXT_VPPID:
+ kctx.ctx = LTTNG_KERNEL_CONTEXT_VPPID;
+ break;
+ default:
+ return LTTCOMM_KERN_CONTEXT_FAIL;
+ }
+
kctx.u.perf_counter.type = ctx->u.perf_counter.type;
kctx.u.perf_counter.config = ctx->u.perf_counter.config;
strncpy(kctx.u.perf_counter.name, ctx->u.perf_counter.name,
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) {
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;
CONTEXT_VTID = 7,
CONTEXT_PPID = 8,
CONTEXT_VPPID = 9,
+ CONTEXT_PTHREAD_ID = 10,
};
/*
{ "nice", CONTEXT_NICE },
{ "vpid", CONTEXT_VPID },
{ "tid", CONTEXT_TID },
+ { "pthread_id", CONTEXT_PTHREAD_ID },
{ "vtid", CONTEXT_VTID },
{ "ppid", CONTEXT_PPID },
{ "vppid", CONTEXT_VPPID },
enum lttng_kernel_context_type {
LTTNG_KERNEL_CONTEXT_PID = 0,
LTTNG_KERNEL_CONTEXT_PERF_COUNTER = 1,
- LTTNG_KERNEL_CONTEXT_COMM = 2,
+ LTTNG_KERNEL_CONTEXT_PROCNAME = 2,
LTTNG_KERNEL_CONTEXT_PRIO = 3,
LTTNG_KERNEL_CONTEXT_NICE = 4,
LTTNG_KERNEL_CONTEXT_VPID = 5,