[lttng-dev] [PATCH lttng-tools 26/28] Detect and report exclusion option errors

JP Ikaheimonen jp_ikaheimonen at mentor.com
Thu Nov 7 05:22:05 EST 2013


Signed-off-by: JP Ikaheimonen <jp_ikaheimonen at mentor.com>
---
 src/bin/lttng/commands/enable_events.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/src/bin/lttng/commands/enable_events.c b/src/bin/lttng/commands/enable_events.c
index 90ecdda..7009df7 100644
--- a/src/bin/lttng/commands/enable_events.c
+++ b/src/bin/lttng/commands/enable_events.c
@@ -465,6 +465,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);
@@ -682,6 +688,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--) {
-- 
1.8.1.2




More information about the lttng-dev mailing list