X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fcmd.c;h=cf30b8ebfbf88feda7cfa84617bf4ff4dae79b25;hb=09a88287202e1cb7bcc984f65237bee33e6c5b93;hp=bb46093e2586f4f458d60ad2584f7c97d264c0d3;hpb=b86685ef513314b56785e3d6c457e321dc8a9d1c;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/cmd.c b/src/bin/lttng-sessiond/cmd.c index bb46093e2..cf30b8ebf 100644 --- a/src/bin/lttng-sessiond/cmd.c +++ b/src/bin/lttng-sessiond/cmd.c @@ -41,6 +41,7 @@ #include "syscall.h" #include "agent.h" #include "buffer-registry.h" +#include "agent-thread.h" #include "cmd.h" @@ -1344,6 +1345,21 @@ int cmd_enable_channel(struct ltt_session *session, attr->attr.switch_timer_interval = 0; } + /* Check for feature support */ + switch (domain->type) { + 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: + break; + } + switch (domain->type) { case LTTNG_DOMAIN_KERNEL: { @@ -2077,6 +2093,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);