{ OPT_LIST_OPTIONS, '\0', "list-options", false },
{ OPT_CONDITION, '\0', "condition", true },
{ OPT_ACTION, '\0', "action", true },
- { OPT_ID, '\0', "id", true },
+ { OPT_NAME, '\0', "name", true },
{ OPT_USER_ID, '\0', "user-id", true },
ARGPAR_OPT_DESCR_SENTINEL,
};
struct lttng_action *action = NULL;
struct lttng_trigger *trigger = NULL;
char *error = NULL;
- char *id = NULL;
+ char *name = NULL;
int i;
char *user_id = NULL;
break;
}
- case OPT_ID:
+ case OPT_NAME:
{
- if (!assign_string(&id, item_opt->arg, "--id")) {
+ if (!assign_string(&name, item_opt->arg, "--name")) {
goto error;
}
goto error;
}
- if (id) {
+ if (name) {
enum lttng_trigger_status trigger_status =
- lttng_trigger_set_name(trigger, id);
+ lttng_trigger_set_name(trigger, name);
if (trigger_status != LTTNG_TRIGGER_STATUS_OK) {
- ERR("Failed to set trigger id.");
+ ERR("Failed to set trigger name.");
goto error;
}
}
lttng_action_destroy(action);
lttng_trigger_destroy(trigger);
free(error);
- free(id);
+ free(name);
free(user_id);
return ret;
}
lttng_add_trigger_ok "hello" --condition on-event -u test-id --action notify
cat > "${tmp_expected_stdout}" <<- EOF
- - id: hello
+ - name: hello
user id: ${uid}
condition: event rule hit
rule: test-id (type: tracepoint, domain: ust)
cat > "${tmp_expected_stdout}" <<- EOF
- - id: A
+ - name: A
user id: ${uid}
condition: event rule hit
rule: aaa (type: tracepoint, domain: ust, filter: p == 2)
notify
errors: none
errors: none
- - id: B
+ - name: B
user id: ${uid}
condition: event rule hit
rule: gerboise (type: tracepoint, domain: ust, log level at least INFO)
notify
errors: none
errors: none
- - id: C
+ - name: C
user id: ${uid}
condition: event rule hit
rule: * (type: tracepoint, domain: ust)
notify
errors: none
errors: none
- - id: D
+ - name: D
user id: ${uid}
condition: event rule hit
rule: hello* (type: tracepoint, domain: ust, exclusions: hello2,hello3,hello4)
notify
errors: none
errors: none
- - id: E
+ - name: E
user id: ${uid}
condition: event rule hit
rule: lemming (type: tracepoint, domain: ust, log level is WARNING)
notify
errors: none
errors: none
- - id: F
+ - name: F
user id: ${uid}
condition: event rule hit
rule: capture-payload-field (type: tracepoint, domain: ust)
notify
errors: none
errors: none
- - id: G
+ - name: G
user id: ${uid}
condition: event rule hit
rule: capture-array (type: tracepoint, domain: ust)
notify
errors: none
errors: none
- - id: H
+ - name: H
user id: ${uid}
condition: event rule hit
rule: capture-chan-ctx (type: tracepoint, domain: ust)
notify
errors: none
errors: none
- - id: I
+ - name: I
user id: ${uid}
condition: event rule hit
rule: capture-app-ctx (type: tracepoint, domain: ust)
lttng_add_trigger_ok "T2" --condition on-event -k --probe="0x${channel_enable_addr}" my_channel_enable --action notify
cat > "${tmp_expected_stdout}" <<- EOF
- - id: T0
+ - name: T0
user id: ${uid}
condition: event rule hit
rule: my_channel_enable (type: probe, location: lttng_channel_enable)
notify
errors: none
errors: none
- - id: T1
+ - name: T1
user id: ${uid}
condition: event rule hit
rule: my_channel_enable (type: probe, location: ${base_symbol}+${offset_hex})
notify
errors: none
errors: none
- - id: T2
+ - name: T2
user id: ${uid}
condition: event rule hit
rule: my_channel_enable (type: probe, location: 0x${channel_enable_addr})
lttng_add_trigger_ok "T0" --condition on-event -k --userspace-probe=${uprobe_elf_binary}:${elf_function_name} ma-probe-elf --action notify
cat > "${tmp_expected_stdout}" <<- EOF
- - id: T0
+ - name: T0
user id: ${uid}
condition: event rule hit
rule: ma-probe-elf (type: userspace probe, location type: ELF, location: ${uprobe_elf_binary}:${elf_function_name})
lttng_add_trigger_ok "T1" --condition on-event -k --syscall ptrace --filter 'a > 2' --action notify
cat > "${tmp_expected_stdout}" <<- EOF
- - id: T0
+ - name: T0
user id: ${uid}
condition: event rule hit
rule: open (type: syscall)
notify
errors: none
errors: none
- - id: T1
+ - name: T1
user id: ${uid}
condition: event rule hit
rule: ptrace (type: syscall, filter: a > 2)
cat > "${tmp_expected_stdout}" <<- EOF
- - id: T0
+ - name: T0
user id: ${uid}
condition: event rule hit
rule: some-event (type: tracepoint, domain: ust)
snapshot session \`ze-session\`
errors: none
errors: none
- - id: T1
+ - name: T1
user id: ${uid}
condition: event rule hit
rule: some-event (type: tracepoint, domain: ust)
snapshot session \`ze-session\`, path: /some/path
errors: none
errors: none
- - id: T2
+ - name: T2
user id: ${uid}
condition: event rule hit
rule: some-event (type: tracepoint, domain: ust)
snapshot session \`ze-session\`, path: /some/other/path
errors: none
errors: none
- - id: T3
+ - name: T3
user id: ${uid}
condition: event rule hit
rule: some-event (type: tracepoint, domain: ust)
snapshot session \`ze-session\`, url: net://1.2.3.4
errors: none
errors: none
- - id: T4
+ - name: T4
user id: ${uid}
condition: event rule hit
rule: some-event (type: tracepoint, domain: ust)
snapshot session \`ze-session\`, url: net://1.2.3.4:1234:1235
errors: none
errors: none
- - id: T5
+ - name: T5
user id: ${uid}
condition: event rule hit
rule: some-event (type: tracepoint, domain: ust)
snapshot session \`ze-session\`, control url: tcp://1.2.3.4:1111, data url: tcp://1.2.3.4:1112
errors: none
errors: none
- - id: T6
+ - name: T6
user id: ${uid}
condition: event rule hit
rule: some-event (type: tracepoint, domain: ust)
snapshot session \`ze-session\`, path: /some/path, max size: 1234
errors: none
errors: none
- - id: T7
+ - name: T7
user id: ${uid}
condition: event rule hit
rule: some-event (type: tracepoint, domain: ust)
snapshot session \`ze-session\`, path: /some/path, name: meh
errors: none
errors: none
- - id: T8
+ - name: T8
user id: ${uid}
condition: event rule hit
rule: some-event (type: tracepoint, domain: ust)
snapshot session \`ze-session\`, rate policy: after every 10 occurrences
errors: none
errors: none
- - id: T9
+ - name: T9
user id: ${uid}
condition: event rule hit
rule: some-event (type: tracepoint, domain: ust)
cat > "${tmp_expected_stdout}" <<- EOF
- - id: T0
+ - name: T0
user id: ${uid}
condition: event rule hit
rule: some-event (type: tracepoint, domain: ust)
notify, rate policy: once after 5 occurrences
errors: none
errors: none
- - id: T1
+ - name: T1
user id: ${uid}
condition: event rule hit
rule: some-event (type: tracepoint, domain: ust)
function remove_trigger ()
{
- local id="$1"
- local test_name="remove trigger ${id}"
+ local name="$1"
+ local test_name="remove trigger ${name}"
- "${FULL_LTTNG_BIN}" remove-trigger "${id}" > "${tmp_stdout}" 2> "${tmp_stderr}"
+ "${FULL_LTTNG_BIN}" remove-trigger "${name}" > "${tmp_stdout}" 2> "${tmp_stderr}"
ok $? "${test_name}: exit code is 0"
- diff -u <(echo "Removed trigger \`${id}\`.") "${tmp_stdout}"
+ diff -u <(echo "Removed trigger \`${name}\`.") "${tmp_stdout}"
ok $? "${test_name}: expected stdout"
diff -u /dev/null "${tmp_stderr}"
lttng_add_trigger_ok "DEF" --condition on-event -u -a --action notify
cat > "${tmp_expected_stdout}" <<- EOF
-- id: ABC
+- name: ABC
user id: ${uid}
condition: event rule hit
rule: aaa (type: tracepoint, domain: ust, filter: p == 2)
notify
errors: none
errors: none
-- id: DEF
+- name: DEF
user id: ${uid}
condition: event rule hit
rule: * (type: tracepoint, domain: ust)
remove_trigger "ABC"
cat > "${tmp_expected_stdout}" <<- EOF
-- id: DEF
+- name: DEF
user id: ${uid}
condition: event rule hit
rule: * (type: tracepoint, domain: ust)