X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Ftrace-kernel.c;h=a5c215fae98a068f359c0bf182e307a693dc9244;hp=afb578cfde886754321d7a1c16c9d9d2ce89ec6b;hb=bd722d76b035766511f0b329f9bbaa2f4180c4ed;hpb=dec56f6cc894de41b312354d360b6a4c09fc199d diff --git a/src/bin/lttng-sessiond/trace-kernel.c b/src/bin/lttng-sessiond/trace-kernel.c index afb578cfd..a5c215fae 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_KERNEL_SYM_NAME_LEN - 1] = '\0'; + lkc->fd = -1; lkc->stream_count = 0; lkc->event_count = 0; @@ -191,7 +208,6 @@ struct ltt_kernel_event *trace_kernel_create_event(struct lttng_event *ev) attr->instrumentation = LTTNG_KERNEL_KRETPROBE; attr->u.kretprobe.addr = ev->attr.probe.addr; attr->u.kretprobe.offset = ev->attr.probe.offset; - attr->u.kretprobe.offset = ev->attr.probe.offset; strncpy(attr->u.kretprobe.symbol_name, ev->attr.probe.symbol_name, LTTNG_KERNEL_SYM_NAME_LEN); attr->u.kretprobe.symbol_name[LTTNG_KERNEL_SYM_NAME_LEN - 1] = '\0'; @@ -421,6 +437,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) {