X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Ftrace-kernel.c;h=6a17776aa4fc10a8337c1aa9ea3383515d9f480a;hb=ed594980911b1d934726bf2ea8cd2bf338be72c9;hp=12189b9ea7929695576f27a33a13b46fa9a6b3dd;hpb=0525e9ae15d215943d8187e7f190d5a45e723085;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/trace-kernel.c b/src/bin/lttng-sessiond/trace-kernel.c index 12189b9ea..6a17776aa 100644 --- a/src/bin/lttng-sessiond/trace-kernel.c +++ b/src/bin/lttng-sessiond/trace-kernel.c @@ -109,7 +109,7 @@ struct ltt_kernel_session *trace_kernel_create_session(char *path) */ lks->tmp_consumer = NULL; - if (path && strlen(path) > 0) { + if (*path != '\0') { int ret; /* Use the default consumer output which is the tracing session path. */ @@ -143,7 +143,7 @@ alloc_error: * Return pointer to structure or NULL. */ struct ltt_kernel_channel *trace_kernel_create_channel( - struct lttng_channel *chan, char *path) + struct lttng_channel *chan) { struct ltt_kernel_channel *lkc; @@ -158,6 +158,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)); @@ -272,8 +273,8 @@ struct ltt_kernel_metadata *trace_kernel_create_metadata(void) chan->attr.overwrite = DEFAULT_CHANNEL_OVERWRITE; chan->attr.subbuf_size = default_get_metadata_subbuf_size(); chan->attr.num_subbuf = DEFAULT_METADATA_SUBBUF_NUM; - chan->attr.switch_timer_interval = DEFAULT_CHANNEL_SWITCH_TIMER; - chan->attr.read_timer_interval = DEFAULT_CHANNEL_READ_TIMER; + chan->attr.switch_timer_interval = DEFAULT_KERNEL_CHANNEL_SWITCH_TIMER; + chan->attr.read_timer_interval = DEFAULT_KERNEL_CHANNEL_READ_TIMER; chan->attr.output = DEFAULT_KERNEL_CHANNEL_OUTPUT; /* Init metadata */ @@ -319,6 +320,7 @@ struct ltt_kernel_stream *trace_kernel_create_stream(const char *name, /* Init stream */ lks->fd = -1; lks->state = 0; + lks->cpu = count; return lks;