X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fcmd.c;h=91040ec1ede9b83043815d4ca468b256b2ae3468;hb=25258405ed9590fcbcfb02c10dd8c018dba3a7bd;hp=081648889cebdc8e645e76c6b176d60a7a8d2faf;hpb=919b1ca309361b9e87a80514daf96825a4ac8fa7;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/cmd.c b/src/bin/lttng-sessiond/cmd.c index 081648889..91040ec1e 100644 --- a/src/bin/lttng-sessiond/cmd.c +++ b/src/bin/lttng-sessiond/cmd.c @@ -51,6 +51,7 @@ #include "buffer-registry.h" #include "notification-thread.h" #include "notification-thread-commands.h" +#include "agent-thread.h" #include "cmd.h" @@ -1380,9 +1381,15 @@ int cmd_enable_channel(struct ltt_session *session, break; } case LTTNG_DOMAIN_UST: + break; case LTTNG_DOMAIN_JUL: case LTTNG_DOMAIN_LOG4J: case LTTNG_DOMAIN_PYTHON: + if (!agent_tracing_is_enabled()) { + DBG("Attempted to enable a channel in an agent domain but the agent thread is not running"); + ret = LTTNG_ERR_AGENT_TRACING_DISABLED; + goto error; + } break; default: ret = LTTNG_ERR_UNKNOWN_DOMAIN; @@ -2090,6 +2097,12 @@ static int _cmd_enable_event(struct ltt_session *session, assert(usess); + if (!agent_tracing_is_enabled()) { + DBG("Attempted to enable an event in an agent domain but the agent thread is not running"); + ret = LTTNG_ERR_AGENT_TRACING_DISABLED; + goto error; + } + agt = trace_ust_find_agent(usess, domain->type); if (!agt) { agt = agent_create(domain->type);