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.
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);
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;