X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=tests%2Fregression%2Ftools%2Ftracefile-limits%2Ftest_tracefile_count;h=9253d3ec2fcc0afdb2b6abe7320bb6f086b51ed7;hb=HEAD;hp=5f114af044e25b696907b832b5aa427f65d5ce17;hpb=206e6505316df1b86196d6582ef1e632e47d43a5;p=lttng-tools.git diff --git a/tests/regression/tools/tracefile-limits/test_tracefile_count b/tests/regression/tools/tracefile-limits/test_tracefile_count index 5f114af04..3d7d6abbc 100755 --- a/tests/regression/tools/tracefile-limits/test_tracefile_count +++ b/tests/regression/tools/tracefile-limits/test_tracefile_count @@ -9,12 +9,12 @@ TEST_DESC="Tracefile count limits" CURDIR=$(dirname "$0")/ TESTDIR=$CURDIR/../../.. +BT2_PLUGINS_DIR="${TESTDIR}/utils/bt2_plugins" TESTAPP_PATH="$TESTDIR/utils/testapp" TESTAPP_NAME="gen-ust-events" TESTAPP_BIN="$TESTAPP_PATH/$TESTAPP_NAME/$TESTAPP_NAME" -STATS_BIN="$TESTDIR/utils/babelstats.pl" NUM_TESTS=74 PAGE_SIZE=$(getconf PAGE_SIZE) @@ -22,30 +22,15 @@ TRACEFILE_SIZE=$PAGE_SIZE source "$TESTDIR"/utils/utils.sh -NUM_CPUS=$(conf_proc_count) - if [ ! -x "$TESTAPP_BIN" ]; then BAIL_OUT "No UST events binary detected." fi function pick_random_cpuid () { - local cpuid=0 - - # On Linux pick a random available cpuid from sysfs - if [ -d "/sys/devices/system/cpu" ]; then - local cpuids=() - - for i in /sys/devices/system/cpu/cpu[0-9]*; do - cpuids+=("${i#/sys/devices/system/cpu/cpu}") - done - - cpuid=${cpuids[ $RANDOM % ${#cpuids[@]} ]} - else - cpuid=$((RANDOM % NUM_CPUS)) - fi - - echo $cpuid + local cpuids + read -r -a cpuids <<< "$(get_online_cpus)" + echo "${cpuids[ $RANDOM % ${#cpuids[@]} ]}" } function enable_lttng_channel_count_limit () @@ -111,7 +96,7 @@ function test_tracefile_count_limit () local session_name local stream_pattern=".*${channel_name}_${cpuno}_[0-9]*" local stream_size=0 - local trace_path=$(mktemp --tmpdir -d "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") + local trace_path=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") session_name=$(randstring 16 0) @@ -155,7 +140,7 @@ function test_tracefile_count_limit () [ "$(get_stream_file_count "$trace_path" "$stream_pattern")" -eq "$count_limit" ] ok $? "Stream meets the trace file limit of $count_limit" - stats=`"$BABELTRACE_BIN" $trace_path | $STATS_BIN --tracepoint $event_name` + 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"