X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Ftrace-kernel.c;h=6a17776aa4fc10a8337c1aa9ea3383515d9f480a;hb=331744e34f56a5aec69b05d356d6901e67926acc;hp=d3742be16e944c55adac4ab339bb021854b5ef96;hpb=fdd9eb17f6b6928771744bb40bb2283ce3340033;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/trace-kernel.c b/src/bin/lttng-sessiond/trace-kernel.c index d3742be16..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. */ @@ -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;