lttng add-trigger: rename on-event condition to event-rule-matches
authorSimon Marchi <simon.marchi@efficios.com>
Thu, 15 Apr 2021 01:33:46 +0000 (21:33 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 22 Apr 2021 04:58:19 +0000 (00:58 -0400)
Implement the proposal to rename the on-event condition to
event-rule-matches. This patch only updates the CLI, the API will be
renamed later.

Change-Id: I341d11922998043414028477fb65cfbb5a2d66cd
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
doc/man/lttng-add-trigger.1.txt
src/bin/lttng/commands/add_trigger.c
tests/regression/tools/notification/test_notification_notifier_discarded_count
tests/regression/tools/trigger/rate-policy/test_ust_rate_policy
tests/regression/tools/trigger/start-stop/test_start_stop
tests/regression/tools/trigger/test_add_trigger_cli
tests/regression/tools/trigger/test_list_triggers_cli
tests/regression/tools/trigger/test_remove_trigger_cli

index 211b707bc6851937de81cf353eee6444afbcb534..581dd1313932e90b2b2f89d481310f62c93d710a 100644 (file)
@@ -42,9 +42,9 @@ specific condition.  There must be exactly one condition given in the
 
 The available conditions are:
 
-Event rule: `on-event [event rule arguments]`::
+Event rule: `event-rule-matches [event rule arguments]`::
     This type of condition is met when the tracer encounters an event
-    matching the given even rule.  The arguments describing the event
+    matching the given event rule.  The arguments describing the event
     rule are the same as those describing the event rules of the
     man:lttng-enable-event(1) command, with these exceptions:
 
@@ -102,9 +102,9 @@ Capture expression
 ~~~~~~~~~~~~~~~~~~
 
 A capture expression can be specified with the option:--capture option when
-creating a new on-event condition. If the capture expression corresponds with an
-event's field when tracing, the runtime dynamic value corresponding to the
-capture expression is captured.
+creating a new event-rule-matches condition. If the capture expression
+corresponds with an event's field when tracing, the runtime dynamic value
+corresponding to the capture expression is captured.
 
 NOTE: Make sure to **single-quote** the capture expression when running
 the command from a shell, as capture expressions typically include
index af5c420e1fe769a708dcaf8e03da5efb93c53339..af58d7b316d604cc3839780fdd22d758b79f64f4 100644 (file)
@@ -1284,7 +1284,7 @@ struct condition_descr {
 
 static const
 struct condition_descr condition_descrs[] = {
-       { "on-event", handle_condition_event },
+       { "event-rule-matches", handle_condition_event },
        { "on-session-consumed-size", handle_condition_session_consumed_size },
        { "on-buffer-usage-high", handle_condition_buffer_usage_high },
        { "on-buffer-usage-low", handle_condition_buffer_usage_low },
index 2186bfb2ce4d6703f9fe8a917be9b32f758c674b..51b6e04eba4a296f7aea4be030d2f6cc8e221099 100755 (executable)
@@ -78,7 +78,7 @@ function test_kernel_notifier_discarded_count
        done
 
        lttng_add_trigger_ok "$trigger_name" \
-               --condition on-event --kernel lttng_test_filter_event \
+               --condition event-rule-matches --kernel lttng_test_filter_event \
                --action notify
 
        trigger_discarded_nb=$(trigger_get_discarded_notif_number "$trigger_name")
@@ -103,11 +103,11 @@ function test_kernel_notifier_discarded_count
 
        # Confirm that no notifier is enabled.
        list_triggers_line_count=$("$FULL_LTTNG_BIN" list-triggers | wc -l)
-       is "$list_triggers_line_count" "0" "No \`on-event\` kernel notifier enabled as expected"
+       is "$list_triggers_line_count" "0" "No \`event-rule-matches\` kernel notifier enabled as expected"
 
        # Enable another notifier and list it to confirm the counter was cleared.
        lttng_add_trigger_ok "$trigger_name" \
-               --condition on-event --kernel lttng_test_filter_event \
+               --condition event-rule-matches --kernel lttng_test_filter_event \
                --action notify
 
        trigger_discarded_nb=$(trigger_get_discarded_notif_number "$trigger_name")
@@ -129,13 +129,13 @@ function test_kernel_notifier_discarded_count_max_bucket
        diag "Kernel event notifer error counter bucket limit"
        for i in $(seq 3); do
                lttng_add_trigger_ok "$i" \
-                       --condition on-event --kernel my_event_that_doesnt_need_to_really_exist_$i \
+                       --condition event-rule-matches --kernel my_event_that_doesnt_need_to_really_exist_$i \
                        --action notify
        done
 
        for i in $(seq 4 5); do
                lttng_add_trigger_fail "$i" \
-                       --condition on-event --kernel my_event_that_doesnt_need_to_really_exist_$i \
+                       --condition event-rule-matches --kernel my_event_that_doesnt_need_to_really_exist_$i \
                        --action notify
        done
 
@@ -180,7 +180,7 @@ function test_ust_notifier_discarded_count
        done
 
        lttng_add_trigger_ok "$trigger_name" \
-               --condition on-event --userspace tp:tptest \
+               --condition event-rule-matches --userspace tp:tptest \
                --action notify
 
        trigger_discarded_nb=$(trigger_get_discarded_notif_number "$trigger_name")
@@ -202,11 +202,11 @@ function test_ust_notifier_discarded_count
 
        # Confirm that no notifier is enabled.
        list_triggers_line_count=$("$FULL_LTTNG_BIN" list-triggers | wc -l)
-       is "$list_triggers_line_count" "0" "No \`on-event\` userspace notifier enabled as expected"
+       is "$list_triggers_line_count" "0" "No \`event-rule-matches\` userspace notifier enabled as expected"
 
        # Enable another notifier and list it to confirm the counter was cleared.
        lttng_add_trigger_ok "$trigger_name" \
-               --condition on-event --userspace tp:tptest \
+               --condition event-rule-matches --userspace tp:tptest \
                --action notify
 
        trigger_discarded_nb=$(trigger_get_discarded_notif_number "$trigger_name")
@@ -226,13 +226,13 @@ function test_ust_notifier_discarded_count_max_bucket
        diag "UST event notifer error counter bucket limit"
        for i in $(seq 3); do
                lttng_add_trigger_ok "$i" \
-                       --condition on-event --userspace my_event_that_doesnt_need_to_really_exist_$i \
+                       --condition event-rule-matches --userspace my_event_that_doesnt_need_to_really_exist_$i \
                        --action notify
        done
 
        for i in $(seq 4 5); do
                lttng_add_trigger_fail "$i" \
-                       --condition on-event --userspace my_event_that_doesnt_need_to_really_exist_$i \
+                       --condition event-rule-matches --userspace my_event_that_doesnt_need_to_really_exist_$i \
                        --action notify
        done
 
index 63993aa5150e0f007f04ebe6dec48646ef773839..d7ec3891cdb89ffd8c9f2e06d8d0cc21e1c1b5d2 100755 (executable)
@@ -36,7 +36,7 @@ function test_rate_policy_every_n()
        # time the condition is met.
        lttng_add_trigger_ok \
                $TRIGGER_NAME \
-               --condition on-event -u "tp:tptest" \
+               --condition event-rule-matches -u "tp:tptest" \
                --action notify \
                --rate-policy=every:5
 
@@ -46,7 +46,7 @@ function test_rate_policy_every_n()
        # the notification subsystem. 
        lttng_add_trigger_ok \
                $END_TRIGGER_NAME \
-               --condition on-event -u "tp:end" \
+               --condition event-rule-matches -u "tp:end" \
                --action notify
 
        for i in $(seq 1 4); do
@@ -122,7 +122,7 @@ function test_rate_policy_once_after_n()
        # time the condition is met.
        lttng_add_trigger_ok \
                $TRIGGER_NAME \
-               --condition on-event -u "tp:tptest" \
+               --condition event-rule-matches -u "tp:tptest" \
                --action notify \
                --rate-policy=once-after:5
 
@@ -132,7 +132,7 @@ function test_rate_policy_once_after_n()
        # the notification subsystem. 
        lttng_add_trigger_ok \
                $END_TRIGGER_NAME \
-               --condition on-event -u "tp:end" \
+               --condition event-rule-matches -u "tp:end" \
                --action notify
 
        ## Phase 1
index a09279eeed51a8986a630242ebff4bb42fb8b050..d0486939799e3daa11f3090905b56b2cdc6a07c2 100755 (executable)
@@ -57,7 +57,7 @@ function test_start_session_action()
        # a `notify` action.
        lttng_add_trigger_ok \
                $TRIGGER_NAME \
-               --condition on-event -u "tp:tptest" \
+               --condition event-rule-matches -u "tp:tptest" \
                --action start-session $SESSION_NAME \
                --action notify
 
@@ -111,7 +111,7 @@ function test_stop_session_action()
        # a `notify` action.
        lttng_add_trigger_ok \
                $TRIGGER_NAME \
-               --condition on-event -u "tp:tptest" \
+               --condition event-rule-matches -u "tp:tptest" \
                --action stop-session $SESSION_NAME \
                --action notify
 
index a8d03c4dd66d9f3aabacc1f78f7bba9e3861b4e2..ba46a64ab59da96e2c7d67e11299f41df6c35242 100755 (executable)
@@ -79,56 +79,56 @@ function test_failure ()
 # top-level options
 test_success "explicit name" \
        --name hohoho \
-       --condition on-event some-event-id -u \
+       --condition event-rule-matches some-event-id -u \
        --action notify
 
-# `--condition on-event` successes
-test_success "--condition on-event some-event -u" \
-       --condition on-event some-event -u \
+# `--condition event-rule-matches` successes
+test_success "--condition event-rule-matches some-event -u" \
+       --condition event-rule-matches some-event -u \
        --action notify
 
-test_success "--condition on-event -a -u" \
-       --condition on-event -a -u \
+test_success "--condition event-rule-matches -a -u" \
+       --condition event-rule-matches -a -u \
        --action notify
 
 test_success "notify action polices" \
-       --condition on-event -u test-rate-policy=once-after \
+       --condition event-rule-matches -u test-rate-policy \
        --action notify \
        --rate-policy=every:55 \
        --action notify \
        --rate-policy=once-after:55
 
 test_success "start session action polices" \
-       --condition on-event -u test-rate-policy=once-after \
+       --condition event-rule-matches -u test-rate-policy \
        --action start-session my_session \
        --rate-policy=every:55 \
        --action start-session my_session \
        --rate-policy=once-after:55
 
 test_success "stop session action polices" \
-       --condition on-event -u test-rate-policy=once-after \
+       --condition event-rule-matches -u test-rate-policy \
        --action stop-session my_session \
        --rate-policy=every:55 \
        --action stop-session my_session \
        --rate-policy=once-after:55
 
 test_success "snapshot session action polices" \
-       --condition on-event -u test-rate-policy=once-after \
+       --condition event-rule-matches -u test-rate-policy \
        --action snapshot-session my_session \
        --rate-policy=every:55 \
        --action snapshot-session my_session \
        --rate-policy=once-after:55
 
 test_success "rotate session action polices" \
-       --condition on-event -u test-rate-policy=once-after \
+       --condition event-rule-matches -u test-rate-policy \
        --action rotate-session my_session \
        --rate-policy=every:55 \
        --action rotate-session my_session \
        --rate-policy=once-after:55
 
 skip $ist_root "non-root user: skipping kprobe tests" 9 || {
-       test_success "--condition on-event probe by symbol" \
-               --condition on-event -k --probe=lttng_channel_enable my_channel_enable \
+       test_success "--condition event-rule-matches probe by symbol" \
+               --condition event-rule-matches -k --probe=lttng_channel_enable my_channel_enable \
                --action notify
 
        channel_enable_addr=$(grep ' t lttng_channel_enable\s\[lttng_tracer\]$' /proc/kallsyms | cut -f 1 -d ' ')
@@ -147,102 +147,102 @@ skip $ist_root "non-root user: skipping kprobe tests" 9 || {
 
        offset_hex="0x$(printf '%x' $offset)"
 
-       test_success "--condition on-event probe by symbol with offset" \
-               --condition on-event -k --probe="${base_symbol}+${offset_hex}" my_$base_symbol \
+       test_success "--condition event-rule-matches probe by symbol with offset" \
+               --condition event-rule-matches -k --probe="${base_symbol}+${offset_hex}" my_$base_symbol \
                --action notify
 
-       test_success "--condition on-event probe by address" \
-               --condition on-event -k "--probe=0x${channel_enable_addr}" my_channel_enable \
+       test_success "--condition event-rule-matches probe by address" \
+               --condition event-rule-matches -k "--probe=0x${channel_enable_addr}" my_channel_enable \
                --action notify
 }
 
 skip $ist_root "non-root user: skipping uprobe tests" 6 || {
-       test_success "--condition on-event uprobe" \
-               --condition on-event -k --userspace-probe=${uprobe_elf_binary}:test_function ma-probe \
+       test_success "--condition event-rule-matches uprobe" \
+               --condition event-rule-matches -k --userspace-probe=${uprobe_elf_binary}:test_function ma-probe \
                --action notify
 
-       test_success "--condition on-event uprobe with elf prefix" \
-               --condition on-event -k --userspace-probe=elf:${uprobe_elf_binary}:test_function ma-probe-2 \
+       test_success "--condition event-rule-matches uprobe with elf prefix" \
+               --condition event-rule-matches -k --userspace-probe=elf:${uprobe_elf_binary}:test_function ma-probe-2 \
                --action notify
 }
 
 skip $ist_root "non-root user: skipping syscall tests" 9 || {
-       test_success "--condition on-event syscall" \
-               --condition on-event -k --syscall open \
+       test_success "--condition event-rule-matches syscall" \
+               --condition event-rule-matches -k --syscall open \
                --action notify
 
-       test_success "--condition on-event syscall -a" \
-               --condition on-event -k --syscall -a \
+       test_success "--condition event-rule-matches syscall -a" \
+               --condition event-rule-matches -k --syscall -a \
                --action notify
 
-       test_success "--condition on-event syscall with filter" \
-               --condition on-event -k --syscall --filter 'a > 2' open \
+       test_success "--condition event-rule-matches syscall with filter" \
+               --condition event-rule-matches -k --syscall --filter 'a > 2' open \
                --action notify
 }
 
 # `--action notify` successes
 test_success "--action notify" \
-       --condition on-event some-event-notify -u \
+       --condition event-rule-matches some-event-notify -u \
        --action notify
 
 test_success "--action notify --capture foo" \
-       --condition on-event some-event-notify-foo -u \
+       --condition event-rule-matches some-event-notify-foo -u \
        --capture foo --action notify
 
 test_success "--action notify --capture foo[2]" \
-       --condition on-event some-event-notify-foo2 -u \
+       --condition event-rule-matches some-event-notify-foo2 -u \
        --capture 'foo[2]' --action notify
 
 test_success '--action notify --capture $ctx.foo' \
-       --condition on-event some-event-notify-ctx-foo -u \
+       --condition event-rule-matches some-event-notify-ctx-foo -u \
        --capture '$ctx.foo' --action notify
 
 test_success '--action notify --capture $ctx.foo[2]' \
-       --condition on-event some-event-notify-ctx-foo2 -u \
+       --condition event-rule-matches some-event-notify-ctx-foo2 -u \
        --capture '$ctx.foo[2]' --action notify
 
 test_success '--action notify --capture $app.prov:type' \
-       --condition on-event some-event-notify-app-prov-type -u \
+       --condition event-rule-matches some-event-notify-app-prov-type -u \
        --capture '$app.prov:type' --action notify
 
 test_success '--action notify --capture $app.prov:type[2]' \
-       --condition on-event some-event-notify-app-prov-type-2 -u \
+       --condition event-rule-matches some-event-notify-app-prov-type-2 -u \
        --capture '$app.prov:type[2]' --action notify
 
 test_success '--action notify multiple captures' \
-       --condition on-event some-event-notify-multiple-captures -u \
+       --condition event-rule-matches some-event-notify-multiple-captures -u \
        --capture foo --capture '$app.hello:world' --action notify
 
 # `--action start-session` successes
 test_success "--action start-session" \
-       --condition on-event some-event-start-session -u \
+       --condition event-rule-matches some-event-start-session -u \
        --action start-session ze-session
 
 # `--action stop-session` successes
 test_success "--action stop-session foo" \
-       --condition on-event some-event-stop-session -u \
+       --condition event-rule-matches some-event-stop-session -u \
        --action stop-session ze-session
 
 # `--action rotate-session` successes
 test_success "--action rotate-session foo" \
-       --condition on-event some-event-rotate-session -u \
+       --condition event-rule-matches some-event-rotate-session -u \
        --action rotate-session ze-session
 
 # `--action snapshot-session` successes
 test_success "--action snapshot-session foo" \
-       --condition on-event some-event-snapshot-session -u \
+       --condition event-rule-matches some-event-snapshot-session -u \
        --action snapshot-session ze-session
 
 test_success "--action snapshot-session with file URI" \
-       --condition on-event some-event-snapshot-session2 -u \
+       --condition event-rule-matches some-event-snapshot-session2 -u \
        --action snapshot-session ze-session --path /hello
 
 test_success "--action snapshot-session with net URI" \
-       --condition on-event some-event-snapshot-session3 -u \
+       --condition event-rule-matches some-event-snapshot-session3 -u \
        --action snapshot-session ze-session --url net://1.2.3.4
 
 test_success "--action snapshot-session with ctrl/data URIs" \
-       --condition on-event some-event-snapshot-session4 -u \
+       --condition event-rule-matches some-event-snapshot-session4 -u \
        --action snapshot-session ze-session --ctrl-url=tcp://1.2.3.4:1234 --data-url=tcp://1.2.3.4:1235
 
 # top-level failures
@@ -254,12 +254,12 @@ test_failure "unknown option" \
 
 test_failure "missing --action" \
        "Error: Need at least one --action." \
-       --condition on-event hello -u
+       --condition event-rule-matches hello -u
 
 test_failure "two --condition" \
        "Error: A --condition was already given." \
-       --condition on-event aaa -u \
-       --condition on-event bbb -u \
+       --condition event-rule-matches aaa -u \
+       --condition event-rule-matches bbb -u \
        --action notify
 
 test_failure "missing argument to --name" \
@@ -269,23 +269,23 @@ test_failure "missing argument to --name" \
 for cmd in rate-policy=once-after rate-policy=every; do
        test_failure "missing argument to --${cmd}" \
                "Error: Rate policy format is invalid." \
-               --condition on-event -u -a --action notify \
+               --condition event-rule-matches -u -a --action notify \
                --${cmd}
 
        test_failure "invalid argument to --${cmd}: non-digit character" \
                "Error: Failed to parse rate policy value \`123bob\` as an integer." \
-               --condition on-event -u -a --action notify \
+               --condition event-rule-matches -u -a --action notify \
                --${cmd}:123bob
 
        test_failure "invalid argument to --${cmd}: empty string" \
                "Error: Failed to parse rate policy value \`\` as an integer." \
-               --condition on-event -u -a --action notify \
+               --condition event-rule-matches -u -a --action notify \
                --${cmd}":"
 done
 
 test_failure "invalid argument to --rate-policy: unknown policy type" \
        "Error: Rate policy type \`bob\` unknown." \
-       --condition on-event -u -a --action notify \
+       --condition event-rule-matches -u -a --action notify \
        --rate-policy=bob:123
 
 # `--condition` failures
@@ -296,154 +296,154 @@ test_failure "unknown --condition" \
        "Error: Unknown condition name 'zoofest'" \
        --condition zoofest
 
-# `--condition on-event` failures
-test_failure "missing args after --condition on-event" \
+# `--condition event-rule-matches` failures
+test_failure "missing args after --condition event-rule-matches" \
        "Error: Need to provide either a tracepoint name or -a/--all." \
-       --condition on-event
-test_failure "missing domain in --condition on-event" \
+       --condition event-rule-matches
+test_failure "missing domain in --condition event-rule-matches" \
        "Error: Please specify a domain (--kernel/--userspace/--jul/--log4j/--python)." \
-       --condition on-event -a
-test_failure "extra args after --condition on-event" \
+       --condition event-rule-matches -a
+test_failure "extra args after --condition event-rule-matches" \
        "Error: Unexpected argument 'bozo'" \
-       --condition on-event foo -u bozo
-test_failure "--condition on-event: --all with --probe" \
+       --condition event-rule-matches foo -u bozo
+test_failure "--condition event-rule-matches: --all with --probe" \
        "Error: Can't use -a/--all with probe event rules." \
-       --condition on-event --probe=do_sys_open --all
-test_failure "--condition on-event: missing tracepoint name with --probe" \
+       --condition event-rule-matches --probe=do_sys_open --all
+test_failure "--condition event-rule-matches: missing tracepoint name with --probe" \
        "Error: Need to provide either a tracepoint name or -a/--all." \
-       --condition on-event -k --probe do_sys_open
+       --condition event-rule-matches -k --probe do_sys_open
 
-test_failure "--condition on-event: missing tracepoint name with --userspace-probe" \
+test_failure "--condition event-rule-matches: missing tracepoint name with --userspace-probe" \
        "Error: Need to provide either a tracepoint name or -a/--all." \
-       --condition on-event -k --userspace-probe=${uprobe_elf_binary}:test_function
+       --condition event-rule-matches -k --userspace-probe=${uprobe_elf_binary}:test_function
 
-test_failure "--condition on-event: extra argument with --userspace-probe" \
+test_failure "--condition event-rule-matches: extra argument with --userspace-probe" \
        "Error: Unexpected argument 'world'" \
-       --condition on-event -k --userspace-probe=${uprobe_elf_binary}:test_failure hello world
+       --condition event-rule-matches -k --userspace-probe=${uprobe_elf_binary}:test_failure hello world
 
-test_failure "--condition on-event: missing tracepoint name with --syscall" \
+test_failure "--condition event-rule-matches: missing tracepoint name with --syscall" \
        "Error: Need to provide either a tracepoint name or -a/--all." \
-       --condition on-event -k --syscall
+       --condition event-rule-matches -k --syscall
 
-test_failure "--condition on-event: extra argument with --syscall" \
+test_failure "--condition event-rule-matches: extra argument with --syscall" \
        "Error: Unexpected argument 'open'" \
-       --condition on-event -k --syscall open open
+       --condition event-rule-matches -k --syscall open open
 
-test_failure "--condition on-event: both -a and a tracepoint name with --syscall" \
+test_failure "--condition event-rule-matches: both -a and a tracepoint name with --syscall" \
        "Error: Can't provide a tracepoint name with -a/--all." \
-       --condition on-event -k --syscall -a open
+       --condition event-rule-matches -k --syscall -a open
 
-test_failure "--condition on-event --capture: missing argument (end of arg list)" \
+test_failure "--condition event-rule-matches --capture: missing argument (end of arg list)" \
        'Error: While parsing argument #3 (`--capture`): Missing required argument for option `--capture`' \
        --action notify \
-       --condition on-event -u -a --capture
+       --condition event-rule-matches -u -a --capture
 
-test_failure "--condition on-event --capture: missing argument (before another option)" \
+test_failure "--condition event-rule-matches --capture: missing argument (before another option)" \
        'Error: While parsing expression `--action`: Unary operators are not allowed in capture expressions.' \
-       --condition on-event -u -a --capture \
+       --condition event-rule-matches -u -a --capture \
        --action notify \
 
-test_failure "--condition on-event --capture: binary operator" \
+test_failure "--condition event-rule-matches --capture: binary operator" \
        'Error: While parsing expression `foo == 2`: Binary operators are not allowed in capture expressions.' \
-       --condition on-event -u -a \
+       --condition event-rule-matches -u -a \
        --capture 'foo == 2' --action notify
 
-test_failure "--condition on-event --capture: unary operator" \
+test_failure "--condition event-rule-matches --capture: unary operator" \
        'Error: While parsing expression `!foo`: Unary operators are not allowed in capture expressions.' \
-       --condition on-event -u -a \
+       --condition event-rule-matches -u -a \
        --capture '!foo' --action notify
 
-test_failure "--condition on-event --capture: logical operator" \
+test_failure "--condition event-rule-matches --capture: logical operator" \
        'Error: While parsing expression `foo || bar`: Logical operators are not allowed in capture expressions.' \
-       --condition on-event -u -a \
+       --condition event-rule-matches -u -a \
        --capture 'foo || bar' --action notify
 
-test_failure "--condition on-event --capture: accessing a sub-field" \
+test_failure "--condition event-rule-matches --capture: accessing a sub-field" \
        'Error: While parsing expression `foo.bar`: Capturing subfields is not supported.' \
-       --condition on-event -u -a \
+       --condition event-rule-matches -u -a \
        --capture 'foo.bar' --action notify
 
-test_failure "--condition on-event --capture: accessing the sub-field of an array element" \
+test_failure "--condition event-rule-matches --capture: accessing the sub-field of an array element" \
        'Error: While parsing expression `foo[3].bar`: Capturing subfields is not supported.' \
-       --condition on-event -u -a \
+       --condition event-rule-matches -u -a \
        --capture 'foo[3].bar' --action notify
 
-test_failure "--condition on-event --capture: missing colon in app-specific context field" \
+test_failure "--condition event-rule-matches --capture: missing colon in app-specific context field" \
        'Error: Invalid app-specific context field name: missing colon in `foo`.' \
-       --condition on-event -u -a \
+       --condition event-rule-matches -u -a \
        --capture '$app.foo' --action notify
 
-test_failure "--condition on-event --capture: missing colon in app-specific context field" \
+test_failure "--condition event-rule-matches --capture: missing colon in app-specific context field" \
        'Error: Invalid app-specific context field name: missing type name after colon in `foo:`.' \
-       --condition on-event -u -a \
+       --condition event-rule-matches -u -a \
        --capture '$app.foo:' --action notify
 
 # `--action` failures
 test_failure "missing args after --action" \
        "Error: While parsing argument #1 (\`--action\`): Missing required argument for option \`--action\`" \
-       --condition on-event -u -a \
+       --condition event-rule-matches -u -a \
        --action
 
 # `--action notify` failures
 test_failure "extra arg after --action notify" \
        "Error: Unexpected argument \`bob\`." \
-       --condition on-event -u -a \
+       --condition event-rule-matches -u -a \
        --action notify bob
 
 # `--action start-session` failures
 test_failure "missing arg after --action start-session" \
        "Error: Missing session name." \
-       --condition on-event some-event-start-session -u \
+       --condition event-rule-matches some-event-start-session -u \
        --action start-session
 test_failure "extra arg after --action start-session" \
        "Error: Unexpected argument \`bob\`." \
-       --condition on-event some-event-start-session -u \
+       --condition event-rule-matches some-event-start-session -u \
        --action start-session ze-session bob
 
 # `--action stop-session` failures
 test_failure "missing arg after --action stop-session" \
        "Error: Missing session name." \
-       --condition on-event some-event-stop-session -u \
+       --condition event-rule-matches some-event-stop-session -u \
        --action stop-session
 test_failure "extra arg after --action stop-session" \
        "Error: Unexpected argument \`bob\`." \
-       --condition on-event some-event-stop-session -u \
+       --condition event-rule-matches some-event-stop-session -u \
        --action stop-session ze-session bob
 
 # `--action rotate-session` failures
 test_failure "missing arg after --action rotate-session" \
        "Error: Missing session name." \
-       --condition on-event some-event-rotate-session -u \
+       --condition event-rule-matches some-event-rotate-session -u \
        --action rotate-session
 test_failure "extra arg after --action rotate-session" \
        "Error: Unexpected argument \`bob\`." \
-       --condition on-event some-event-rotate-session -u \
+       --condition event-rule-matches some-event-rotate-session -u \
        --action rotate-session ze-session bob
 
 # `--action snapshot-session` failures
 test_failure "missing arg after --action snapshot-session" \
        "Error: Missing session name." \
-       --condition on-event some-event-snapshot-session -u \
+       --condition event-rule-matches some-event-snapshot-session -u \
        --action snapshot-session
 test_failure "extra arg after --action snapshot-session" \
        "Error: Unexpected argument \`bob\`." \
-       --condition on-event some-event-snapshot-session -u \
+       --condition event-rule-matches some-event-snapshot-session -u \
        --action snapshot-session ze-session bob
 test_failure "snapshot-session action, --max-size without destination" \
        "Error: Can't provide a snapshot output max size without a snapshot output destination." \
-       --condition on-event some-event-snapshot-session -u \
+       --condition event-rule-matches some-event-snapshot-session -u \
        --action snapshot-session ze-session --max-size 10M
 test_failure "snapshot-session action, --name without destination" \
        "Error: Can't provide a snapshot output name without a snapshot output destination." \
-       --condition on-event some-event-snapshot-session -u \
+       --condition event-rule-matches some-event-snapshot-session -u \
        --action snapshot-session ze-session --name hallo
 test_failure "snapshot-session action, --name with-local-path-instead-of-url" \
        "Error: Failed to parse '/something/that/looks/like/a/path' as an URL." \
-       --condition on-event some-event-snapshot-session -u \
+       --condition event-rule-matches some-event-snapshot-session -u \
        --action snapshot-session ze-session --name hallo --url /something/that/looks/like/a/path
 test_failure "snapshot-session action, --name with-net-url-instead-of-path" \
        "Error: Failed to parse 'net://8.8.8.8/' as a local path." \
-       --condition on-event some-event-snapshot-session -u \
+       --condition event-rule-matches some-event-snapshot-session -u \
        --action snapshot-session ze-session --name hallo --path net://8.8.8.8/
 
 # Cleanup
index 42893f5d6c45c8e41c388c31c3db08fb0be9d4ad..82a5d5a91142b20857c8f3f842c423d6e3f2bd8d 100755 (executable)
@@ -24,7 +24,7 @@ TESTDIR="$CURDIR/../../.."
 source "$TESTDIR/utils/utils.sh"
 
 
-NUM_TESTS=72
+NUM_TESTS=82
 
 FULL_LTTNG_BIN="${TESTDIR}/../src/bin/lttng/${LTTNG_BIN}"
 
@@ -70,7 +70,7 @@ test_top_level_options ()
 {
        diag "Listing top level options"
 
-       lttng_add_trigger_ok "hello" --condition on-event -u test-id --action notify
+       lttng_add_trigger_ok "hello" --condition event-rule-matches -u test-id --action notify
 
        cat > "${tmp_expected_stdout}" <<- EOF
        - name: hello
@@ -92,16 +92,15 @@ test_on_event_tracepoint ()
 {
        diag "Listing on-event tracepoint"
 
-       lttng_add_trigger_ok "C" --condition on-event -u -a --action notify
-       lttng_add_trigger_ok "A" --condition on-event aaa -u --filter 'p == 2' --action notify
-       lttng_add_trigger_ok "D" --condition on-event 'hello*' -u -x 'hello2,hello3,hello4' --action notify
-       lttng_add_trigger_ok "B" --condition on-event -u gerboise --loglevel INFO --action notify
-       lttng_add_trigger_ok "E" --condition on-event -u lemming --loglevel-only WARNING --action notify
-       lttng_add_trigger_ok "F" --condition on-event -u capture-payload-field --capture a --action notify
-       lttng_add_trigger_ok "G" --condition on-event -u capture-array --capture 'a[2]' --capture '$ctx.tourlou[18]' --action notify
-       lttng_add_trigger_ok "H" --condition on-event -u capture-chan-ctx --capture '$ctx.vpid' --action notify
-       lttng_add_trigger_ok "I" --condition on-event -u capture-app-ctx --capture '$app.iga:active_clients' --action notify
-
+       lttng_add_trigger_ok "C" --condition event-rule-matches -u -a --action notify
+       lttng_add_trigger_ok "A" --condition event-rule-matches aaa -u --filter 'p == 2' --action notify
+       lttng_add_trigger_ok "D" --condition event-rule-matches 'hello*' -u -x 'hello2,hello3,hello4' --action notify
+       lttng_add_trigger_ok "B" --condition event-rule-matches -u gerboise --loglevel INFO --action notify
+       lttng_add_trigger_ok "E" --condition event-rule-matches -u lemming --loglevel-only WARNING --action notify
+       lttng_add_trigger_ok "F" --condition event-rule-matches -u capture-payload-field --capture a --action notify
+       lttng_add_trigger_ok "G" --condition event-rule-matches -u capture-array --capture 'a[2]' --capture '$ctx.tourlou[18]' --action notify
+       lttng_add_trigger_ok "H" --condition event-rule-matches -u capture-chan-ctx --capture '$ctx.vpid' --action notify
+       lttng_add_trigger_ok "I" --condition event-rule-matches -u capture-app-ctx --capture '$app.iga:active_clients' --action notify
 
        cat > "${tmp_expected_stdout}" <<- EOF
        - name: A
@@ -187,7 +186,7 @@ test_on_event_tracepoint ()
          errors: none
        EOF
 
-       list_triggers_matches_ok "on-event, tracepoint event rule" "${tmp_expected_stdout}"
+       list_triggers_matches_ok "event-rule-matches, tracepoint event rule" "${tmp_expected_stdout}"
 
        lttng_remove_trigger_ok "A"
        lttng_remove_trigger_ok "B"
@@ -223,9 +222,9 @@ test_on_event_probe ()
 
        offset_hex="0x$(printf '%x' $offset)"
 
-       lttng_add_trigger_ok "T0" --condition on-event -k --probe=lttng_channel_enable my_channel_enable --action notify
-       lttng_add_trigger_ok "T1" --condition on-event -k --probe="${base_symbol}+${offset_hex}" my_channel_enable --action notify
-       lttng_add_trigger_ok "T2" --condition on-event -k --probe="0x${channel_enable_addr}" my_channel_enable --action notify
+       lttng_add_trigger_ok "T0" --condition event-rule-matches -k --probe=lttng_channel_enable my_channel_enable --action notify
+       lttng_add_trigger_ok "T1" --condition event-rule-matches -k --probe="${base_symbol}+${offset_hex}" my_channel_enable --action notify
+       lttng_add_trigger_ok "T2" --condition event-rule-matches -k --probe="0x${channel_enable_addr}" my_channel_enable --action notify
 
        cat > "${tmp_expected_stdout}" <<- EOF
        - name: T0
@@ -254,7 +253,7 @@ test_on_event_probe ()
          errors: none
        EOF
 
-       list_triggers_matches_ok "on-event, probe event rule" "${tmp_expected_stdout}"
+       list_triggers_matches_ok "event-rule-matches, probe event rule" "${tmp_expected_stdout}"
 
        lttng_remove_trigger_ok "T0"
        lttng_remove_trigger_ok "T1"
@@ -267,7 +266,7 @@ test_on_event_userspace_probe_elf ()
 
        diag "Listing on-event userspace-probe elf"
 
-       lttng_add_trigger_ok "T0" --condition on-event -k --userspace-probe=${uprobe_elf_binary}:${elf_function_name} ma-probe-elf --action notify
+       lttng_add_trigger_ok "T0" --condition event-rule-matches -k --userspace-probe=${uprobe_elf_binary}:test_function ma-probe-elf --action notify
 
        cat > "${tmp_expected_stdout}" <<- EOF
        - name: T0
@@ -280,14 +279,13 @@ test_on_event_userspace_probe_elf ()
          errors: none
        EOF
 
-       list_triggers_matches_ok "on-event, userspace-probe event rule ELF" "${tmp_expected_stdout}"
+       list_triggers_matches_ok "event-rule-matches, userspace-probe event rule" "${tmp_expected_stdout}"
 
        lttng_remove_trigger_ok "T0"
 }
 
 test_on_event_userspace_probe_sdt ()
 {
-
        local sdt_provider_name="foobar"
        local sdt_probe_name="tp1"
 
@@ -315,8 +313,8 @@ test_on_event_syscall ()
 {
        diag "Listing on-event syscall"
 
-       lttng_add_trigger_ok "T0" --condition on-event -k --syscall open --action notify
-       lttng_add_trigger_ok "T1" --condition on-event -k --syscall ptrace --filter 'a > 2' --action notify
+       lttng_add_trigger_ok "T0" --condition event-rule-matches -k --syscall open --action notify
+       lttng_add_trigger_ok "T1" --condition event-rule-matches -k --syscall ptrace --filter 'a > 2' --action notify
 
        cat > "${tmp_expected_stdout}" <<- EOF
        - name: T0
@@ -337,7 +335,7 @@ test_on_event_syscall ()
          errors: none
        EOF
 
-       list_triggers_matches_ok "on-event, syscall event rule" "${tmp_expected_stdout}"
+       list_triggers_matches_ok "event-rule-matches, syscall event rule" "${tmp_expected_stdout}"
 
        lttng_remove_trigger_ok "T0"
        lttng_remove_trigger_ok "T1"
@@ -347,17 +345,16 @@ test_snapshot_action ()
 {
        diag "Listing snapshot actions"
 
-       lttng_add_trigger_ok "T0" --condition on-event -u some-event --action snapshot-session ze-session
-       lttng_add_trigger_ok "T1" --condition on-event -u some-event --action snapshot-session ze-session --path /some/path
-       lttng_add_trigger_ok "T2" --condition on-event -u some-event --action snapshot-session ze-session --url file:///some/other/path
-       lttng_add_trigger_ok "T3" --condition on-event -u some-event --action snapshot-session ze-session --url net://1.2.3.4
-       lttng_add_trigger_ok "T4" --condition on-event -u some-event --action snapshot-session ze-session --url net://1.2.3.4:1234:1235
-       lttng_add_trigger_ok "T5" --condition on-event -u some-event --action snapshot-session ze-session --ctrl-url=tcp://1.2.3.4:1111 --data-url=tcp://1.2.3.4:1112
-       lttng_add_trigger_ok "T6" --condition on-event -u some-event --action snapshot-session ze-session --path /some/path --max-size=1234
-       lttng_add_trigger_ok "T7" --condition on-event -u some-event --action snapshot-session ze-session --path /some/path --name=meh
-       lttng_add_trigger_ok "T8" --condition on-event -u some-event --action snapshot-session ze-session --rate-policy=every:10
-       lttng_add_trigger_ok "T9" --condition on-event -u some-event --action snapshot-session ze-session --rate-policy=once-after:10
-
+       lttng_add_trigger_ok "T0" --condition event-rule-matches -u some-event --action snapshot-session ze-session
+       lttng_add_trigger_ok "T1" --condition event-rule-matches -u some-event --action snapshot-session ze-session --path /some/path
+       lttng_add_trigger_ok "T2" --condition event-rule-matches -u some-event --action snapshot-session ze-session --url file:///some/other/path
+       lttng_add_trigger_ok "T3" --condition event-rule-matches -u some-event --action snapshot-session ze-session --url net://1.2.3.4
+       lttng_add_trigger_ok "T4" --condition event-rule-matches -u some-event --action snapshot-session ze-session --url net://1.2.3.4:1234:1235
+       lttng_add_trigger_ok "T5" --condition event-rule-matches -u some-event --action snapshot-session ze-session --ctrl-url=tcp://1.2.3.4:1111 --data-url=tcp://1.2.3.4:1112
+       lttng_add_trigger_ok "T6" --condition event-rule-matches -u some-event --action snapshot-session ze-session --path /some/path --max-size=1234
+       lttng_add_trigger_ok "T7" --condition event-rule-matches -u some-event --action snapshot-session ze-session --path /some/path --name=meh
+       lttng_add_trigger_ok "T8" --condition event-rule-matches -u some-event --action snapshot-session ze-session --rate-policy=every:10
+       lttng_add_trigger_ok "T9" --condition event-rule-matches -u some-event --action snapshot-session ze-session --rate-policy=once-after:10
 
        cat > "${tmp_expected_stdout}" <<- EOF
        - name: T0
@@ -444,16 +441,22 @@ test_snapshot_action ()
 
        list_triggers_matches_ok "snapshot action" "${tmp_expected_stdout}"
 
-       stop_lttng_sessiond_notap
+       lttng_remove_trigger_ok "T0"
+       lttng_remove_trigger_ok "T1"
+       lttng_remove_trigger_ok "T2"
+       lttng_remove_trigger_ok "T3"
+       lttng_remove_trigger_ok "T4"
+       lttng_remove_trigger_ok "T5"
+       lttng_remove_trigger_ok "T6"
+       lttng_remove_trigger_ok "T7"
+       lttng_remove_trigger_ok "T8"
+       lttng_remove_trigger_ok "T9"
 }
 
 test_notify_action ()
 {
-       start_lttng_sessiond_notap
-
-       lttng_add_trigger_ok "T0" --condition on-event -u some-event --action notify --rate-policy=once-after:5
-       lttng_add_trigger_ok "T1" --condition on-event -u some-event --action notify --rate-policy=every:10
-
+       lttng_add_trigger_ok "T0" --condition event-rule-matches -u some-event --action notify --rate-policy=once-after:5
+       lttng_add_trigger_ok "T1" --condition event-rule-matches -u some-event --action notify --rate-policy=every:10
 
        cat > "${tmp_expected_stdout}" <<- EOF
        - name: T0
index 5ec36bccf0519a1670c1f68dc134c1b3bf789d84..9a04687612acf39de3c3602b054ab026d4882543 100755 (executable)
@@ -68,8 +68,8 @@ function remove_trigger ()
 start_lttng_sessiond_notap
 
 # Add a few triggers
-lttng_add_trigger_ok "ABC" --condition on-event aaa -u --filter 'p == 2' --action notify
-lttng_add_trigger_ok "DEF" --condition on-event -u -a --action notify
+lttng_add_trigger_ok "ABC" --condition event-rule-matches aaa -u --filter 'p == 2' --action notify
+lttng_add_trigger_ok "DEF" --condition event-rule-matches -u -a --action notify
 
 cat > "${tmp_expected_stdout}" <<- EOF
 - name: ABC
This page took 0.041875 seconds and 4 git commands to generate.