X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fcontext.c;h=3861d22c1e3b7cf28275badf86fb388fddfd2bd0;hb=929f71ec24b58045319473f050a7f235f726ec78;hp=3c7c34df48d6c23b62c43b14e9908d7fb0f763e3;hpb=7682f30487cfe11af077c668193bb26f587a6081;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/context.c b/src/bin/lttng-sessiond/context.c index 3c7c34df4..3861d22c1 100644 --- a/src/bin/lttng-sessiond/context.c +++ b/src/bin/lttng-sessiond/context.c @@ -169,18 +169,19 @@ static int add_uctx_to_channel(struct ltt_ust_session *usess, goto error; } - ret = ust_app_add_ctx_channel_glb(usess, uchan, uctx); - if (ret < 0) { - goto error; - } - - rcu_read_lock(); - /* Add ltt UST context node to ltt UST channel */ lttng_ht_add_ulong(uchan->ctx, &uctx->node); - rcu_read_unlock(); cds_list_add_tail(&uctx->list, &uchan->ctx_list); + if (!usess->active) { + goto end; + } + + ret = ust_app_add_ctx_channel_glb(usess, uchan, uctx); + if (ret < 0) { + goto error; + } +end: DBG("Context UST %d added to channel %s", uctx->ctx.ctx, uchan->name); return 0; @@ -259,6 +260,12 @@ int context_kernel_add(struct ltt_kernel_session *ksession, case LTTNG_EVENT_CONTEXT_MIGRATABLE: kctx->ctx.ctx = LTTNG_KERNEL_CONTEXT_MIGRATABLE; break; + case LTTNG_EVENT_CONTEXT_CALLSTACK_KERNEL: + kctx->ctx.ctx = LTTNG_KERNEL_CONTEXT_CALLSTACK_KERNEL; + break; + case LTTNG_EVENT_CONTEXT_CALLSTACK_USER: + kctx->ctx.ctx = LTTNG_KERNEL_CONTEXT_CALLSTACK_USER; + break; default: ret = LTTNG_ERR_KERN_CONTEXT_FAIL; goto error;