RELAYD_MATCH=".*lttng-relayd.*"
LTTNG_BIN="lttng"
BABELTRACE_BIN="babeltrace2"
-OUTPUT_DEST=/dev/null
-ERROR_OUTPUT_DEST=/dev/null
+LTTNG_TEST_LOG_DIR="${LTTNG_TEST_LOG_DIR:-}"
+LTTNG_TEST_VERBOSE_BABELTRACE="${LTTNG_TEST_VERBOSE_BABELTRACE:-}"
+LTTNG_TEST_BABELTRACE_VERBOSITY="${LTTNG_TEST_BABELTRACE_VERBOSITY:-I}"
+LTTNG_TEST_VERBOSE_CLIENT="${LTTNG_TEST_VERBOSE_CLIENT:-}"
+LTTNG_TEST_VERBOSE_RELAYD="${LTTNG_TEST_VERBOSE_RELAYD:-}"
+LTTNG_TEST_VERBOSE_SESSIOND="${LTTNG_TEST_VERBOSE_SESSIOND:-}"
+OUTPUT_DEST="${OUTPUT_DEST:-}" # For 'lttng', some scripts set this to catch a command output
+ERROR_OUTPUT_DEST="${ERROR_OUTPUT_DEST:-}" # For 'lttng', some scripts set this to catch a command error output
MI_XSD_MAJOR_VERSION=4
MI_XSD_MINOR_VERSION=1
MI_XSD_PATH="$TESTDIR/../src/common/mi-lttng-${MI_XSD_MAJOR_VERSION}.${MI_XSD_MINOR_VERSION}.xsd"
PGREP=pgrep
fi
+function _lttng_client_log_file ()
+{
+ local output_dest="${1}"
+ if [[ -n "${output_dest}" ]]; then
+ if [[ "${output_dest}" != "-" ]]; then
+ echo "${output_dest}"
+ fi
+ elif [[ -n "${LTTNG_TEST_LOG_DIR}" ]]; then
+ if [[ "${LTTNG_TEST_LOG_DIR}" != "-" ]]; then
+ mktemp -p "${LTTNG_TEST_LOG_DIR}" "lttng.XXXXXX"
+ fi
+ else
+ echo "/dev/null"
+ fi
+}
+
+function lttng_client_log_file ()
+{
+ _lttng_client_log_file "${OUTPUT_DEST}"
+}
+
+function lttng_client_err_file ()
+{
+ _lttng_client_log_file "${ERROR_OUTPUT_DEST}"
+}
+
+function lttng_log_file ()
+{
+ local app="${1:-}"
+ if [[ -z "${app}" ]] || [[ -z "${LTTNG_TEST_LOG_DIR}" ]]; then
+ echo "/dev/null"
+ return
+ fi
+
+ if [[ "${LTTNG_TEST_LOG_DIR}" == "-" ]]; then
+ return
+ fi
+
+ mktemp -p "${LTTNG_TEST_LOG_DIR}" "${app}.XXXXXX.log"
+}
+
# Due to the renaming of threads we need to use the full command (pgrep -f) to
# identify the pids for multiple lttng related processes. The problem with "pgrep
# -f" is that it ends up also looking at the arguments. We use a two stage
while IFS= read -r pid ; do
# /proc/pid/cmdline is null separated.
- if full_command_no_argument=$(tr '\0' '\n' < /proc/"$pid"/cmdline 2>/dev/null | head -n1); then
+ if full_command_no_argument=$( (tr '\0' '\n' < /proc/"$pid"/cmdline) 2>/dev/null | head -n1); then
command_basename=$(basename "$full_command_no_argument")
if grep -q "$pattern" <<< "$command_basename"; then
echo "$pid"
echo
}
+function get_pipe_max_size()
+{
+ if grep -q 'FreeBSD' /etc/os-release ; then
+ # Kernel configuration dependant, but defaults to 64 * 1024
+ # https://github.com/freebsd/freebsd-src/blob/5b0dc991093c82824f6fe566af947f64f5072264/sys/sys/pipe.h#L33
+ echo 65536
+ else
+ cat /proc/sys/fs/pipe-max-size
+ fi
+}
+
+# Return a space-separated string of online CPU IDs, based on
+# /sys/devices/system/cpu/online, or from 0 to nproc - 1 otherwise.
+function get_online_cpus()
+{
+ local cpus=()
+ local range_re
+ if [ -f /sys/devices/system/cpu/online ]; then
+ range_re='([0-9]+)-([0-9]+)'
+ while read -r range ; do
+ if [[ "${range}" =~ ${range_re} ]] ; then
+ mapfile -t -O "${#cpus[*]}" cpus <<< $(seq "${BASH_REMATCH[1]}" "${BASH_REMATCH[2]}")
+ else
+ cpus+=("${range}")
+ fi
+ done < <(tr ',' $'\n' < /sys/devices/system/cpu/online)
+ else
+ read -r -a cpus <<< $(seq 0 $(( $(conf_proc_count) - 1 )) )
+ fi
+ echo "${cpus[*]}"
+}
+
+# Helpers for get_possible_cpus.
+function get_possible_cpus_count_from_sysfs_possible_mask()
+{
+ local max_possible_cpu_id
+
+ # The Awk script extracts the highest CPU id from the possible CPU
+ # mask. Assuming a numerical order, a field separator '-' and a record
+ # separator ','. The last value parsed is the highest id.
+ if [ -f /sys/devices/system/cpu/possible ]; then
+ max_possible_cpu_id=$(awk -F '-' 'BEGIN { RS = ","} { last = $NF } END { printf("%d\n", last) }' \
+ /sys/devices/system/cpu/possible)
+ echo "$((max_possible_cpu_id+1))"
+ else
+ echo "0"
+ fi
+}
+
+# This is a fallback if the possible CPU mask is not available. This will not
+# take into account unplugged CPUs.
+function get_max_cpus_count_from_sysfs_cpu_directories()
+{
+ local max_possible_cpu_id=0
+ local current_cpu_id
+
+ for i in /sys/devices/system/cpu/cpu[0-9]*; do
+ current_cpu_id="${i#/sys/devices/system/cpu/cpu}"
+ if [ "$current_cpu_id" -gt "$max_possible_cpu_id" ]; then
+ max_possible_cpu_id="$current_cpu_id"
+ fi
+ done
+
+ echo "$((max_possible_cpu_id+1))"
+}
+
+# Return the number of possible CPUs.
+function get_possible_cpus_count()
+{
+ local possible_cpus_count
+ possible_cpus_count=$(get_possible_cpus_count_from_sysfs_possible_mask)
+
+ if [ "$possible_cpus_count" -eq "0" ]; then
+ local configured_cpus_count
+ configured_cpus_count=$(getconf _NPROCESSORS_CONF)
+ possible_cpus_count=$(get_max_cpus_count_from_sysfs_cpu_directories)
+ possible_cpus_count=$((configured_cpus_count > possible_cpus_count \
+ ? configured_cpus_count \
+ : possible_cpus_count))
+ fi
+
+ echo "$possible_cpus_count"
+}
+
+# Return the list of exposed CPU.
+#
+# NOTE! Use it like so:
+#
+# IFS=" " read -r -a VARIABLE <<< "$(get_exposed_cpus_list)"
+function get_exposed_cpus_list()
+{
+ local list=()
+
+ for i in /sys/devices/system/cpu/cpu[0-9]*; do
+ list+=("${i#/sys/devices/system/cpu/cpu}")
+ done
+
+ echo "${list[@]}"
+}
+
+# Return any available CPU found. Do not make assumption about the returned
+# value, e.g. that it could be 0.
+function get_any_available_cpu()
+{
+ for cpu in $(get_online_cpus); do
+ echo "${cpu}"
+ break;
+ done
+}
+
# Return the number of _configured_ CPUs.
function conf_proc_count()
{
echo
}
+# Usage:
+# check_skip_kernel_test [NB_TESTS] [SKIP_MESSAGE]
+# Return 0 if LTTNG_TOOLS_DISABLE_KERNEL_TESTS was set or the current user is not a root user
+# If NB_TESTS is set, call skip() to skip number of tests.
+# If NB_TESTS is empty, just output a reason with diag.
+# An optional message can be added.
+
+function check_skip_kernel_test ()
+{
+ local num_tests="$1"
+ local skip_message="$2"
+
+ # Check for skip test kernel flag
+ if [ "$LTTNG_TOOLS_DISABLE_KERNEL_TESTS" == "1" ]; then
+ if ! test -z "$num_tests"; then
+ skip 0 "LTTNG_TOOLS_DISABLE_KERNEL_TESTS was set.${skip_message+ }${skip_message}" "$num_tests"
+ else
+ diag "LTTNG_TOOLS_DISABLE_KERNEL_TESTS was set.${skip_message+ }${skip_message}"
+ fi
+ return 0
+ fi
+
+ # Check if we are running as root
+ if [ "$(id -u)" != "0" ]; then
+ if ! test -z "$num_tests"; then
+ skip 0 "Root access is needed for kernel testing.${skip_message+ }${skip_message}" "$num_tests"
+ else
+ diag "Root access is needed for kernel testing.${skip_message+ }${skip_message}"
+ fi
+ return 0
+ fi
+
+ return 1
+}
+
# Check if base lttng-modules are present.
# Bail out on failure
function validate_lttng_modules_present ()
fi
# Check for builtin modules.
- ls /proc/lttng > /dev/null 2>&1
+ ls /proc/lttng >/dev/null 2>&1
if [ $? -eq 0 ]; then
return 0
fi
LTTNG_BAIL_OUT "LTTng modules not detected."
}
+# Run the babeltrace binary
+function _run_babeltrace_cmd ()
+{
+ local err_log
+ local opts
+
+ err_log="$(lttng_log_file babeltrace.err)"
+
+ opts=("${@}")
+ if [[ -n "${LTTNG_TEST_VERBOSE_BABELTRACE}" ]]; then
+ opts=('-l' "${LTTNG_TEST_BABELTRACE_VERBOSITY}" "${opts[@]}")
+ fi
+
+ diag "${BABELTRACE_BIN} ${opts[*]} # Error log: '${err_log:-N/A}'" >&2
+ if [[ -n "${err_log}" ]]; then
+ "${BABELTRACE_BIN}" "${opts[@]}" 2>"${err_log}"
+ else
+ "${BABELTRACE_BIN}" "${opts[@]}"
+ fi
+}
+
# Run the lttng binary.
#
# The first two arguments are stdout and stderr redirect paths, respectively.
local stderr_dest="$2"
shift 2
- diag "$TESTDIR/../src/bin/lttng/$LTTNG_BIN $*"
- $TESTDIR/../src/bin/lttng/$LTTNG_BIN "$@" 1> "$stdout_dest" 2> "$stderr_dest"
+ opts=("${@}")
+ if [[ -n "${LTTNG_TEST_VERBOSE_CLIENT}" ]] ; then
+ opts=('-vvv' "${opts[@]}")
+ fi
+
+ diag "$TESTDIR/../src/bin/lttng/$LTTNG_BIN ${opts[*]}"
+ if [[ -n "${stdout_dest}" ]] && [[ -n "${stderr_dest}" ]] ; then
+ $TESTDIR/../src/bin/lttng/$LTTNG_BIN "${opts[@]}" >"${stdout_dest}" 2>"${stderr_dest}"
+ elif [[ -n "${stdout_dest}" ]] && [[ -z "${stderr_dest}" ]]; then
+ $TESTDIR/../src/bin/lttng/$LTTNG_BIN "${opts[@]}" >"${stdout_dest}"
+ elif [[ -z "${stdout_dest}" ]] && [[ -n "${stderr_dest}" ]] ; then
+ $TESTDIR/../src/bin/lttng/$LTTNG_BIN "${opts[@]}" 2>"${stderr_dest}"
+ else
+ $TESTDIR/../src/bin/lttng/$LTTNG_BIN "${opts[@]}"
+ fi
}
function enable_kernel_lttng_event
chan="-c $channel_name"
fi
- _run_lttng_cmd "$OUTPUT_DEST" "$ERROR_OUTPUT_DEST" \
+ _run_lttng_cmd "$(lttng_client_log_file)" "$(lttng_client_err_file)" \
enable-event "$event_name" $chan -s $sess_name -k
ret=$?
if [[ $expected_to_fail -eq "1" ]]; then
chan="-c $channel_name"
fi
- _run_lttng_cmd "$OUTPUT_DEST" "$ERROR_OUTPUT_DEST" \
+ _run_lttng_cmd "$(lttng_client_log_file)" "$(lttng_client_err_file)" \
enable-event --syscall "$syscall_name" $chan -s $sess_name -k
ret=$?
if [[ $expected_to_fail -eq "1" ]]; then
chan="-c $channel_name"
fi
- _run_lttng_cmd "$OUTPUT_DEST" "$ERROR_OUTPUT_DEST" \
+ _run_lttng_cmd "$(lttng_client_log_file)" "$(lttng_client_err_file)" \
disable-event --syscall "$syscall_name" $chan -s $sess_name -k
ret=$?
local target="$3"
local event_name="$4"
- "$TESTDIR/../src/bin/lttng/$LTTNG_BIN" enable-event --kernel --function="$target" "$event_name" -s "$sess_name" > "$OUTPUT_DEST" 2> "$ERROR_OUTPUT_DEST"
+ "$TESTDIR/../src/bin/lttng/$LTTNG_BIN" enable-event --kernel --function="$target" "$event_name" -s "$sess_name" >"$(lttng_client_log_file)" 2>"$(lttng_client_err_file)"
ret=$?
if [[ $expected_to_fail -eq "1" ]]; then
test $ret -ne "0"
local target="$3"
local event_name="$4"
- "$TESTDIR/../src/bin/lttng/$LTTNG_BIN" enable-event --kernel --userspace-probe="$target" "$event_name" -s "$sess_name" > "$OUTPUT_DEST" 2> "$ERROR_OUTPUT_DEST"
+ "$TESTDIR/../src/bin/lttng/$LTTNG_BIN" enable-event --kernel --userspace-probe="$target" "$event_name" -s "$sess_name" >"$(lttng_client_log_file)" 2>"$(lttng_client_err_file)"
ret=$?
if [[ $expected_to_fail -eq "1" ]]; then
test $ret -ne "0"
local sess_name="$1"
local event_name="$2"
- "$TESTDIR/../src/bin/lttng/$LTTNG_BIN" disable-event --kernel "$event_name" -s "$sess_name" > "$OUTPUT_DEST" 2> "$ERROR_OUTPUT_DEST"
+ "$TESTDIR/../src/bin/lttng/$LTTNG_BIN" disable-event --kernel "$event_name" -s "$sess_name" >"$(lttng_client_log_file)" 2>"$(lttng_client_err_file)"
ok $? "Disable kernel event $target for session $sess_name"
}
function lttng_enable_kernel_channel()
local channel_name=$4
local opts="${@:5}"
- _run_lttng_cmd "$OUTPUT_DEST" "$ERROR_OUTPUT_DEST" \
+ _run_lttng_cmd "$(lttng_client_log_file)" "$(lttng_client_err_file)" \
enable-channel -k $channel_name -s $sess_name $opts
ret=$?
if [[ $expected_to_fail -eq "1" ]]; then
local sess_name=$2
local channel_name=$3
- _run_lttng_cmd "$OUTPUT_DEST" "$ERROR_OUTPUT_DEST" \
+ _run_lttng_cmd "$(lttng_client_log_file)" "$(lttng_client_err_file)" \
disable-channel -k $channel_name -s $sess_name
ret=$?
if [[ $expected_to_fail -eq "1" ]]; then
{
local withtap=$1
local process_mode=$2
- local opt=$3
+ shift 2 || true
+ # This is intentionally not quoted inside the array so something like '-o /tmp/x' is split
+ # shellcheck disable=SC2206
+ local opts=(${@})
+ local log_file="${RELAYD_ERROR_OUTPUT_DEST:-$(lttng_log_file relayd)}"
DIR=$(readlink -f "$TESTDIR")
+ if [[ -n "${LTTNG_TEST_VERBOSE_RELAYD}" ]] ; then
+ opts+=('-vvv')
+ fi
+
+ if [[ -n "${log_file}" ]] ; then
+ diag "Relayd log file: ${log_file}"
+ fi
+
if [ -z $(lttng_pgrep "$RELAYD_MATCH") ]; then
# shellcheck disable=SC2086
- $DIR/../src/bin/lttng-relayd/$RELAYD_BIN $process_mode $opt 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST
- #$DIR/../src/bin/lttng-relayd/$RELAYD_BIN $opt -vvv >>/tmp/relayd.log 2>&1 &
- if [ $? -eq 1 ]; then
- if [ $withtap -eq "1" ]; then
- fail "Start lttng-relayd (process mode: $process_mode opt: $opt)"
- fi
- return 1
+ if [[ -n "${log_file}" ]]; then
+ $DIR/../src/bin/lttng-relayd/$RELAYD_BIN $process_mode "${opts[@]}" >"${log_file}" 2>&1
else
- if [ $withtap -eq "1" ]; then
- pass "Start lttng-relayd (process mode: $process_mode opt: $opt)"
- fi
+ $DIR/../src/bin/lttng-relayd/$RELAYD_BIN $process_mode "${opts[@]}"
+ fi
+ local ret="${?}"
+ if [ $withtap -eq "1" ]; then
+ ok $ret "Start lttng-relayd (process mode: $process_mode opt: ${opts[*]})"
+ else
+ return $ret
fi
else
- pass "Start lttng-relayd (opt: $opt)"
+ pass "Start lttng-relayd (opt: ${opts[*]})"
fi
}
# Multiply time by 2 to simplify integer arithmetic
+ # Multiply time by 5 to adjust for sleeping every 0.1s
if [ -n "$timeout_s" ]; then
- dtimeleft_s=$((timeout_s * 2))
+ dtimeleft_s=$((timeout_s * 2 * 5))
fi
diag "Killing (signal $signal) lttng-relayd (pid: $pids)"
# shellcheck disable=SC2086
- if ! kill -s $signal $pids 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST; then
+ if ! kill -s $signal $pids; then
retval=1
if [ "$withtap" -eq "1" ]; then
fail "Kill relay daemon"
fi
dtimeleft_s=$((dtimeleft_s - 1))
fi
- sleep 0.5
+ sleep 0.1
done
if [ "$withtap" -eq "1" ]; then
if [ "$retval" -eq "0" ]; then
# The rest of the arguments will be passed directly to lttng-sessiond.
shift 2
+ local opts=("${@}")
+ local log_file="$(lttng_log_file sessiond)"
local env_vars=""
local consumerd=""
return
fi
+ if [[ -n "${LTTNG_TEST_VERBOSE_SESSIOND}" ]]; then
+ opts+=(
+ '-vvv'
+ '--verbose-consumer'
+ )
+ fi
+
DIR=$(readlink -f "$TESTDIR")
# Get long_bit value for 32/64 consumerd
env_vars="${env_vars}$DIR/../src/bin/lttng-sessiond/$SESSIOND_BIN"
if ! validate_kernel_version; then
- fail "Start session daemon"
- LTTNG_BAIL_OUT "*** Kernel too old for session daemon tests ***"
+ fail "Start session daemon"
+ LTTNG_BAIL_OUT "*** Kernel too old for session daemon tests ***"
fi
diag "export LTTNG_SESSION_CONFIG_XSD_PATH=${DIR}/../src/common/"
if [ -z "$(lttng_pgrep "${SESSIOND_MATCH}")" ]; then
# Have a load path ?
if [ -n "$load_path" ]; then
- diag "env $env_vars --load $load_path --background $consumerd $@"
- # shellcheck disable=SC2086
- env $env_vars --load "$load_path" --background "$consumerd" "$@"
+ diag "env $env_vars --load $load_path --background $consumerd ${opts[*]}"
+ if [[ -n "${log_file}" ]]; then
+ # shellcheck disable=SC2086
+ env $env_vars --load "$load_path" --background "$consumerd" "${opts[@]}" >"${log_file}" 2>&1
+ else
+ # shellcheck disable=SC2086
+ env $env_vars --load "$load_path" --background "$consumerd" "${opts[@]}"
+ fi
else
- diag "env $env_vars --background $consumerd $@"
- # shellcheck disable=SC2086
- env $env_vars --background "$consumerd" "$@"
+ diag "env $env_vars --background $consumerd ${opts[*]}"
+ if [[ -n "${log_file}" ]]; then
+ # shellcheck disable=SC2086
+ env $env_vars --background "$consumerd" "${opts[@]}" >"${log_file}" 2>&1
+ else
+ # shellcheck disable=SC2086
+ env $env_vars --background "$consumerd" "${opts[@]}"
+ fi
fi
- #$DIR/../src/bin/lttng-sessiond/$SESSIOND_BIN --background --consumerd32-path="$DIR/../src/bin/lttng-consumerd/lttng-consumerd" --consumerd64-path="$DIR/../src/bin/lttng-consumerd/lttng-consumerd" --verbose-consumer >>/tmp/sessiond.log 2>&1
status=$?
if [ "$withtap" -eq "1" ]; then
ok $status "Start session daemon"
fi
# Multiply time by 2 to simplify integer arithmetic
+ # Multiply time by 5 to adjust for sleeping every 0.1s
if [ -n "$timeout_s" ]; then
- dtimeleft_s=$((timeout_s * 2))
+ dtimeleft_s=$((timeout_s * 2 * 5))
fi
if [ -n "$TEST_NO_SESSIOND" ] && [ "$TEST_NO_SESSIOND" == "1" ]; then
diag "Killing (signal $signal) $SESSIOND_BIN and lt-$SESSIOND_BIN pids: $(echo "$pids" | tr '\n' ' ')"
# shellcheck disable=SC2086
- if ! kill -s $signal $pids 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST; then
+ if ! kill -s $signal $pids; then
retval=1
if [ "$withtap" -eq "1" ]; then
fail "Kill sessions daemon"
fi
dtimeleft_s=$((dtimeleft_s - 1))
fi
- sleep 0.5
+ sleep 0.1
done
out=1
while [ -n "$out" ]; do
fi
dtimeleft_s=$((dtimeleft_s - 1))
fi
- sleep 0.5
+ sleep 0.1
done
if [ "$withtap" -eq "1" ]; then
fi
# shellcheck disable=SC2086
- if ! kill -s $signal $pids 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST; then
+ if ! kill -s $signal $pids; then
if [ "$withtap" -eq "1" ]; then
fail "Sending SIGSTOP to session daemon"
fi
fi
# Multiply time by 2 to simplify integer arithmetic
+ # Multiply time by 5 to adjust for sleeping every 0.1s
if [ -n "$timeout_s" ]; then
- dtimeleft_s=$((timeout_s * 2))
+ dtimeleft_s=$((timeout_s * 2 * 5))
fi
pids="$(lttng_pgrep "$CONSUMERD_MATCH")"
diag "Killing (signal $signal) $CONSUMERD_BIN pids: $(echo "$pids" | tr '\n' ' ')"
# shellcheck disable=SC2086
- if ! kill -s $signal $pids 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST; then
+ if ! kill -s $signal $pids; then
retval=1
if [ "$withtap" -eq "1" ]; then
fail "Kill consumer daemon"
fi
dtimeleft_s=$((dtimeleft_s - 1))
fi
- sleep 0.5
+ sleep 0.1
done
if [ "$withtap" -eq "1" ]; then
if [ "$retval" -eq "0" ]; then
diag "Sending SIGSTOP to $CONSUMERD_BIN pids: $(echo "$pids" | tr '\n' ' ')"
# shellcheck disable=SC2086
- kill -s $signal $pids 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST
+ kill -s $signal $pids
retval=$?
if [ $retval -eq 1 ]; then
local withtap=$1
shift
local opts=$1
- _run_lttng_cmd "$OUTPUT_DEST" "$ERROR_OUTPUT_DEST" \
+ _run_lttng_cmd "$(lttng_client_log_file)" "$(lttng_client_err_file)" \
list $opts
ret=$?
if [ $withtap -eq "1" ]; then
local sess_name=$1
local opts="${@:2}"
- _run_lttng_cmd "$OUTPUT_DEST" "$ERROR_OUTPUT_DEST" \
+ _run_lttng_cmd "$(lttng_client_log_file)" "$(lttng_client_err_file)" \
create $sess_name --no-output $opts
ok $? "Create session $sess_name in no-output mode"
}
local uri=$2
local opts="${@:3}"
- _run_lttng_cmd "$OUTPUT_DEST" "$ERROR_OUTPUT_DEST" \
+ _run_lttng_cmd "$(lttng_client_log_file)" "$(lttng_client_err_file)" \
create $sess_name -U $uri $opts
ok $? "Create session $sess_name with uri:$uri and opts: $opts"
}
trace_path="-o $trace_path"
fi
- _run_lttng_cmd "$OUTPUT_DEST" "$ERROR_OUTPUT_DEST" \
+ _run_lttng_cmd "$(lttng_client_log_file)" "$(lttng_client_err_file)" \
create "$sess_name" $trace_path $opt
ret=$?
if [ $expected_to_fail -eq "1" ]; then
local channel_name=$4
local opts="${@:5}"
- _run_lttng_cmd "$OUTPUT_DEST" "$ERROR_OUTPUT_DEST" \
+ _run_lttng_cmd "$(lttng_client_log_file)" "$(lttng_client_err_file)" \
enable-channel -u $channel_name -s $sess_name $opts
ret=$?
if [[ $expected_to_fail -eq "1" ]]; then
local sess_name=$1
local channel_name=$2
- _run_lttng_cmd "$OUTPUT_DEST" "$ERROR_OUTPUT_DEST" \
+ _run_lttng_cmd "$(lttng_client_log_file)" "$(lttng_client_err_file)" \
disable-channel -u $channel_name -s $sess_name
ok $? "Disable channel $channel_name for session $sess_name"
}
local sess_name=$1
local channel_name=$2
- _run_lttng_cmd "$OUTPUT_DEST" "$ERROR_OUTPUT_DEST" \
+ _run_lttng_cmd "$(lttng_client_log_file)" "$(lttng_client_err_file)" \
enable-channel -s $sess_name $channel_name -k --output mmap --overwrite
ok $? "Enable channel $channel_name for session $sess_name"
}
local sess_name=$1
local channel_name=$2
- _run_lttng_cmd "$OUTPUT_DEST" "$ERROR_OUTPUT_DEST" \
+ _run_lttng_cmd "$(lttng_client_log_file)" "$(lttng_client_err_file)" \
enable-channel -s $sess_name $channel_name -k --output mmap --discard --subbuf-size=$(getconf PAGE_SIZE) --num-subbuf=2
ok $? "Enable small discard channel $channel_name for session $sess_name"
}
local sess_name=$1
local channel_name=$2
- _run_lttng_cmd "$OUTPUT_DEST" "$ERROR_OUTPUT_DEST" \
+ _run_lttng_cmd "$(lttng_client_log_file)" "$(lttng_client_err_file)" \
enable-channel -s $sess_name $channel_name -k --output mmap --overwrite --subbuf-size=$(getconf PAGE_SIZE) --num-subbuf=2
- ok $? "Enable small discard channel $channel_name for session $sess_name"
+ ok $? "Enable small overwrite channel $channel_name for session $sess_name"
}
function enable_lttng_mmap_overwrite_ust_channel()
local sess_name=$1
local channel_name=$2
- _run_lttng_cmd "$OUTPUT_DEST" "$ERROR_OUTPUT_DEST" \
+ _run_lttng_cmd "$(lttng_client_log_file)" "$(lttng_client_err_file)" \
enable-channel -s $sess_name $channel_name -u --output mmap --overwrite
ok $? "Enable channel $channel_name for session $sess_name"
}
chan="-c $channel_name"
fi
- _run_lttng_cmd "$OUTPUT_DEST" "$ERROR_OUTPUT_DEST" \
+ _run_lttng_cmd "$(lttng_client_log_file)" "$(lttng_client_err_file)" \
enable-event "$event_name" $chan -s "$sess_name" -u
ret=$?
if [[ $expected_to_fail -eq "1" ]]; then
chan="-c $channel_name"
fi
- _run_lttng_cmd "$OUTPUT_DEST" "$ERROR_OUTPUT_DEST" \
+ _run_lttng_cmd "$(lttng_client_log_file)" "$(lttng_client_err_file)" \
enable-event "$event_name" $chan -s $sess_name -j
ok $? "Enable JUL event $event_name for session $sess_name"
}
chan="-c $channel_name"
fi
- _run_lttng_cmd "$OUTPUT_DEST" "$ERROR_OUTPUT_DEST" \
+ _run_lttng_cmd "$(lttng_client_log_file)" "$(lttng_client_err_file)" \
enable-event --loglevel $loglevel "$event_name" $chan -s $sess_name -j
ok $? "Enable JUL event $event_name for session $sess_name with loglevel $loglevel"
}
chan_opt=("-c" "$channel_name")
fi
- _run_lttng_cmd "$OUTPUT_DEST" "$ERROR_OUTPUT_DEST" \
+ _run_lttng_cmd "$(lttng_client_log_file)" "$(lttng_client_err_file)" \
enable-event "$event_name" "${chan_opt[@]}" -s "$sess_name" --log4j
ok $? "Enable LOG4J event '$event_name' for session '$sess_name'"
}
local event_name=$2
local filter=$3
- _run_lttng_cmd "$OUTPUT_DEST" "$ERROR_OUTPUT_DEST" \
+ _run_lttng_cmd "$(lttng_client_log_file)" "$(lttng_client_err_file)" \
enable-event "$event_name" -s "$sess_name" --log4j --filter "$filter"
ok $? "Enable LOG4J event '$event_name' with filter '$filter' for session '$sess_name'"
}
local filter=$3
local loglevel=$4
- _run_lttng_cmd "$OUTPUT_DEST" "$ERROR_OUTPUT_DEST" \
+ _run_lttng_cmd "$(lttng_client_log_file)" "$(lttng_client_err_file)" \
enable-event --loglevel-only "$loglevel" "$event_name" -s "$sess_name" -l --filter "$filter"
ok $? "Enable LOG4J event '$event_name' with filter '$filter' and loglevel-only '$loglevel' for session '$sess_name'"
}
chan_opt=("-c" "$channel_name")
fi
- _run_lttng_cmd "$OUTPUT_DEST" "$ERROR_OUTPUT_DEST" \
+ _run_lttng_cmd "$(lttng_client_log_file)" "$(lttng_client_err_file)" \
enable-event --loglevel "$loglevel" "$event_name" "${chan_opt[@]}" -s "$sess_name" --log4j
ok $? "Enable LOG4J event '$event_name' for session '$sess_name' with loglevel '$loglevel'"
}
chan_opt=("-c" "$channel_name")
fi
- _run_lttng_cmd "$OUTPUT_DEST" "$ERROR_OUTPUT_DEST" \
+ _run_lttng_cmd "$(lttng_client_log_file)" "$(lttng_client_err_file)" \
enable-event --loglevel-only "$loglevel" "$event_name" "${chan_opt[@]}" -s "$sess_name" --log4j
ok $? "Enable LOG4J event '$event_name' for session '$sess_name' with loglevel-only '$loglevel'"
}
+function enable_log4j2_lttng_event()
+{
+ local sess_name=$1
+ local event_name=$2
+ local channel_name=$3
+
+ local chan_opt=()
+
+ # default channel if none specified
+ if [ -n "$channel_name" ]; then
+ chan_opt=("-c" "$channel_name")
+ fi
+
+ _run_lttng_cmd "$OUTPUT_DEST" "$ERROR_OUTPUT_DEST" \
+ enable-event "$event_name" "${chan_opt[@]}" -s "$sess_name" --log4j2
+ ok $? "Enable LOG4J2 event '$event_name' for session '$sess_name'"
+}
+
+function enable_log4j2_lttng_event_filter()
+{
+ local sess_name=$1
+ local event_name=$2
+ local filter=$3
+
+ _run_lttng_cmd "$OUTPUT_DEST" "$ERROR_OUTPUT_DEST" \
+ enable-event "$event_name" -s "$sess_name" --log4j2 --filter "$filter"
+ ok $? "Enable LOG4J2 event '$event_name' with filter '$filter' for session '$sess_name'"
+}
+
+function enable_log4j2_lttng_event_filter_loglevel_only()
+{
+ local sess_name=$1
+ local event_name=$2
+ local filter=$3
+ local loglevel=$4
+
+ _run_lttng_cmd "$OUTPUT_DEST" "$ERROR_OUTPUT_DEST" \
+ enable-event --loglevel-only "$loglevel" "$event_name" -s "$sess_name" --log4j2 --filter "$filter"
+ ok $? "Enable LOG4J2 event '$event_name' with filter '$filter' and loglevel-only '$loglevel' for session '$sess_name'"
+}
+
+function enable_log4j2_lttng_event_loglevel()
+{
+ local sess_name=$1
+ local event_name=$2
+ local loglevel=$3
+ local channel_name=$4
+
+ local chan_opt=()
+
+ # default channel if none specified
+ if [ -n "$channel_name" ]; then
+ chan_opt=("-c" "$channel_name")
+ fi
+
+ _run_lttng_cmd "$OUTPUT_DEST" "$ERROR_OUTPUT_DEST" \
+ enable-event --loglevel "$loglevel" "$event_name" "${chan_opt[@]}" -s "$sess_name" --log4j2
+ ok $? "Enable LOG4J2 event '$event_name' for session '$sess_name' with loglevel '$loglevel'"
+}
+
+function enable_log4j2_lttng_event_loglevel_only()
+{
+ local sess_name=$1
+ local event_name=$2
+ local loglevel=$3
+ local channel_name=$4
+
+ local chan_opt=()
+
+ # default channel if none specified
+ if [ -n "$channel_name" ]; then
+ chan_opt=("-c" "$channel_name")
+ fi
+
+ _run_lttng_cmd "$OUTPUT_DEST" "$ERROR_OUTPUT_DEST" \
+ enable-event --loglevel-only "$loglevel" "$event_name" "${chan_opt[@]}" -s "$sess_name" --log4j2
+ ok $? "Enable LOG4J2 event '$event_name' for session '$sess_name' with loglevel-only '$loglevel'"
+}
+
function enable_python_lttng_event()
{
sess_name=$1
chan="-c $channel_name"
fi
- _run_lttng_cmd "$OUTPUT_DEST" "$ERROR_OUTPUT_DEST" \
+ _run_lttng_cmd "$(lttng_client_log_file)" "$(lttng_client_err_file)" \
enable-event "$event_name" $chan -s $sess_name -p
ok $? "Enable Python event $event_name for session $sess_name"
}
chan="-c $channel_name"
fi
- _run_lttng_cmd "$OUTPUT_DEST" "$ERROR_OUTPUT_DEST" \
+ _run_lttng_cmd "$(lttng_client_log_file)" "$(lttng_client_err_file)" \
enable-event --loglevel $loglevel "$event_name" $chan -s $sess_name -p
ok $? "Enable Python event $event_name for session $sess_name with loglevel $loglevel"
}
chan="-c $channel_name"
fi
- _run_lttng_cmd "$OUTPUT_DEST" "$ERROR_OUTPUT_DEST" \
+ _run_lttng_cmd "$(lttng_client_log_file)" "$(lttng_client_err_file)" \
enable-event $chan "$event_name" -s $sess_name -u --filter "$filter"
ok $? "Enable event $event_name with filtering for session $sess_name"
}
local sess_name="$1"
local event_name="$2"
local loglevel="$3"
+ local channel_name="$4"
+ local chan=()
+ if [ -n "${channel_name}" ] ; then
+ chan=('-c' "${channel_name}")
+ fi
- _run_lttng_cmd "$OUTPUT_DEST" "$ERROR_OUTPUT_DEST" \
- enable-event "$event_name" -s $sess_name -u --loglevel $loglevel
+ _run_lttng_cmd "$(lttng_client_log_file)" "$(lttng_client_err_file)" \
+ enable-event "${chan[@]}" "$event_name" -s "${sess_name}" -u --loglevel="${loglevel}"
ok $? "Enable event $event_name with loglevel $loglevel"
}
local sess_name="$1"
local event_name="$2"
local loglevel="$3"
+ local channel_name="$4"
+ local chan=()
+ if [ -n "${channel_name}" ] ; then
+ chan=('-c' "${channel_name}")
+ fi
- _run_lttng_cmd "$OUTPUT_DEST" "$ERROR_OUTPUT_DEST" \
- enable-event "$event_name" -s $sess_name -u --loglevel-only $loglevel
+ _run_lttng_cmd "$(lttng_client_log_file)" "$(lttng_client_err_file)" \
+ enable-event "${chan[@]}" "$event_name" -s "${sess_name}" -u --loglevel-only "${loglevel}"
ok $? "Enable event $event_name with loglevel-only $loglevel"
}
chan="-c $channel_name"
fi
- _run_lttng_cmd "$OUTPUT_DEST" "$ERROR_OUTPUT_DEST" \
+ _run_lttng_cmd "$(lttng_client_log_file)" "$(lttng_client_err_file)" \
disable-event "$event_name" -s $sess_name $chan -u
ok $? "Disable event $event_name for session $sess_name"
}
local sess_name="$1"
local event_name="$2"
- _run_lttng_cmd "$OUTPUT_DEST" "$ERROR_OUTPUT_DEST" \
+ _run_lttng_cmd "$(lttng_client_log_file)" "$(lttng_client_err_file)" \
disable-event "$event_name" -s "$sess_name" --log4j
ok $? "Disable LOG4J event '$event_name' for session '$sess_name'"
}
+function disable_log4j2_lttng_event ()
+{
+ local sess_name=$1
+ local event_name=$2
+
+ _run_lttng_cmd "$OUTPUT_DEST" "$ERROR_OUTPUT_DEST" \
+ disable-event "$event_name" -s "$sess_name" --log4j2
+ ok $? "Disable LOG4J2 event '$event_name' for session '$sess_name'"
+}
+
function disable_python_lttng_event ()
{
local sess_name="$1"
local event_name="$2"
- _run_lttng_cmd "$OUTPUT_DEST" "$ERROR_OUTPUT_DEST" \
+ _run_lttng_cmd "$(lttng_client_log_file)" "$(lttng_client_err_file)" \
disable-event "$event_name" -s $sess_name -p
ok $? "Disable Python event $event_name for session $sess_name"
}
local expected_to_fail=$2
local sess_name=$3
- _run_lttng_cmd "$OUTPUT_DEST" "$ERROR_OUTPUT_DEST" \
+ _run_lttng_cmd "$(lttng_client_log_file)" "$(lttng_client_err_file)" \
start $sess_name
ret=$?
if [[ $expected_to_fail -eq "1" ]]; then
local expected_to_fail=$2
local sess_name=$3
- _run_lttng_cmd "$OUTPUT_DEST" "$ERROR_OUTPUT_DEST" \
+ _run_lttng_cmd "$(lttng_client_log_file)" "$(lttng_client_err_file)" \
stop $sess_name
ret=$?
if [[ $expected_to_fail -eq "1" ]]; then
local withtap=$1
local expected_to_fail=$2
local sess_name=$3
+ shift 3
- _run_lttng_cmd "$OUTPUT_DEST" "$ERROR_OUTPUT_DEST" \
- destroy $sess_name
+ _run_lttng_cmd "$(lttng_client_log_file)" "$(lttng_client_err_file)" \
+ destroy $sess_name $@
ret=$?
if [[ $expected_to_fail -eq "1" ]]; then
test "$ret" -ne "0"
function destroy_lttng_sessions ()
{
- _run_lttng_cmd "$OUTPUT_DEST" "$ERROR_OUTPUT_DEST" \
+ _run_lttng_cmd "$(lttng_client_log_file)" "$(lttng_client_err_file)" \
destroy --all
ok $? "Destroy all lttng sessions"
}
local trace_path=$3
local opts=$4
- _run_lttng_cmd "$OUTPUT_DEST" "$ERROR_OUTPUT_DEST" \
+ _run_lttng_cmd "$(lttng_client_log_file)" "$(lttng_client_err_file)" \
snapshot add-output -s $sess_name $trace_path $opts
ret=$?
if [[ $expected_to_fail -eq 1 ]]; then
local sess_name=$2
local id=$3
- _run_lttng_cmd "$OUTPUT_DEST" "$ERROR_OUTPUT_DEST" \
+ _run_lttng_cmd "$(lttng_client_log_file)" "$(lttng_client_err_file)" \
snapshot del-output -s $sess_name $id
ret=$?
if [[ $expected_to_fail -eq "1" ]]; then
local sess_name=$1
local trace_path=$2
- _run_lttng_cmd "$OUTPUT_DEST" "$ERROR_OUTPUT_DEST" \
+ _run_lttng_cmd "$(lttng_client_log_file)" "$(lttng_client_err_file)" \
snapshot record -s "$sess_name" "$trace_path"
ok $? "Snapshot recorded"
}
function lttng_snapshot_list ()
{
local sess_name=$1
- _run_lttng_cmd "$OUTPUT_DEST" "$ERROR_OUTPUT_DEST" \
+ _run_lttng_cmd "$(lttng_client_log_file)" "$(lttng_client_err_file)" \
snapshot list-output -s $sess_name
ok $? "Snapshot list"
}
local sess_name=$1
local opts=$2
- _run_lttng_cmd "$OUTPUT_DEST" "$ERROR_OUTPUT_DEST" \
+ _run_lttng_cmd "$(lttng_client_log_file)" "$(lttng_client_err_file)" \
save $sess_name $opts
ok $? "Session saved"
}
local expected_to_fail=$1
local opts=$2
- _run_lttng_cmd "$OUTPUT_DEST" "$ERROR_OUTPUT_DEST" \
+ _run_lttng_cmd "$(lttng_client_log_file)" "$(lttng_client_err_file)" \
load $opts
ret=$?
if [[ $expected_to_fail -eq "1" ]]; then
local expected_to_fail="$1"
shift 1
local opts="$@"
- $TESTDIR/../src/bin/lttng/$LTTNG_BIN track $opts >$OUTPUT_DEST
+ $TESTDIR/../src/bin/lttng/$LTTNG_BIN track $opts >"$(lttng_client_log_file)"
ret=$?
if [[ $expected_to_fail -eq "1" ]]; then
test $ret -ne "0"
local expected_to_fail="$1"
shift 1
local opts="$@"
- $TESTDIR/../src/bin/lttng/$LTTNG_BIN untrack $opts >$OUTPUT_DEST
+ $TESTDIR/../src/bin/lttng/$LTTNG_BIN untrack $opts >"$(lttng_client_log_file)"
ret=$?
if [[ $expected_to_fail -eq "1" ]]; then
test $ret -ne "0"
function lttng_track_pid_ok()
{
PID=$1
- "$TESTDIR/../src/bin/lttng/$LTTNG_BIN" track --kernel --pid=$PID 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST
+ "$TESTDIR/../src/bin/lttng/$LTTNG_BIN" track --kernel --pid=$PID 1>"$(lttng_client_log_file)" 2>"$(lttng_client_err_file)"
ok $? "Lttng track pid on the kernel domain"
}
function lttng_untrack_kernel_all_ok()
{
- "$TESTDIR/../src/bin/lttng/$LTTNG_BIN" untrack --kernel --pid --all 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST
+ "$TESTDIR/../src/bin/lttng/$LTTNG_BIN" untrack --kernel --pid --all 1>"$(lttng_client_log_file)" 2>"$(lttng_client_err_file)"
ok $? "Lttng untrack all pid on the kernel domain"
}
function lttng_add_context_list()
{
- _run_lttng_cmd "$OUTPUT_DEST" "$ERROR_OUTPUT_DEST" \
+ _run_lttng_cmd "$(lttng_client_log_file)" "$(lttng_client_err_file)" \
add-context --list
ret=$?
ok $ret "Context listing"
local channel_name="$4"
local type="$5"
- _run_lttng_cmd "$OUTPUT_DEST" "$ERROR_OUTPUT_DEST" \
+ _run_lttng_cmd "$(lttng_client_log_file)" "$(lttng_client_err_file)" \
add-context -s $session_name -c $channel_name -t $type $domain
ret=$?
if [[ $expected_to_fail -eq "1" ]]; then
diag "Waiting for live trace at url: $url"
while [ $zero_client_match -eq 0 ]; do
- zero_client_match=$($BABELTRACE_BIN -i lttng-live $url | grep "0 client(s) connected" | wc -l)
- sleep 0.5
+ zero_client_match=$(_run_babeltrace_cmd -i lttng-live $url | grep "0 client(s) connected" | wc -l)
+ sleep 0.1
done
pass "Waiting for live trace at url: $url"
}
diag "Waiting for live viewers on url: $url"
while [ $one_client_match -eq 0 ]; do
- one_client_match=$($BABELTRACE_BIN -i lttng-live $url | grep "1 client(s) connected" | wc -l)
- sleep 0.5
+ one_client_match=$(_run_babeltrace_cmd -i lttng-live $url | grep "1 client(s) connected" | wc -l)
+ sleep 0.1
done
pass "Waiting for live viewers on url: $url"
}
bail_out_if_no_babeltrace
- count=$($BABELTRACE_BIN --output-format=ctf-metadata "$metadata_path" | grep -c "$event_name")
+ count=$(_run_babeltrace_cmd --output-format=ctf-metadata "$metadata_path" | grep -c "$event_name")
test "$count" -eq "$expected"
ok $? "Found $count / $expected metadata event id matching '$event_name'"
bail_out_if_no_babeltrace
- count=$($BABELTRACE_BIN "$trace_path" | grep -c "$event_name")
- total=$($BABELTRACE_BIN "$trace_path" | wc -l)
+ count=$(_run_babeltrace_cmd "$trace_path" | grep -c "$event_name")
+ total=$(_run_babeltrace_cmd "$trace_path" | wc -l)
test "$count" -eq "$expected"
bail_out_if_no_babeltrace
- count=$($BABELTRACE_BIN "$trace_path" | grep -c "$event_name")
- total=$($BABELTRACE_BIN "$trace_path" | wc -l)
+ count=$(_run_babeltrace_cmd "$trace_path" | grep -c "$event_name")
+ total=$(_run_babeltrace_cmd "$trace_path" | wc -l)
test "$expected" -eq "$count" && test "$total" -eq "$expected"
IFS=","
for event_name in $event_names; do
# trace_path is unquoted since callers make use of globbing
- count=$($BABELTRACE_BIN $trace_path | grep -c "$event_name")
+ count=$(_run_babeltrace_cmd $trace_path | grep -c "$event_name")
test "$count" -gt 0
ok $? "Found $count events matching '$event_name'"
done
OLDIFS=$IFS
IFS=","
for event_name in $event_names; do
- count=$($BABELTRACE_BIN "$trace_path" | grep -c "$event_name")
+ count=$(_run_babeltrace_cmd "$trace_path" | grep -c "$event_name")
test "$count" -gt 0
ok $? "Found '$count' events matching '$event_name'"
total=$(( total + count ))
OLDIFS=$IFS
IFS=","
for event_name in $event_names; do
- count=$($BABELTRACE_BIN "$trace_path" | grep -c "$event_name")
+ count=$(_run_babeltrace_cmd "$trace_path" | grep -c "$event_name")
test "$count" -ge "$expected_min"
ok $? "Found $count events matching '$event_name', expected at least $expected_min"
total=$(( total + count ))
{
local trace_path=$1
- $BABELTRACE_BIN "$trace_path" | head -n 1
+ _run_babeltrace_cmd "$trace_path" | head -n 1
}
# Check that the trace contains at least 1 event matching the grep extended
bail_out_if_no_babeltrace
# event_exp is unquoted since it contains multiple grep arguments
- count=$($BABELTRACE_BIN "$trace_path" | grep -c --extended-regexp $event_exp)
+ count=$(_run_babeltrace_cmd "$trace_path" | grep -c --extended-regexp $event_exp)
test "$count" -gt 0
ok $? "Found $count events matching expression '$event_exp'"
}
bail_out_if_no_babeltrace
# event_exp is unquoted since it contains multiple grep arguments
- count=$($BABELTRACE_BIN "$trace_path" | grep -c --extended-regexp $event_exp)
- total=$($BABELTRACE_BIN "$trace_path" | wc -l)
+ count=$(_run_babeltrace_cmd "$trace_path" | grep -c --extended-regexp $event_exp)
+ total=$(_run_babeltrace_cmd "$trace_path" | wc -l)
test "$count" -gt 0 && test "$total" -eq "$count"
ok $? "Found $count events matching expression '$event_exp' amongst $total events"
bail_out_if_no_babeltrace
- events=$($BABELTRACE_BIN "$trace_path")
+ events=$(_run_babeltrace_cmd "$trace_path")
ret=$?
if [ $ret -ne 0 ]; then
fail "Failed to parse trace"
local expected_to_fail=$1
local sess_name=$2
- _run_lttng_cmd "$OUTPUT_DEST" "$ERROR_OUTPUT_DEST" \
+ _run_lttng_cmd "$(lttng_client_log_file)" "$(lttng_client_err_file)" \
regenerate metadata -s $sess_name
ret=$?
if [[ $expected_to_fail -eq "1" ]]; then
local expected_to_fail=$1
local sess_name=$2
- _run_lttng_cmd "$OUTPUT_DEST" "$ERROR_OUTPUT_DEST" \
+ _run_lttng_cmd "$(lttng_client_log_file)" "$(lttng_client_err_file)" \
regenerate statedump -s $sess_name
ret=$?
if [[ $expected_to_fail -eq "1" ]]; then
local expected_to_fail=$1
local sess_name=$2
- _run_lttng_cmd "$OUTPUT_DEST" "$ERROR_OUTPUT_DEST" \
+ _run_lttng_cmd "$(lttng_client_log_file)" "$(lttng_client_err_file)" \
rotate $sess_name
ret=$?
if [[ $expected_to_fail -eq "1" ]]; then
local sess_name=$2
local period=$3
- _run_lttng_cmd "$OUTPUT_DEST" "$ERROR_OUTPUT_DEST" \
+ _run_lttng_cmd "$(lttng_client_log_file)" "$(lttng_client_err_file)" \
enable-rotation -s $sess_name --timer $period
ret=$?
if [[ $expected_to_fail -eq "1" ]]; then
local sess_name=$2
local size=$3
- _run_lttng_cmd "$OUTPUT_DEST" "$ERROR_OUTPUT_DEST" \
+ _run_lttng_cmd "$(lttng_client_log_file)" "$(lttng_client_err_file)" \
enable-rotation -s $sess_name --size $size
ret=$?
if [[ $expected_to_fail -eq "1" ]]; then
local expected_to_fail=$1
local sess_name=$2
- _run_lttng_cmd "$OUTPUT_DEST" "$ERROR_OUTPUT_DEST" \
+ _run_lttng_cmd "$(lttng_client_log_file)" "$(lttng_client_err_file)" \
clear $sess_name
ret=$?
if [[ $expected_to_fail -eq "1" ]]; then
function lttng_clear_all ()
{
- _run_lttng_cmd "$OUTPUT_DEST" "$ERROR_OUTPUT_DEST" \
+ _run_lttng_cmd "$(lttng_client_log_file)" "$(lttng_client_err_file)" \
clear --all
ok $? "Clear all lttng sessions"
}