X-Git-Url: http://git.efficios.com/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fcmd.c;h=5bf00be8536f12cb124fd0d828486344b75734b7;hp=dc465173e3521984f48b91f23e1782b83ba22b09;hb=cde3e505b7948c15880114268534d21fb1f10a1c;hpb=0210bba27680d0bc4278b926cad8b77eaa1b61ae diff --git a/src/bin/lttng-sessiond/cmd.c b/src/bin/lttng-sessiond/cmd.c index dc465173e..5bf00be85 100644 --- a/src/bin/lttng-sessiond/cmd.c +++ b/src/bin/lttng-sessiond/cmd.c @@ -1779,6 +1779,7 @@ error: int cmd_start_trace(struct ltt_session *session) { int ret; + unsigned long nb_chan = 0; struct ltt_kernel_session *ksession; struct ltt_ust_session *usess; @@ -1794,6 +1795,21 @@ int cmd_start_trace(struct ltt_session *session) goto error; } + /* + * Starting a session without channel is useless since after that it's not + * possible to enable channel thus inform the client. + */ + if (usess && usess->domain_global.channels) { + nb_chan += lttng_ht_get_count(usess->domain_global.channels); + } + if (ksession) { + nb_chan += ksession->channel_count; + } + if (!nb_chan) { + ret = LTTNG_ERR_NO_CHANNEL; + goto error; + } + session->enabled = 1; /* Kernel tracing */