X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Ftrace-kernel.c;h=0c14052e1a37aeb986ab51ab14e6578caa3d0ad9;hp=33e5488ef293fde00f2841094f17d92e15e0a834;hb=850767541647c102a299d7fbc39c97555ac70224;hpb=b0a5f0fbc428de5cd15a5c86f95a12f32e8c3c88 diff --git a/src/bin/lttng-sessiond/trace-kernel.c b/src/bin/lttng-sessiond/trace-kernel.c index 33e5488ef..0c14052e1 100644 --- a/src/bin/lttng-sessiond/trace-kernel.c +++ b/src/bin/lttng-sessiond/trace-kernel.c @@ -38,6 +38,13 @@ struct ltt_kernel_channel *trace_kernel_get_channel_by_name( assert(session); assert(name); + /* + * If we receive an empty string for channel name, it means the + * default channel name is requested. + */ + if (name[0] == '\0') + name = DEFAULT_CHANNEL_NAME; + DBG("Trying to find channel %s", name); cds_list_for_each_entry(chan, &session->channel_list.head, list) { @@ -144,6 +151,16 @@ struct ltt_kernel_channel *trace_kernel_create_channel( } memcpy(lkc->channel, chan, sizeof(struct lttng_channel)); + /* + * If we receive an empty string for channel name, it means the + * default channel name is requested. + */ + if (chan->name[0] == '\0') { + strncpy(lkc->channel->name, DEFAULT_CHANNEL_NAME, + sizeof(lkc->channel->name)); + } + lkc->channel->name[LTTNG_UST_SYM_NAME_LEN - 1] = '\0'; + lkc->fd = -1; lkc->stream_count = 0; lkc->event_count = 0;