FULL_LTTNG_BIN="${TESTDIR}/../src/bin/lttng/${LTTNG_BIN}"
-tmp_stdout=$(mktemp --tmpdir -t test_list_triggers_cli_stdout.XXXXXX)
-tmp_stderr=$(mktemp --tmpdir -t test_list_triggers_cli_stderr.XXXXXX)
-tmp_expected_stdout=$(mktemp --tmpdir -t test_list_triggers_cli_expected_stdout.XXXXXX)
-tmp_expected_stdout_mi=$(mktemp --tmpdir -t test_list_triggers_cli_expected_stdout.mi.XXXXXX)
+tmp_stdout=$(mktemp -t test_list_triggers_cli_stdout.XXXXXX)
+tmp_stderr=$(mktemp -t test_list_triggers_cli_stderr.XXXXXX)
+tmp_expected_stdout=$(mktemp -t test_list_triggers_cli_expected_stdout.XXXXXX)
+tmp_expected_stdout_mi=$(mktemp -t test_list_triggers_cli_expected_stdout.mi.XXXXXX)
uprobe_elf_binary=$(realpath "${TESTDIR}/utils/testapp/userspace-probe-elf-binary/.libs/userspace-probe-elf-binary")
uprobe_sdt_binary=$(realpath "${TESTDIR}/utils/testapp/userspace-probe-sdt-binary/.libs/userspace-probe-sdt-binary")
register_some_triggers_bin=$(realpath "${CURDIR}/utils/register-some-triggers")
uid=$(id --user)
-gid=$(id --group)
-if [ "$uid" == "0" ]; then
- ist_root=1
- ls "$uprobe_sdt_binary" >/dev/null 2>&1
- if test $? == 0; then
- hast_sdt_binary=1
- else
- hast_sdt_binary=0
- fi
-else
- ist_root=0
- hast_sdt_binary=0
+sdt_binary_present=0
+if [ -f "$uprobe_sdt_binary" ]; then
+ sdt_binary_present=1
fi
-
test_top_level_options ()
{
diag "Listing top level options"
diag "Listing event-rule-matches kernel probe"
- channel_enable_addr=$(grep ' t lttng_channel_enable\s\[lttng_tracer\]$' /proc/kallsyms | cut -f 1 -d ' ')
- channel_disable_addr=$(grep ' t lttng_channel_disable\s\[lttng_tracer\]$' /proc/kallsyms | cut -f 1 -d ' ')
+ channel_enable_addr=$(grep '\<lttng_channel_enable\>' /proc/kallsyms | cut -f 1 -d ' ')
+ channel_disable_addr=$(grep '\<lttng_channel_disable\>' /proc/kallsyms | cut -f 1 -d ' ')
# We need to find a valid offset.
base_symbol=""
condition: buffer usage high
session name: the-session-name
channel name: the-channel-name
- domain: ust
+ domain: user space
threshold (bytes): 1234
errors: none
actions:
condition: buffer usage high
session name: the-session-name
channel name: the-channel-name
- domain: ust
+ domain: user space
threshold (ratio): 0.25
errors: none
actions:
condition: buffer usage low
session name: the-session-name
channel name: the-channel-name
- domain: ust
+ domain: user space
threshold (bytes): 2345
errors: none
actions:
condition: buffer usage low
session name: the-session-name
channel name: the-channel-name
- domain: ust
+ domain: user space
threshold (ratio): 0.40
errors: none
actions:
test_top_level_options
test_event_rule_matches_tracepoint
-skip $ist_root "non-root user: skipping kprobe tests" 13 || test_event_rule_matches_probe
-skip $ist_root "non-root user: skipping uprobe tests" 9 || test_event_rule_matches_userspace_probe_elf
-skip $(($ist_root && $hast_sdt_binary)) "skipping userspace probe SDT tests" 9 || test_event_rule_matches_userspace_probe_sdt
-skip $ist_root "non-root user: skipping syscall tests" 17 || test_event_rule_matches_syscall
+check_skip_kernel_test 48 "Skipping kprobe, uprobe, SDT and syscall tests." || {
+ test_event_rule_matches_probe
+ test_event_rule_matches_userspace_probe_elf
+ skip $sdt_binary_present "No SDT binary. Skipping userspace probe SDT tests" 9 || test_event_rule_matches_userspace_probe_sdt
+ test_event_rule_matches_syscall
+}
test_session_consumed_size_condition
test_buffer_usage_conditions
test_session_rotation_conditions