Resguardo inicial

This commit is contained in:
lastdragon
2026-09-06 12:53:21 -06:00
parent 662efe3c2a
commit ad2088d178
94853 changed files with 43200404 additions and 0 deletions
@@ -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"
@@ -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
@@ -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)"
@@ -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"
@@ -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"
@@ -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$"
}