Fix: lttng: add-trigger: don't provide a default event rule type
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 1 Jul 2021 19:50:47 +0000 (15:50 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 24 Sep 2021 21:12:17 +0000 (17:12 -0400)
There is no reason for an event rule to have a default type. The
--type parameter is required.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: Ic7f03453fac410c96ca6bb3b3ca0bdfb297a10d1

src/bin/lttng/commands/add_trigger.c
tests/regression/tools/trigger/test_add_trigger_cli

index 6eaee74b274a56f80c3d474cab35835c332e3ceb..27f6cc8c6e3312f7315ce4df59a09543f08e4057 100644 (file)
@@ -832,7 +832,8 @@ struct parse_event_rule_res parse_event_rule(int *argc, const char ***argv)
        }
 
        if (event_rule_type == LTTNG_EVENT_RULE_TYPE_UNKNOWN) {
-               event_rule_type = LTTNG_EVENT_RULE_TYPE_USER_TRACEPOINT;
+               ERR("Event rule requires a --type.");
+               goto error;
        }
 
        /*
index 62153a383a3e613b488eab7e5b89d6c06bda4caf..49cff975a3644803eef1b030cabae9d0a7899cb6 100755 (executable)
@@ -459,7 +459,7 @@ test_failure "unknown --condition" \
 # `--condition event-rule-matches` failures
 test_failure "missing args after --condition event-rule-matches" \
        "Error: Need at least one --action." \
-       --condition event-rule-matches
+       --condition event-rule-matches --type=user
 
 test_failure "extra args after --condition event-rule-matches" \
        "Error: Unexpected argument 'bozo'" \
This page took 0.026726 seconds and 4 git commands to generate.