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>
Mon, 18 Oct 2021 18:58:29 +0000 (14:58 -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 8fb79d3786c577842475ea9724f92293ec591800..c73154b041c3c97314f5539654354b83f9f99320 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.027311 seconds and 5 git commands to generate.