Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <jkacur@redhat.com>
Cc: Luis Goncalves <lgoncalv@redhat.com>
Cc: Chang Yin <cyin@redhat.com>
Cc: Costa Shulyupin <costa.shul@redhat.com>
Link: https://lore.kernel.org/20250725133817.59237-3-tglozar@redhat.com
Signed-off-by: Tomas Glozar <tglozar@redhat.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>

authored by

Tomas Glozar and committed by
Steven Rostedt (Google)
a80db1f8 892ae5f8

+11 -2
+1 -1
tools/tracing/rtla/tests/engine.sh
··· 69 69 # Add rtla output and exit code as comments in case of failure 70 70 echo "$result" | col -b | while read line; do echo "# $line"; done 71 71 printf "#\n# exit code %s\n" $exitcode 72 - [ -n "$expected_output" ] && \ 72 + [ -n "$expected_output" ] && [ $grep_result -ne 0 ] && \ 73 73 printf "# Output match failed: \"%s\"\n" "$expected_output" 74 74 fi 75 75 fi
+8
tools/tracing/rtla/tests/scripts/check-priority.sh
··· 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"
+2 -1
tools/tracing/rtla/tests/timerlat.t
··· 25 25 check "verify -s/--stack" \ 26 26 "timerlat top -s 3 -T 10 -t" 2 "Blocking thread stack trace" 27 27 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" 29 30 check "test in nanoseconds" \ 30 31 "timerlat top -i 2 -c 0 -n -d 10s" 2 "ns" 31 32 check "set the automatic trace mode" \