From: Mathieu Desnoyers Date: Fri, 16 Aug 2013 21:10:52 +0000 (-0400) Subject: Fix: add-context without -c apply to all channels X-Git-Tag: v2.3.0-rc3~42 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=31ea48462f529be003231ca0e14c5b882cd7d66e;p=lttng-tools.git Fix: add-context without -c apply to all channels Fixes #618 Signed-off-by: Mathieu Desnoyers --- diff --git a/doc/man/lttng.1 b/doc/man/lttng.1 index 21b6279d0..6e0efb73a 100644 --- a/doc/man/lttng.1 +++ b/doc/man/lttng.1 @@ -104,9 +104,7 @@ contexts. If no channel is given (\-c), the context is added to all channels that were already enabled. If the session has no channel, a default channel is created. -If \fB\-c, \-\-channel\fP is omitted, but a non-default channel already -exists within the session, an error is returned. Otherwise the context -will be added only to the given channel (\-c). +Otherwise the context will be added only to the given channel (\-c). If \fB\-s, \-\-session\fP is omitted, the session name is taken from the .lttngrc file. diff --git a/src/bin/lttng-sessiond/cmd.c b/src/bin/lttng-sessiond/cmd.c index f2043df9c..64fa5c0bb 100644 --- a/src/bin/lttng-sessiond/cmd.c +++ b/src/bin/lttng-sessiond/cmd.c @@ -1124,17 +1124,6 @@ int cmd_add_context(struct ltt_session *session, int domain, case LTTNG_DOMAIN_KERNEL: assert(session->kernel_session); - /* - * If a non-default channel has been created in the - * session, explicitely require that -c chan_name needs - * to be provided. - */ - if (session->kernel_session->has_non_default_channel - && channel_name[0] == '\0') { - ret = LTTNG_ERR_NEED_CHANNEL_NAME; - goto error; - } - if (session->kernel_session->channel_count == 0) { /* Create default channel */ ret = channel_kernel_create(session->kernel_session, NULL, kwpipe); @@ -1156,16 +1145,6 @@ int cmd_add_context(struct ltt_session *session, int domain, assert(usess); - /* - * If a non-default channel has been created in the - * session, explicitely require that -c chan_name needs - * to be provided. - */ - if (usess->has_non_default_channel && channel_name[0] == '\0') { - ret = LTTNG_ERR_NEED_CHANNEL_NAME; - goto error; - } - chan_count = lttng_ht_get_count(usess->domain_global.channels); if (chan_count == 0) { struct lttng_channel *attr;