From: JP Ikaheimonen Date: Tue, 5 Nov 2013 12:09:03 +0000 (+0200) Subject: Detect and report exclusion option errors X-Git-Tag: v2.4.0-rc1~17 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=d5dd17fd22066461e22eae8f77062cb3b9b111bc;p=lttng-tools.git Detect and report exclusion option errors --- diff --git a/src/bin/lttng/commands/enable_events.c b/src/bin/lttng/commands/enable_events.c index 5d77048d0..af6abbe6e 100644 --- a/src/bin/lttng/commands/enable_events.c +++ b/src/bin/lttng/commands/enable_events.c @@ -468,6 +468,12 @@ 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; + } + channel_name = opt_channel_name; handle = lttng_create_handle(session_name, &dom); @@ -678,6 +684,11 @@ static int enable_events(char *session_name) } if (opt_exclude) { + if (opt_event_type != LTTNG_EVENT_ALL && opt_event_type != LTTNG_EVENT_TRACEPOINT) { + ERR("Exclusion option can only be used with tracepoint events"); + ret = CMD_ERROR; + goto error; + } /* Free previously allocated items */ if (exclusion_list != NULL) { while (exclusion_count--) {