X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Ftrace-kernel.c;h=d889b6ab6582570587c9c4a66cdcf51fad30943a;hp=990684be918db721a36b8265813b4d8bdcb38cb7;hb=36b588eddce05ef840bd247f6a58316925b9a0a2;hpb=5d2e1e66a968d9e555f9b8b00d0589ebfaf3de32 diff --git a/src/bin/lttng-sessiond/trace-kernel.c b/src/bin/lttng-sessiond/trace-kernel.c index 990684be9..d889b6ab6 100644 --- a/src/bin/lttng-sessiond/trace-kernel.c +++ b/src/bin/lttng-sessiond/trace-kernel.c @@ -77,7 +77,7 @@ struct ltt_kernel_event *trace_kernel_get_event_by_name( * * Return pointer to structure or NULL. */ -struct ltt_kernel_session *trace_kernel_create_session(char *path) +struct ltt_kernel_session *trace_kernel_create_session(void) { struct ltt_kernel_session *lks = NULL; @@ -109,25 +109,6 @@ struct ltt_kernel_session *trace_kernel_create_session(char *path) */ lks->tmp_consumer = NULL; - if (*path != '\0') { - int ret; - - /* Use the default consumer output which is the tracing session path. */ - ret = snprintf(lks->consumer->dst.trace_path, PATH_MAX, - "%s" DEFAULT_KERNEL_TRACE_DIR, path); - if (ret < 0) { - PERROR("snprintf consumer trace path"); - goto error; - } - - /* Set session path */ - ret = asprintf(&lks->trace_path, "%s" DEFAULT_KERNEL_TRACE_DIR, path); - if (ret < 0) { - PERROR("asprintf kernel traces path"); - goto error; - } - } - return lks; error: @@ -158,6 +139,7 @@ struct ltt_kernel_channel *trace_kernel_create_channel( lkc->channel = zmalloc(sizeof(struct lttng_channel)); if (lkc->channel == NULL) { PERROR("lttng_channel zmalloc"); + free(lkc); goto error; } memcpy(lkc->channel, chan, sizeof(struct lttng_channel)); @@ -439,6 +421,8 @@ void trace_kernel_destroy_metadata(struct ltt_kernel_metadata *metadata) /* * Cleanup kernel session structure + * + * Should *NOT* be called with RCU read-side lock held. */ void trace_kernel_destroy_session(struct ltt_kernel_session *session) { @@ -476,6 +460,5 @@ void trace_kernel_destroy_session(struct ltt_kernel_session *session) consumer_destroy_output(session->consumer); consumer_destroy_output(session->tmp_consumer); - free(session->trace_path); free(session); }