X-Git-Url: http://git.efficios.com/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng%2Fcommands%2Fenable_events.c;h=57837eb7dcadd3828110b7a7f386460ad491a570;hp=0e6bb55d8bc7b618fadcc830c1a7ee736145a3c3;hb=de044b7a0613db6d16151ac9f7b7be404c0bb493;hpb=a74934bae19f96845f7af4b95a8fae5c2f860747 diff --git a/src/bin/lttng/commands/enable_events.c b/src/bin/lttng/commands/enable_events.c index 0e6bb55d8..57837eb7d 100644 --- a/src/bin/lttng/commands/enable_events.c +++ b/src/bin/lttng/commands/enable_events.c @@ -634,6 +634,7 @@ int cmd_enable_events(int argc, const char **argv) int opt, ret = CMD_SUCCESS; static poptContext pc; char *session_name = NULL; + int event_type = -1; pc = poptGetContext(NULL, argc, argv, long_options, 0); poptReadDefaultConfig(pc, 0); @@ -682,6 +683,17 @@ int cmd_enable_events(int argc, const char **argv) ret = CMD_UNDEFINED; goto end; } + + /* Validate event type. Multiple event type are not supported. */ + if (event_type == -1) { + event_type = opt_event_type; + } else { + if (event_type != opt_event_type) { + ERR("Multiple event type not supported."); + ret = CMD_ERROR; + goto end; + } + } } opt_event_list = (char*) poptGetArg(pc);