summaryrefslogtreecommitdiff
path: root/tools/tracing/rtla/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tools/tracing/rtla/tests')
-rw-r--r--tools/tracing/rtla/tests/engine.sh7
-rw-r--r--tools/tracing/rtla/tests/hwnoise.t4
-rw-r--r--tools/tracing/rtla/tests/osnoise.t6
-rw-r--r--tools/tracing/rtla/tests/timerlat.t12
4 files changed, 16 insertions, 13 deletions
diff --git a/tools/tracing/rtla/tests/engine.sh b/tools/tracing/rtla/tests/engine.sh
index b1697b3e3f52..f2616a8e4179 100644
--- a/tools/tracing/rtla/tests/engine.sh
+++ b/tools/tracing/rtla/tests/engine.sh
@@ -39,6 +39,7 @@ reset_osnoise() {
}
check() {
+ expected_exitcode=${3:-0}
# Simple check: run rtla with given arguments and test exit code.
# If TEST_COUNT is set, run the test. Otherwise, just count.
ctr=$(($ctr + 1))
@@ -49,7 +50,7 @@ check() {
# Run rtla; in case of failure, include its output as comment
# in the test results.
result=$(stdbuf -oL $TIMEOUT "$RTLA" $2 2>&1); exitcode=$?
- if [ $exitcode -eq 0 ]
+ if [ $exitcode -eq $expected_exitcode ]
then
echo "ok $ctr - $1"
else
@@ -68,12 +69,14 @@ check_with_osnoise_options() {
# Save original arguments
arg1=$1
arg2=$2
+ arg3=$3
# Apply osnoise options (if not dry run)
if [ -n "$TEST_COUNT" ]
then
[ "$NO_RESET_OSNOISE" == 1 ] || reset_osnoise
shift
+ shift
while shift
do
[ "$1" == "" ] && continue
@@ -84,7 +87,7 @@ check_with_osnoise_options() {
done
fi
- NO_RESET_OSNOISE=1 check "$arg1" "$arg2"
+ NO_RESET_OSNOISE=1 check "$arg1" "$arg2" "$arg3"
}
set_timeout() {
diff --git a/tools/tracing/rtla/tests/hwnoise.t b/tools/tracing/rtla/tests/hwnoise.t
index bbed17580537..5f71401a139e 100644
--- a/tools/tracing/rtla/tests/hwnoise.t
+++ b/tools/tracing/rtla/tests/hwnoise.t
@@ -10,11 +10,11 @@ check "verify help page" \
check "detect noise higher than one microsecond" \
"hwnoise -c 0 -T 1 -d 5s -q"
check "set the automatic trace mode" \
- "hwnoise -a 5 -d 30s"
+ "hwnoise -a 5 -d 30s" 2
check "set scheduling param to the osnoise tracer threads" \
"hwnoise -P F:1 -c 0 -r 900000 -d 1M -q"
check "stop the trace if a single sample is higher than 1 us" \
- "hwnoise -s 1 -T 1 -t -d 30s"
+ "hwnoise -s 1 -T 1 -t -d 30s" 2
check "enable a trace event trigger" \
"hwnoise -t -e osnoise:irq_noise trigger=\"hist:key=desc,duration:sort=desc,duration:vals=hitcount\" -d 1m"
diff --git a/tools/tracing/rtla/tests/osnoise.t b/tools/tracing/rtla/tests/osnoise.t
index e5995c03c790..44908fc01abf 100644
--- a/tools/tracing/rtla/tests/osnoise.t
+++ b/tools/tracing/rtla/tests/osnoise.t
@@ -10,9 +10,9 @@ check "verify help page" \
check "verify the --priority/-P param" \
"osnoise top -P F:1 -c 0 -r 900000 -d 1M -q"
check "verify the --stop/-s param" \
- "osnoise top -s 30 -T 1 -t"
+ "osnoise top -s 30 -T 1 -t" 2
check "verify the --trace param" \
- "osnoise hist -s 30 -T 1 -t"
+ "osnoise hist -s 30 -T 1 -t" 2
check "verify the --entries/-E param" \
"osnoise hist -P F:1 -c 0 -r 900000 -d 1M -b 10 -E 25"
@@ -20,6 +20,6 @@ check "verify the --entries/-E param" \
# and stopping on threshold.
# If default period is not set, this will time out.
check_with_osnoise_options "apply default period" \
- "osnoise hist -s 1" period_us=600000000
+ "osnoise hist -s 1" 2 period_us=600000000
test_end
diff --git a/tools/tracing/rtla/tests/timerlat.t b/tools/tracing/rtla/tests/timerlat.t
index e939ff71d6be..579c12a85e8f 100644
--- a/tools/tracing/rtla/tests/timerlat.t
+++ b/tools/tracing/rtla/tests/timerlat.t
@@ -21,21 +21,21 @@ export RTLA_NO_BPF=$option
check "verify help page" \
"timerlat --help"
check "verify -s/--stack" \
- "timerlat top -s 3 -T 10 -t"
+ "timerlat top -s 3 -T 10 -t" 2
check "verify -P/--priority" \
"timerlat top -P F:1 -c 0 -d 1M -q"
check "test in nanoseconds" \
- "timerlat top -i 2 -c 0 -n -d 30s"
+ "timerlat top -i 2 -c 0 -n -d 30s" 2
check "set the automatic trace mode" \
- "timerlat top -a 5 --dump-tasks"
+ "timerlat top -a 5 --dump-tasks" 2
check "print the auto-analysis if hits the stop tracing condition" \
- "timerlat top --aa-only 5"
+ "timerlat top --aa-only 5" 2
check "disable auto-analysis" \
- "timerlat top -s 3 -T 10 -t --no-aa"
+ "timerlat top -s 3 -T 10 -t --no-aa" 2
check "verify -c/--cpus" \
"timerlat hist -c 0 -d 30s"
check "hist test in nanoseconds" \
- "timerlat hist -i 2 -c 0 -n -d 30s"
+ "timerlat hist -i 2 -c 0 -n -d 30s" 2
done
test_end