This removes also the check done to start the session if it was started
before.
Signed-off-by: David Goulet <dgoulet@efficios.com>
will be set with that type and all other subsequent channel needs to have the
same type.
will be set with that type and all other subsequent channel needs to have the
same type.
-For the kernel tracer (\-k), once the session is started at least once, it's
-not possible anymore to enable new channel for that session.
+Note that once the session has been started and enabled on the tracer side,
+it's not possible anymore to enable a new channel for that session.
DBG("Enabling channel %s for session %s", attr->name, session->name);
DBG("Enabling channel %s for session %s", attr->name, session->name);
+ /*
+ * Don't try to enable a channel if the session has been started at
+ * some point in time before. The tracer does not allow it.
+ */
+ if (session->started) {
+ ret = LTTNG_ERR_TRACE_ALREADY_STARTED;
+ goto error;
+ }
+
rcu_read_lock();
switch (domain->type) {
rcu_read_lock();
switch (domain->type) {
}
kernel_wait_quiescent(kernel_tracer_fd);
}
kernel_wait_quiescent(kernel_tracer_fd);
-
- /*
- * If the session was previously started, start as well this newly
- * created kernel session so the events/channels enabled *after* the
- * start actually work.
- */
- if (session->started && !session->kernel_session->started) {
- ret = start_kernel_session(session->kernel_session, wpipe);
- if (ret != LTTNG_OK) {
- goto error;
- }
- }
break;
}
case LTTNG_DOMAIN_UST:
break;
}
case LTTNG_DOMAIN_UST:
} else {
ret = channel_ust_enable(usess, uchan);
}
} else {
ret = channel_ust_enable(usess, uchan);
}
-
- /* Start the UST session if the session was already started. */
- if (session->started && !usess->start_trace) {
- ret = ust_app_start_trace_all(usess);
- if (ret < 0) {
- ret = LTTNG_ERR_UST_START_FAIL;
- goto error;
- }
- ret = LTTNG_OK;
- usess->start_trace = 1;
- }
- session->started = 0;
-