Skip to content

Commit a80db1f

Browse files
lenticularis39rostedt
authored andcommitted
rtla/tests: Test timerlat -P option using actions
The -P option is used to set priority of osnoise and timerlat threads. Extend the test for -P with --on-threshold calling a script that looks for running timerlat threads and checks if their priority is set correctly. As --on-threshold is only supported by timerlat at the moment, this is only implemented there so far. Cc: John Kacur <[email protected]> Cc: Luis Goncalves <[email protected]> Cc: Chang Yin <[email protected]> Cc: Costa Shulyupin <[email protected]> Link: https://lore.kernel.org/[email protected] Signed-off-by: Tomas Glozar <[email protected]> Signed-off-by: Steven Rostedt (Google) <[email protected]>
1 parent 892ae5f commit a80db1f

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

tools/tracing/rtla/tests/engine.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ check() {
6969
# Add rtla output and exit code as comments in case of failure
7070
echo "$result" | col -b | while read line; do echo "# $line"; done
7171
printf "#\n# exit code %s\n" $exitcode
72-
[ -n "$expected_output" ] && \
72+
[ -n "$expected_output" ] && [ $grep_result -ne 0 ] && \
7373
printf "# Output match failed: \"%s\"\n" "$expected_output"
7474
fi
7575
fi
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
# SPDX-License-Identifier: GPL-2.0
3+
pids="$(pgrep ^$1)" || exit 1
4+
for pid in $pids
5+
do
6+
chrt -p $pid | cut -d ':' -f 2 | head -n1 | grep "^ $2\$" >/dev/null
7+
chrt -p $pid | cut -d ':' -f 2 | tail -n1 | grep "^ $3\$" >/dev/null
8+
done && echo "Priorities are set correctly"

tools/tracing/rtla/tests/timerlat.t

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ check "verify help page" \
2525
check "verify -s/--stack" \
2626
"timerlat top -s 3 -T 10 -t" 2 "Blocking thread stack trace"
2727
check "verify -P/--priority" \
28-
"timerlat top -P F:1 -c 0 -d 10s -q"
28+
"timerlat top -P F:1 -c 0 -d 10s -q -T 1 --on-threshold shell,command=\"tests/scripts/check-priority.sh timerlatu/ SCHED_FIFO 1\"" \
29+
2 "Priorities are set correctly"
2930
check "test in nanoseconds" \
3031
"timerlat top -i 2 -c 0 -n -d 10s" 2 "ns"
3132
check "set the automatic trace mode" \

0 commit comments

Comments
 (0)