X-Git-Url: http://git.efficios.com/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Ftrace-ust.c;h=c80d5e772de8c48e913b5399f23be7af785241c5;hp=77f5e2510552f36b784e38816d5539671e66d26f;hb=850767541647c102a299d7fbc39c97555ac70224;hpb=7c612c2e69f7b4ebf77fd369126befb71e561a8f diff --git a/src/bin/lttng-sessiond/trace-ust.c b/src/bin/lttng-sessiond/trace-ust.c index 77f5e2510..c80d5e772 100644 --- a/src/bin/lttng-sessiond/trace-ust.c +++ b/src/bin/lttng-sessiond/trace-ust.c @@ -128,6 +128,13 @@ struct ltt_ust_channel *trace_ust_find_channel_by_name(struct lttng_ht *ht, struct lttng_ht_node_str *node; struct lttng_ht_iter iter; + /* + * 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; + lttng_ht_lookup(ht, (void *)name, &iter); node = lttng_ht_iter_get_node_str(&iter); if (node == NULL) { @@ -203,7 +210,7 @@ struct ltt_ust_session *trace_ust_create_session(uint64_t session_id) * during the session lifetime which is at the first enable channel and * only before start. The flag buffer_type_changed indicates the status. */ - lus->buffer_type = LTTNG_BUFFER_PER_PID; + lus->buffer_type = LTTNG_BUFFER_PER_UID; /* Once set to 1, the buffer_type is immutable for the session. */ lus->buffer_type_changed = 0; /* Init it in case it get used after allocation. */ @@ -268,8 +275,16 @@ struct ltt_ust_channel *trace_ust_create_channel(struct lttng_channel *chan) break; } - /* Copy channel name */ - strncpy(luc->name, chan->name, sizeof(luc->name)); + /* + * If we receive an empty string for channel name, it means the + * default channel name is requested. + */ + if (chan->name[0] == '\0') { + strncpy(luc->name, DEFAULT_CHANNEL_NAME, sizeof(luc->name)); + } else { + /* Copy channel name */ + strncpy(luc->name, chan->name, sizeof(luc->name)); + } luc->name[LTTNG_UST_SYM_NAME_LEN - 1] = '\0'; /* Init node */