#include <unistd.h>
#include <urcu/list.h>
+#include <common/error.h>
#include <common/sessiond-comm/sessiond-comm.h>
-#include <common/lttngerr.h>
#include "context.h"
#include "kernel.h"
}
break;
default:
- ret = LTTCOMM_NOT_IMPLEMENTED;
+ ret = LTTCOMM_UND;
goto error;
}
}
break;
default:
- ret = LTTCOMM_NOT_IMPLEMENTED;
+ ret = LTTCOMM_UND;
goto error;
}
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,
char *channel_name)
{
int ret = LTTCOMM_OK, have_event = 0;
- struct lttng_ht_iter iter, uiter;
+ struct lttng_ht_iter iter;
struct lttng_ht *chan_ht;
struct ltt_ust_channel *uchan = NULL;
struct ltt_ust_event *uevent = NULL;
case LTTNG_DOMAIN_UST:
chan_ht = usess->domain_global.channels;
break;
+#if 0
case LTTNG_DOMAIN_UST_EXEC_NAME:
case LTTNG_DOMAIN_UST_PID:
case LTTNG_DOMAIN_UST_PID_FOLLOW_CHILDREN:
+#endif
default:
- ret = LTTCOMM_NOT_IMPLEMENTED;
+ ret = LTTCOMM_UND;
goto error;
}
ERR("Context added to channel %s failed", uchan->name);
continue;
}
-
- /* For all events in channel */
- cds_lfht_for_each_entry(uchan->events->ht, &uiter.iter, uevent,
- node.node) {
- ret = add_uctx_to_event(usess, domain, uchan, uevent, ctx);
- if (ret < 0) {
- ERR("Context add to event %s in channel %s failed",
- uevent->attr.name, uchan->name);
- continue;
- }
- }
}
}