From 71aecbf889a5e65466d36a46fe37720959ac7f35 Mon Sep 17 00:00:00 2001 From: David Goulet Date: Mon, 15 Sep 2014 15:20:51 -0400 Subject: [PATCH] Fix: use default agent channel name in disable event Signed-off-by: David Goulet --- src/bin/lttng-sessiond/event.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/bin/lttng-sessiond/event.c b/src/bin/lttng-sessiond/event.c index 59b591de9..cdfc1a864 100644 --- a/src/bin/lttng-sessiond/event.c +++ b/src/bin/lttng-sessiond/event.c @@ -750,7 +750,7 @@ int event_agent_disable(struct ltt_ust_session *usess, struct agent *agt, struct agent_event *aevent; struct ltt_ust_event *uevent = NULL; struct ltt_ust_channel *uchan = NULL; - const char *ust_event_name; + const char *ust_event_name, *ust_channel_name; assert(agt); assert(usess); @@ -769,12 +769,21 @@ int event_agent_disable(struct ltt_ust_session *usess, struct agent *agt, goto end; } + if (agt->domain == LTTNG_DOMAIN_JUL) { + ust_channel_name = DEFAULT_JUL_CHANNEL_NAME; + } else if (agt->domain == LTTNG_DOMAIN_LOG4J) { + ust_channel_name = DEFAULT_LOG4J_CHANNEL_NAME; + } else { + ret = LTTNG_ERR_INVALID; + goto error; + } + /* * Disable it on the UST side. First get the channel reference then find * the event and finally disable it. */ uchan = trace_ust_find_channel_by_name(usess->domain_global.channels, - DEFAULT_JUL_CHANNEL_NAME); + (char *) ust_channel_name); if (!uchan) { ret = LTTNG_ERR_UST_CHAN_NOT_FOUND; goto error; -- 2.34.1