Files
linux/tools/tracing/rtla/tests/scripts/check-user-kernel-threads.sh
Tomas Glozar a98dad63cd rtla/tests: Add runtime test for -k and -u options
Add runtime test for rtla-timerlat's -k/--kernel-threads and
-u/--user-threads options using get_workload_pids.sh to check whether
the appropriate threads are being created.

The tests are implemented for both top and hist. Additionally, all tests
related to timerlat threads are moved to a separate section in the test
files. The latter is also done for rtla-osnoise tests.

Reviewed-by: Wander Lairson Costa <wander@redhat.com>
Link: https://lore.kernel.org/r/20260423130558.882022-9-tglozar@redhat.com
Signed-off-by: Tomas Glozar <tglozar@redhat.com>
2026-05-18 11:00:52 +02:00

17 lines
377 B
Bash
Executable File

#!/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"