tools/tracing/rtla/tests/scripts/check-cgroup-match.sh

Source file repositories/reference/linux-study-clean/tools/tracing/rtla/tests/scripts/check-cgroup-match.sh

File Facts

System
Linux kernel
Corpus path
tools/tracing/rtla/tests/scripts/check-cgroup-match.sh
Extension
.sh
Size
458 bytes
Lines
18
Domain
Support Tooling And Documentation
Bucket
tools
Inferred role
Support Tooling And Documentation: tools
Status
atlas-only

Why This File Exists

Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.

Dependency Surface

Detected Declarations

Annotated Snippet

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

Annotation

Implementation Notes