lttng add-trigger: replace log level options with --log-level
[lttng-tools.git] / tests / regression / tools / trigger / test_list_triggers_cli
index af0885d8555f2389ef37d04de10e8f0cb65cd8d2..f5d34f967b142817d2d4e0ce2c160c1b68a47aca 100755 (executable)
@@ -23,8 +23,7 @@ TESTDIR="$CURDIR/../../.."
 # shellcheck source=../../../utils/utils.sh
 source "$TESTDIR/utils/utils.sh"
 
-
-NUM_TESTS=82
+NUM_TESTS=84
 
 FULL_LTTNG_BIN="${TESTDIR}/../src/bin/lttng/${LTTNG_BIN}"
 
@@ -95,8 +94,9 @@ test_on_event_tracepoint ()
        lttng_add_trigger_ok "C" --condition event-rule-matches --domain=user --action notify
        lttng_add_trigger_ok "A" --condition event-rule-matches --name=aaa --domain=user --filter 'p == 2' --action notify
        lttng_add_trigger_ok "D" --condition event-rule-matches --name='hello*' --domain=user -x 'hello2,hello3,hello4' --action notify
-       lttng_add_trigger_ok "B" --condition event-rule-matches --domain=user --name=gerboise --loglevel INFO --action notify
-       lttng_add_trigger_ok "E" --condition event-rule-matches --domain=user --name=lemming --loglevel-only WARNING --action notify
+       lttng_add_trigger_ok "B" --condition event-rule-matches --domain=user --name=gerboise --log-level INFO.. --action notify
+       lttng_add_trigger_ok "E" --condition event-rule-matches --domain=user --name=lemming --log-level WARNING --action notify
+       lttng_add_trigger_ok "J" --condition event-rule-matches --domain=user --name=lemming --log-level .. --action notify
        lttng_add_trigger_ok "F" --condition event-rule-matches --domain=user --name=capture-payload-field --capture a --action notify
        lttng_add_trigger_ok "G" --condition event-rule-matches --domain=user --name=capture-array --capture 'a[2]' --capture '$ctx.tourlou[18]' --action notify
        lttng_add_trigger_ok "H" --condition event-rule-matches --domain=user --name=capture-chan-ctx --capture '$ctx.vpid' --action notify
@@ -184,6 +184,14 @@ test_on_event_tracepoint ()
            notify
              errors: none
          errors: none
+       - name: J
+         user id: ${uid}
+         condition: event rule hit
+           rule: lemming (type: tracepoint, domain: ust)
+         actions:
+           notify
+             errors: none
+         errors: none
        EOF
 
        list_triggers_matches_ok "event-rule-matches, tracepoint event rule" "${tmp_expected_stdout}"
@@ -197,6 +205,7 @@ test_on_event_tracepoint ()
        lttng_remove_trigger_ok "G"
        lttng_remove_trigger_ok "H"
        lttng_remove_trigger_ok "I"
+       lttng_remove_trigger_ok "J"
 }
 
 test_on_event_probe ()
@@ -222,9 +231,9 @@ test_on_event_probe ()
 
        offset_hex="0x$(printf '%x' $offset)"
 
-       lttng_add_trigger_ok "T0" --condition event-rule-matches --domain=kernel --probe=lttng_channel_enable --event-name=my_channel_enable --action notify
-       lttng_add_trigger_ok "T1" --condition event-rule-matches --domain=kernel --probe="${base_symbol}+${offset_hex}" --event-name=my_channel_enable --action notify
-       lttng_add_trigger_ok "T2" --condition event-rule-matches --domain=kernel --probe="0x${channel_enable_addr}" --event-name=my_channel_enable --action notify
+       lttng_add_trigger_ok "T0" --condition event-rule-matches --domain=kernel --type=kprobe --location=lttng_channel_enable --event-name=my_channel_enable --action notify
+       lttng_add_trigger_ok "T1" --condition event-rule-matches --domain=kernel --type=kprobe --location="${base_symbol}+${offset_hex}" --event-name=my_channel_enable --action notify
+       lttng_add_trigger_ok "T2" --condition event-rule-matches --domain=kernel --type=kprobe --location="0x${channel_enable_addr}" --event-name=my_channel_enable --action notify
 
        cat > "${tmp_expected_stdout}" <<- EOF
        - name: T0
@@ -266,7 +275,7 @@ test_on_event_userspace_probe_elf ()
 
        diag "Listing on-event userspace-probe elf"
 
-       lttng_add_trigger_ok "T0" --condition event-rule-matches --domain=kernel --userspace-probe=${uprobe_elf_binary}:test_function --event-name=ma-probe-elf --action notify
+       lttng_add_trigger_ok "T0" --condition event-rule-matches --domain=kernel --type=uprobe --location=${uprobe_elf_binary}:test_function --event-name=ma-probe-elf --action notify
 
        cat > "${tmp_expected_stdout}" <<- EOF
        - name: T0
@@ -313,8 +322,8 @@ test_on_event_syscall ()
 {
        diag "Listing on-event syscall"
 
-       lttng_add_trigger_ok "T0" --condition event-rule-matches --domain=kernel --syscall --name=open --action notify
-       lttng_add_trigger_ok "T1" --condition event-rule-matches --domain=kernel --syscall --name=ptrace --filter 'a > 2' --action notify
+       lttng_add_trigger_ok "T0" --condition event-rule-matches --domain=kernel --type=syscall --name=open --action notify
+       lttng_add_trigger_ok "T1" --condition event-rule-matches --domain=kernel --type=syscall --name=ptrace --filter 'a > 2' --action notify
 
        cat > "${tmp_expected_stdout}" <<- EOF
        - name: T0
This page took 0.02621 seconds and 4 git commands to generate.