Fix: add-context without -c apply to all channels
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 16 Aug 2013 21:10:52 +0000 (17:10 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 16 Aug 2013 21:10:52 +0000 (17:10 -0400)
Fixes #618

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
doc/man/lttng.1
src/bin/lttng-sessiond/cmd.c

index 21b6279d0f2a48d18363d4ed611b62f97bf67009..6e0efb73abeca4181478c1bcc43188c9e11e1c0f 100644 (file)
@@ -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.
index f2043df9cb9c25bf364fb96b08b86340cadc7b1a..64fa5c0bb5c1e870cd11d1f7e6cd3a69f2b7c6da 100644 (file)
@@ -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;
This page took 0.030211 seconds and 4 git commands to generate.