local test_date=$1
local trace_path=$2
- res=$($BABELTRACE_BIN --clock-date "$trace_path" 2>/dev/null | head -1 | grep $test_date)
+ res=$(_run_babeltrace_cmd --clock-date "$trace_path" | head -1 | grep $test_date)
if [ $? -eq 0 ]; then
pass "Validate trace at date $test_date"
ret=0
destroy_lttng_session_ok "$SESSION_NAME"
- "$BABELTRACE_BIN" "$TRACE_PATH" | grep $EVENT_NAME | ./"$PARSE_CALLSTACK" --user "$TEST_APP_USERSPACE" $USER_CS_EXPECTED
+ "_run_babeltrace_cmd" "$TRACE_PATH" | grep $EVENT_NAME | ./"$PARSE_CALLSTACK" --user "$TEST_APP_USERSPACE" $USER_CS_EXPECTED
ok $? "Validate userspace callstack"
rm -rf "$TRACE_PATH"
destroy_lttng_session_ok "$SESSION_NAME"
- "$BABELTRACE_BIN" "$TRACE_PATH" | grep $EVENT_NAME | ./"$PARSE_CALLSTACK" --kernel $KERNEL_CS_EXPECTED
+ "_run_babeltrace_cmd" "$TRACE_PATH" | grep $EVENT_NAME | ./"$PARSE_CALLSTACK" --kernel $KERNEL_CS_EXPECTED
ok $? "Validate kernel callstack"
rm -rf "$TRACE_PATH"
local TRACE_METADATA_FILE_PATH="$(find "$TRACE_PATH" -name metadata -type f)"
local TRACE_METADATA_DIR="$(dirname "$TRACE_METADATA_FILE_PATH")"
- $BABELTRACE_BIN -o ctf-metadata -w $ctf_metadata_file $TRACE_METADATA_DIR
+ _run_babeltrace_cmd -o ctf-metadata -w $ctf_metadata_file $TRACE_METADATA_DIR
ok $? "Metadata extraction from babeltrace"
extract_clock_metadata $ctf_metadata_file $clock_metadata_file
# Use Babeltrace with "-n all" to give a comma separated list for
# easy extraction of timestamps.
- unique_timestamps_count=$($BABELTRACE_BIN -n all $TRACE_PATH | \
+ unique_timestamps_count=$(_run_babeltrace_cmd -n all $TRACE_PATH | \
cut -d, -f1 | uniq | wc -l)
test $unique_timestamps_count -gt 1
ok $? "Unique event timestamps without clock override: $unique_timestamps_count expect >1"
# Use Babeltrace with "-n all" to give a comma separated list for
# easy extraction of timestamps.
- unique_timestamps_count=$($BABELTRACE_BIN -n all $TRACE_PATH | \
+ unique_timestamps_count=$(_run_babeltrace_cmd -n all $TRACE_PATH | \
cut -d, -f1 | uniq | wc -l)
test $unique_timestamps_count -eq 1
ok $? "Unique event timestamps with clock override: $unique_timestamps_count expect 1"
wait_live_trace_ready net://localhost
# Connect a live viewer
- $BABELTRACE_BIN -i lttng-live net://localhost/host/$remote_trace_path > $bt_output_path &
+ _run_babeltrace_cmd -i lttng-live net://localhost/host/$remote_trace_path > $bt_output_path &
local viewer_pid=$!
wait_live_viewer_connect net://localhost
wait_live_trace_ready net://localhost
# Connect a live viewer
- $BABELTRACE_BIN -i lttng-live net://localhost/host/$remote_trace_path > $bt_output_path &
+ _run_babeltrace_cmd -i lttng-live net://localhost/host/$remote_trace_path > $bt_output_path &
local viewer_pid=$!
wait_live_viewer_connect net://localhost
local remote_trace_path="${HOSTNAME}/${SESSION_NAME}"
local channel_name="chan"
local bt_output_path=$(mktemp -u -t tmp.test_${FUNCNAME[0]}_bt_output_path.XXXXXX)
- local bt_error_path=$(mktemp -t "tmp.${FUNCNAME[0]}_bt_error.XXXXXX")
local file_sync_before_exit=$(mktemp -u -t tmp.test_${FUNCNAME[0]}_sync_before_exit.XXXXXX)
diag "Test ust basic streaming live with viewer"
wait_live_trace_ready net://localhost
# Connect a live viewer
- $BABELTRACE_BIN -i lttng-live net://localhost/host/$remote_trace_path --params=session-not-found-action=end 1> $bt_output_path 2> "${bt_error_path}" &
+ _run_babeltrace_cmd -i lttng-live net://localhost/host/$remote_trace_path --params=session-not-found-action=end 1> $bt_output_path &
local viewer_pid=$!
local viewer_iter=0
pass "Wait for viewer to exit"
rm -f $bt_output_path
- clean_path "${bt_error_path}"
rm -f $file_sync_before_exit
}
local remote_trace_path="${HOSTNAME}/${SESSION_NAME}"
local channel_name="chan"
local bt_output_path=$(mktemp -u -t tmp.test_${FUNCNAME[0]}_bt_output_path.XXXXXX)
- local bt_error_path=$(mktemp -t "tmp.${FUNCNAME[0]}_bt_error.XXXXXX")
diag "Test ust streaming live clear with viewer"
diag "Parameters: tracing_active=$tracing_active, clear_twice=$clear_twice, buffer_type=$buffer_type"
wait_live_trace_ready net://localhost
# Connect a live viewer
- $BABELTRACE_BIN -i lttng-live net://localhost/host/$remote_trace_path --params=session-not-found-action=end 1> $bt_output_path 2> "${bt_error_path}" &
+ _run_babeltrace_cmd -i lttng-live net://localhost/host/$remote_trace_path --params=session-not-found-action=end 1> $bt_output_path &
local viewer_pid=$!
wait_live_viewer_connect net://localhost
pass "Wait for viewer to exit"
clean_path $bt_output_path
- clean_path "${bt_error_path}"
}
function test_ust_streaming_live_viewer_new_metadata_after_clear ()
local channel_name="chan"
local bt_output_path=$(mktemp -t "tmp.${FUNCNAME[0]}_bt_output.XXXXXX")
- local bt_error_path=$(mktemp -t "tmp.${FUNCNAME[0]}_bt_error.XXXXXX")
local file_sync_before_exit=$(mktemp -u -t "tmp.${FUNCNAME[0]}_sync_before_exit.XXXXXX")
diag "Test ust streaming live clear with viewer with new metadata after clear"
wait_live_trace_ready net://localhost
# Connect a live viewer
- $BABELTRACE_BIN -i lttng-live "net://localhost/host/$remote_trace_path" --params=session-not-found-action=end 1> "$bt_output_path" 2> "$bt_error_path" &
+ _run_babeltrace_cmd -i lttng-live "net://localhost/host/$remote_trace_path" --params=session-not-found-action=end 1> "$bt_output_path" &
local viewer_pid=$!
local viewer_iter=0
pass "Wait for viewer to exit"
clean_path "$bt_output_path"
- clean_path "$bt_error_path"
rm -f "$file_sync_before_exit"
}
run_apps
stop_lttng_tracing_ok $SESSION_NAME
- nb_events=$("$BABELTRACE_BIN" $trace_path | wc -l)
+ nb_events=$("_run_babeltrace_cmd" $trace_path | wc -l)
if [ "$nb_events" -ne "0" ]; then
ok 0 "Events were found during the dry run without exclusion"
else
# Destroy session
destroy_lttng_session_ok $SESSION_NAME
- stats=$("$BABELTRACE_BIN" --plugin-path "${BT2_PLUGINS_DIR}" "${trace_path}" -c filter.lttngtest.event_name -p "names=[\"${event_name_expected_to_be_missing}\"]" -c sink.lttngtest.field_stats | grep -v index 2> /dev/null)
+ stats=$("_run_babeltrace_cmd" --plugin-path "${BT2_PLUGINS_DIR}" "${trace_path}" -c filter.lttngtest.event_name -p "names=[\"${event_name_expected_to_be_missing}\"]" -c sink.lttngtest.field_stats | grep -v index)
if [ ! -z "$stats" ]; then
fail "Excluded event \"$event_name_expected_to_be_missing\" was found in trace!"
else
# Destroy session
destroy_lttng_session_ok $SESSION_NAME
- stats=$("$BABELTRACE_BIN" --plugin-path "${BT2_PLUGINS_DIR}" "${trace_path}" -c filter.lttngtest.event_name -p "names=[\"${event_name_expected_to_be_missing}\"]" -c sink.lttngtest.field_stats | grep -v index 2> /dev/null)
+ stats=$("_run_babeltrace_cmd" --plugin-path "${BT2_PLUGINS_DIR}" "${trace_path}" -c filter.lttngtest.event_name -p "names=[\"${event_name_expected_to_be_missing}\"]" -c sink.lttngtest.field_stats | grep -v index)
if [ ! -z "$stats" ]; then
fail "Excluded event \"$event_name_expected_to_be_missing\" was found in trace!"
else
metadata_path=$(find "${expected_path}/${session_name}"* -name "metadata")
metadata_path=$(dirname "$metadata_path")
- $BABELTRACE_BIN --output-format=ctf-metadata "${metadata_path}" > "$metadata"
+ _run_babeltrace_cmd --output-format=ctf-metadata "${metadata_path}" > "$metadata"
# Extract "env" scope
awk '/env {/,/};/' < "$metadata" > "$metadata_env"
metadata_path=$(find "${expected_path}/${session_name}"* -name "metadata")
metadata_path=$(dirname "$metadata_path")
- $BABELTRACE_BIN --output-format=ctf-metadata "${metadata_path}" > "$metadata"
+ _run_babeltrace_cmd --output-format=ctf-metadata "${metadata_path}" > "$metadata"
# Extract "env" scope
awk '/env {/,/};/' < "$metadata" > "$metadata_env"
metadata_path=$(find "${expected_path}/${session_name}"* -name "metadata")
metadata_path=$(dirname "$metadata_path")
- $BABELTRACE_BIN --output-format=ctf-metadata "${metadata_path}" 1> "$metadata"
+ _run_babeltrace_cmd --output-format=ctf-metadata "${metadata_path}" 1> "$metadata"
# Extract "env" scope
awk '/env {/,/};/' < "$metadata" > "$metadata_env"
[ "$(get_stream_file_count "$trace_path" "$stream_pattern")" -eq "$count_limit" ]
ok $? "Stream meets the trace file limit of $count_limit"
- stats=$("$BABELTRACE_BIN" --plugin-path "${BT2_PLUGINS_DIR}" convert $trace_path -c filter.lttngtest.event_name -p "names=[\"${event_name}\"]" -c sink.lttngtest.field_stats)
+ stats=$("_run_babeltrace_cmd" --plugin-path "${BT2_PLUGINS_DIR}" convert $trace_path -c filter.lttngtest.event_name -p "names=[\"${event_name}\"]" -c sink.lttngtest.field_stats)
validate_min_max "$stats" "intfield" "[0-9]+" "$expected_max"
ok $? "Trace validation - intfield"
rm -f ${file_sync_before_last}_${i}
done
- out=$("$BABELTRACE_BIN" $TRACE_PATH | grep $EVENT_NAME | wc -l)
+ out=$("_run_babeltrace_cmd" $TRACE_PATH | grep $EVENT_NAME | wc -l)
if [ $out -eq 0 ]; then
fail "Trace validation"
diag "No event(s) found. We are supposed to have at least one."
rm -f ${file_sync_after_first}
rm -f ${file_sync_before_last}
- out=$("$BABELTRACE_BIN" $TRACE_PATH | grep $EVENT_NAME | wc -l)
+ out=$("_run_babeltrace_cmd" $TRACE_PATH | grep $EVENT_NAME | wc -l)
if [ $out -eq 0 ]; then
fail "Trace validation"
diag "No event(s) found. We are supposed to have at least one."
local TRACE_METADATA_FILE_PATH="$(find "$TRACE_PATH" -name metadata -type f)"
local TRACE_METADATA_DIR="$(dirname "$TRACE_METADATA_FILE_PATH")"
- $BABELTRACE_BIN -o ctf-metadata -w $ctf_metadata_file $TRACE_METADATA_DIR
+ _run_babeltrace_cmd -o ctf-metadata -w $ctf_metadata_file $TRACE_METADATA_DIR
ok $? "Metadata extraction from babeltrace"
extract_clock_metadata $ctf_metadata_file $clock_metadata_file
# Use Babeltrace with "-n all" to give a comma separated list for
# easy extraction of timestamps.
- unique_timestamps_count=$($BABELTRACE_BIN -n all $TRACE_PATH | \
+ unique_timestamps_count=$(_run_babeltrace_cmd -n all $TRACE_PATH | \
cut -d, -f1 | uniq | wc -l)
test $unique_timestamps_count -gt 1
ok $? "Unique event timestamps without clock override: $unique_timestamps_count expect >1"
# Use Babeltrace with "-n all" to give a comma separated list for
# easy extraction of timestamps.
- unique_timestamps_count=$($BABELTRACE_BIN -n all $TRACE_PATH | \
+ unique_timestamps_count=$(_run_babeltrace_cmd -n all $TRACE_PATH | \
cut -d, -f1 | uniq | wc -l)
test $unique_timestamps_count -eq 1
ok $? "Unique event timestamps with clock override: $unique_timestamps_count expect 1"
echo "$(( ${SEQUENCE_SEED[$i]} % $num_cpus))"
done
diag "Dumping trace"
- $BABELTRACE_BIN $TRACE_PATH | awk '{print "# " $0}'
+ _run_babeltrace_cmd $TRACE_PATH | awk '{print "# " $0}'
fi
fi
}
destroy_lttng_session_ok $SESSION_NAME
# Move output to an array by using =($())
- local cpuid_events=($($BABELTRACE_BIN $TRACE_PATH | sed -n 's/.*cpu_id = \([0-9]*\).*/\1/p'))
+ local cpuid_events=($(_run_babeltrace_cmd $TRACE_PATH | sed -n 's/.*cpu_id = \([0-9]*\).*/\1/p'))
local num_events=${#cpuid_events[*]}
test $num_events -eq $NUM_EVENT
ok $? "Extraction without getcpu plugin have $num_events/$NUM_EVENT"
stop_lttng_tracing_ok $SESSION_NAME
destroy_lttng_session_ok $SESSION_NAME
- local cpuid_events=($($BABELTRACE_BIN $TRACE_PATH | sed -n 's/.*cpu_id = \([0-9]*\).*/\1/p'))
+ local cpuid_events=($(_run_babeltrace_cmd $TRACE_PATH | sed -n 's/.*cpu_id = \([0-9]*\).*/\1/p'))
local num_events=${#cpuid_events[*]}
test $num_events -eq $NUM_EVENT
ok $? "Extraction with getcpu plugin have $num_events/$NUM_EVENT"
last_val=0
out=0
-"$BABELTRACE_BIN" $TRACE_PATH | while read event;
+"_run_babeltrace_cmd" $TRACE_PATH | while read event;
do
val=$(echo $event | cut -f10 -d" ")
val=${val%?}
for i in $(seq 0 3); do
stop_lttng_tracing_ok "$SESSION_NAME-$i"
destroy_lttng_session_ok "$SESSION_NAME-$i"
- out=$($BABELTRACE_BIN "$TRACE_PATH/$i" | grep -c "$EVENT_NAME$i")
+ out=$(_run_babeltrace_cmd "$TRACE_PATH/$i" | grep -c "$EVENT_NAME$i")
if [ "$out" -ne $NR_ITER ]; then
fail "Trace validation of $SESSION_NAME-$i"
diag "No events found."
{
local out
- out=$("$BABELTRACE_BIN" "$TRACE_PATH" | grep -c $EVENT_NAME)
+ out=$("_run_babeltrace_cmd" "$TRACE_PATH" | grep -c $EVENT_NAME)
if [ "$out" -eq 0 ]; then
fail "Trace validation"
diag "No event(s) found. We are supposed to have at least one."