*/
#define _GNU_SOURCE
+#define _LGPL_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
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;
}
}
- ret = LTTNG_OK;
+ return LTTNG_OK;
error:
+ if (kctx) {
+ trace_kernel_destroy_context(kctx);
+ }
return ret;
}
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;