X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=src%2Fcommon%2Fconfig%2Fsession-config.c;h=13f29eefdace3ea17832cdf9ca5cad7d87c54d31;hb=a76e73b4a90206a9d59c1798255167d3f15f126a;hp=783a74a3f3aac46fb916bbc4f533d4c2bb313f05;hpb=3c3c4e5c9cd601b618092e75aba017ce6896408c;p=lttng-tools.git diff --git a/src/common/config/session-config.c b/src/common/config/session-config.c index 783a74a3f..13f29eefd 100644 --- a/src/common/config/session-config.c +++ b/src/common/config/session-config.c @@ -2432,10 +2432,31 @@ int process_domain_node(xmlNodePtr domain_node, const char *session_name) /* create all channels */ for (node = xmlFirstElementChild(channels_node); node; node = xmlNextElementSibling(node)) { + const enum lttng_domain_type original_domain = domain.type; xmlNodePtr contexts_node = NULL; xmlNodePtr events_node = NULL; xmlNodePtr channel_attr_node; + /* + * Channels of the "agent" types cannot be created directly. + * They are meant to be created implicitly through the + * activation of events in their domain. However, a user + * can override the default channel configuration attributes + * by creating the underlying UST channel _before_ enabling + * an agent domain event. + * + * Hence, the channel's type is substituted before the creation + * and restored by the time the events are created. + */ + switch (domain.type) { + case LTTNG_DOMAIN_JUL: + case LTTNG_DOMAIN_LOG4J: + case LTTNG_DOMAIN_PYTHON: + domain.type = LTTNG_DOMAIN_UST; + default: + break; + } + channel = lttng_channel_create(&domain); if (!channel) { ret = -1; @@ -2457,6 +2478,9 @@ int process_domain_node(xmlNodePtr domain_node, const char *session_name) goto end; } + /* Restore the original channel domain. */ + domain.type = original_domain; + ret = process_events_node(events_node, handle, channel->name); if (ret) { goto end;