From: Tomas Glozar Date: Thu, 23 Apr 2026 13:05:58 +0000 (+0200) Subject: rtla/tests: Add runtime tests for -C/--cgroup X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=117a366c5b000c4b4292d94dd1397e62d9a44d79;p=thirdparty%2Fkernel%2Flinux.git rtla/tests: Add runtime tests for -C/--cgroup Add a new script check-cgroup-match.sh that retrieves the cgroup of the main rtla process and compares it to the cgroup of the rtla workload threads. Add a new test based on this script, for both osnoise and timerlat tools, testing the variant of -C without argument (which sets the cgroup of the workload to the cgroup of the rtla main process). Note that this has to be tested in kernel mode to be significant for timerlat tool, as user workloads inherit the parent rtla process cgroup even without the option. Reviewed-by: Wander Lairson Costa Link: https://lore.kernel.org/r/20260423130558.882022-10-tglozar@redhat.com Signed-off-by: Tomas Glozar --- diff --git a/tools/tracing/rtla/tests/osnoise.t b/tools/tracing/rtla/tests/osnoise.t index d0b623233db5f..06787471d0e8c 100644 --- a/tools/tracing/rtla/tests/osnoise.t +++ b/tools/tracing/rtla/tests/osnoise.t @@ -18,6 +18,9 @@ check_top_q_hist "verify the --trace param" \ check_top_q_hist "verify the --priority/-P param" \ "osnoise TOOL -P F:1 -c 0 -r 900000 -d 10s -S 1 --on-threshold shell,command=\"tests/scripts/check-priority.sh SCHED_FIFO 1\"" \ 2 "Priorities are set correctly" +check_top_q_hist "verify the -C/--cgroup param" \ + "osnoise TOOL -C -c 0 -r 900000 -d 10s -S 1 --on-threshold shell,command=\"tests/scripts/check-cgroup-match.sh\"" \ + 2 "cgroup matches for all workload PIDs" check_top_q_hist "verify the -c/--cpus param" \ "osnoise TOOL -P F:1 -c 0 -r 900000 -d 10s -S 1 --on-threshold shell,command=tests/scripts/check-cpus.sh" 2 "^Affinity of threads: 0$" check_top_q_hist "verify the -H/--house-keeping param" \ 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 0000000000000..fdc2c68c5957a --- /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=$(