diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2026-11-21 17:22:21 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2026-11-21 17:22:21 -0800 |
| commit | 4843f6873f7c4835e62f2c73ba0fd538e57a2f22 (patch) | |
| tree | ee620501a1ffbad9a83141e3a70154e1fe641040 /tools/tracing/rtla/tests/scripts | |
| download | linux-master.tar.gz linux-master.zip | |
Merge tag 'sysctl-7.04-fixes-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/sysctl/sysctlgraftedHEADmaster
Pull sysctl fix from Joel Granados:
"Fix sysctl jiffy / milliseconds conversion:
- Writing a previously read value "X" shall keep the same "X" value
- Remove truncation that was causing incorrect saturation of valid
timeouts"
* tag 'sysctl-7.04-fixes-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/sysctl/sysctl:
sysctl: Do jiffy / ms conversion in ulong space
Diffstat (limited to 'tools/tracing/rtla/tests/scripts')
8 files changed, 92 insertions, 0 deletions
diff --git a/tools/tracing/rtla/tests/scripts/check-cgroup-match.sh b/tools/tracing/rtla/tests/scripts/check-cgroup-match.sh new file mode 100755 index 000000000..fdc2c68c5 --- /dev/null +++ b/tools/tracing/rtla/tests/scripts/check-cgroup-match.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-2.0 +. "$(dirname $0)/lib/get_workload_pids.sh" +rtla_pid=$(echo $(ps -o ppid= $$)) +rtla_cgroup=$(</proc/$rtla_pid/cgroup) +echo "RTLA cgroup: $rtla_cgroup" +for pid in $(get_workload_pids) +do + pid_cgroup=$(</proc/$pid/cgroup) + echo "PID $pid cgroup: $pid_cgroup" + if ! [ "$pid_cgroup" = "$rtla_cgroup" ] + then + echo "Mismatch!" + exit 0 + fi +done +echo "cgroup matches for all workload PIDs" diff --git a/tools/tracing/rtla/tests/scripts/check-cpus.sh b/tools/tracing/rtla/tests/scripts/check-cpus.sh new file mode 100755 index 000000000..0b016d4a7 --- /dev/null +++ b/tools/tracing/rtla/tests/scripts/check-cpus.sh @@ -0,0 +1,9 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-2.0 +. "$(dirname $0)/lib/get_workload_pids.sh" +echo -n "Affinity of threads: " +for pid in $(get_workload_pids) +do + echo -n $(taskset -c -p $pid | cut -d ':' -f 2) +done +echo diff --git a/tools/tracing/rtla/tests/scripts/check-housekeeping-cpus.sh b/tools/tracing/rtla/tests/scripts/check-housekeeping-cpus.sh new file mode 100755 index 000000000..4742f34ef --- /dev/null +++ b/tools/tracing/rtla/tests/scripts/check-housekeeping-cpus.sh @@ -0,0 +1,4 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-2.0 +pid=$(ps -o ppid= $$) +echo "Affinity of threads:$(taskset -c -p $pid | cut -d ':' -f 2)" diff --git a/tools/tracing/rtla/tests/scripts/check-osnoise-option.sh b/tools/tracing/rtla/tests/scripts/check-osnoise-option.sh new file mode 100755 index 000000000..37c62268c --- /dev/null +++ b/tools/tracing/rtla/tests/scripts/check-osnoise-option.sh @@ -0,0 +1,16 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-2.0 +# Check if osnoise options are enabled or disabled. +# Usage: check-osnoise-option.sh <OPTION1> [<OPTION2> ...] +# Output: one line per option in the format "OPTION=enabled" or "OPTION=disabled" + +options=$(tr ' ' '\n' < /sys/kernel/tracing/osnoise/options) +for name in "$@"; do + if echo "$options" | grep -q "^NO_${name}$"; then + echo "$name=disabled" + elif echo "$options" | grep -q "^${name}$"; then + echo "$name=enabled" + else + echo "$name=unsupported" + fi +done diff --git a/tools/tracing/rtla/tests/scripts/check-priority.sh b/tools/tracing/rtla/tests/scripts/check-priority.sh new file mode 100755 index 000000000..b51d5232a --- /dev/null +++ b/tools/tracing/rtla/tests/scripts/check-priority.sh @@ -0,0 +1,8 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-2.0 +. "$(dirname $0)/lib/get_workload_pids.sh" +for pid in $(get_workload_pids) +do + chrt -p $pid | cut -d ':' -f 2 | head -n1 | grep "^ $1\$" >/dev/null + chrt -p $pid | cut -d ':' -f 2 | tail -n1 | grep "^ $2\$" >/dev/null +done && echo "Priorities are set correctly" diff --git a/tools/tracing/rtla/tests/scripts/check-tracefs-value.sh b/tools/tracing/rtla/tests/scripts/check-tracefs-value.sh new file mode 100755 index 000000000..12d0eacd6 --- /dev/null +++ b/tools/tracing/rtla/tests/scripts/check-tracefs-value.sh @@ -0,0 +1,11 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-2.0 +# Read tracefs values and print them. +# Usage: check-tracefs-value.sh <relative_path1> [<relative_path2> ...] +# Each path is relative to /sys/kernel/tracing/ +# Output: one line per file in the format "path=value" + +for file in "$@"; do + read value < "/sys/kernel/tracing/$file" + echo "$file=$value" +done diff --git a/tools/tracing/rtla/tests/scripts/check-user-kernel-threads.sh b/tools/tracing/rtla/tests/scripts/check-user-kernel-threads.sh new file mode 100755 index 000000000..bb7ac510a --- /dev/null +++ b/tools/tracing/rtla/tests/scripts/check-user-kernel-threads.sh @@ -0,0 +1,16 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-2.0 +. "$(dirname $0)/lib/get_workload_pids.sh" +kthreadd_pid=$(pgrep ^kthreadd$) +cnt_kernel=0 +cnt_user=0 +for pid in $(get_workload_pids) +do + if [ "$(echo $(ps -o ppid= $pid))" = "$kthreadd_pid" ] + then + ((++cnt_kernel)) + else + ((++cnt_user)) + fi +done +echo "$cnt_kernel kernel threads, $cnt_user user threads" diff --git a/tools/tracing/rtla/tests/scripts/lib/get_workload_pids.sh b/tools/tracing/rtla/tests/scripts/lib/get_workload_pids.sh new file mode 100644 index 000000000..d10a4e3b3 --- /dev/null +++ b/tools/tracing/rtla/tests/scripts/lib/get_workload_pids.sh @@ -0,0 +1,11 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-2.0 +get_workload_pids() { + local shell_pid=$$ + local rtla_pid=$(ps -o ppid= $shell_pid) + + # kernel threads + pgrep -P $(pgrep ^kthreadd$) -f '^\[?(osnoise|timerlat)/[0-9]+\]?$' + # user threads + pgrep -P $rtla_pid | grep -v "^$shell_pid$" +} |
