projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: channels can be _enabled_ after tracing is started, but not created
[lttng-tools.git]
/
src
/
bin
/
lttng-sessiond
/
cmd.c
diff --git
a/src/bin/lttng-sessiond/cmd.c
b/src/bin/lttng-sessiond/cmd.c
index d8571aa02e8b8317df04f283ef315bc75c1c1d68..5d375a179106fe495552488f2525b07582af09a9 100644
(file)
--- a/
src/bin/lttng-sessiond/cmd.c
+++ b/
src/bin/lttng-sessiond/cmd.c
@@
-859,15
+859,6
@@
int cmd_enable_channel(struct ltt_session *session,
rcu_read_lock();
rcu_read_lock();
- /*
- * 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;
- }
-
switch (domain->type) {
case LTTNG_DOMAIN_KERNEL:
{
switch (domain->type) {
case LTTNG_DOMAIN_KERNEL:
{
@@
-876,6
+867,15
@@
int cmd_enable_channel(struct ltt_session *session,
kchan = trace_kernel_get_channel_by_name(attr->name,
session->kernel_session);
if (kchan == NULL) {
kchan = trace_kernel_get_channel_by_name(attr->name,
session->kernel_session);
if (kchan == NULL) {
+ /*
+ * Don't try to create 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;
+ }
ret = channel_kernel_create(session->kernel_session, attr, wpipe);
} else {
ret = channel_kernel_enable(session->kernel_session, kchan);
ret = channel_kernel_create(session->kernel_session, attr, wpipe);
} else {
ret = channel_kernel_enable(session->kernel_session, kchan);
@@
-896,6
+896,15
@@
int cmd_enable_channel(struct ltt_session *session,
uchan = trace_ust_find_channel_by_name(chan_ht, attr->name);
if (uchan == NULL) {
uchan = trace_ust_find_channel_by_name(chan_ht, attr->name);
if (uchan == NULL) {
+ /*
+ * Don't try to create 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;
+ }
ret = channel_ust_create(usess, attr, domain->buf_type);
} else {
ret = channel_ust_enable(usess, uchan);
ret = channel_ust_create(usess, attr, domain->buf_type);
} else {
ret = channel_ust_enable(usess, uchan);
This page took
0.023848 seconds
and
4
git commands to generate.