From: Antoine Busque Date: Tue, 1 Sep 2015 23:48:43 +0000 (-0400) Subject: Fix: fail gracefully on --exclude on unsupported domains X-Git-Tag: v2.6.1~18 X-Git-Url: https://git.lttng.org/?a=commitdiff_plain;h=b48458516ccc5d4396fb843c626c0d7fd08a247f;p=lttng-tools.git Fix: fail gracefully on --exclude on unsupported domains Trying to use event name exclusions on unsupported domains other than kernel (i.e. log4j, jul, and python) would hang the client. Instead, report the error appropriately. Fixes: #909 Signed-off-by: Antoine Busque Signed-off-by: Jérémie Galarneau --- diff --git a/src/bin/lttng/commands/enable_events.c b/src/bin/lttng/commands/enable_events.c index 7b0e19545..50734c059 100644 --- a/src/bin/lttng/commands/enable_events.c +++ b/src/bin/lttng/commands/enable_events.c @@ -681,10 +681,21 @@ static int enable_events(char *session_name) goto error; } - if (opt_kernel && opt_exclude) { - ERR("Event name exclusions are not yet implemented for kernel events"); - ret = CMD_ERROR; - goto error; + if (opt_exclude) { + switch (dom.type) { + case LTTNG_DOMAIN_KERNEL: + case LTTNG_DOMAIN_JUL: + case LTTNG_DOMAIN_LOG4J: + ERR("Event name exclusions are not yet implemented for %s events", + get_domain_str(dom.type)); + ret = CMD_ERROR; + goto error; + case LTTNG_DOMAIN_UST: + /* Exclusions supported */ + break; + default: + assert(0); + } } channel_name = opt_channel_name;