X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fcmd.c;h=2e2ae6006023c13b8457b30071e1332fdf24ef14;hb=f28f9e449e13d6a3495408e5329514fa5ca7150e;hp=a1eb961ee544331f961202ee2b69d36ffbe87868;hpb=7eac78030ec056b149f110d156b855b1e7d2c00f;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/cmd.c b/src/bin/lttng-sessiond/cmd.c index a1eb961ee..2e2ae6006 100644 --- a/src/bin/lttng-sessiond/cmd.c +++ b/src/bin/lttng-sessiond/cmd.c @@ -55,6 +55,7 @@ #include "rotate.h" #include "rotation-thread.h" #include "sessiond-timer.h" +#include "agent-thread.h" #include "cmd.h" @@ -1384,9 +1385,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; @@ -2094,6 +2101,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);