X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fcontext.c;h=866a039e74dc0c07a7171f1d22ca7994435d541e;hb=9589be740bb4dc78669f5b73236082bf4682f511;hp=10352d026952ec3361acccf6aa07ac97bab4b34f;hpb=645328ae989e5f50a3a49c1ac34b2fee287a3d7b;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/context.c b/src/bin/lttng-sessiond/context.c index 10352d026..866a039e7 100644 --- a/src/bin/lttng-sessiond/context.c +++ b/src/bin/lttng-sessiond/context.c @@ -15,7 +15,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#define _GNU_SOURCE +#define _LGPL_SOURCE #include #include #include @@ -198,7 +198,8 @@ int context_kernel_add(struct ltt_kernel_session *ksession, kctx->ctx.ctx = LTTNG_KERNEL_CONTEXT_PERF_CPU_COUNTER; break; default: - return LTTNG_ERR_KERN_CONTEXT_FAIL; + ret = LTTNG_ERR_KERN_CONTEXT_FAIL; + goto error; } kctx->ctx.u.perf_counter.type = ctx->u.perf_counter.type; @@ -226,9 +227,12 @@ int context_kernel_add(struct ltt_kernel_session *ksession, } } - ret = LTTNG_OK; + return LTTNG_OK; error: + if (kctx) { + trace_kernel_destroy_context(kctx); + } return ret; } @@ -257,11 +261,6 @@ int context_ust_add(struct ltt_ust_session *usess, int domain, 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 = LTTNG_ERR_UND; goto error; @@ -285,7 +284,8 @@ int context_ust_add(struct ltt_ust_session *usess, int domain, cds_lfht_for_each_entry(chan_ht->ht, &iter.iter, uchan, node.node) { ret = add_uctx_to_channel(usess, domain, uchan, ctx); if (ret < 0) { - ERR("Context failed for channel %s", uchan->name); + ERR("Failed to add context to channel %s", + uchan->name); continue; } }