1
0
mirror of https://github.com/ARM-software/devlib.git synced 2025-01-31 02:00:45 +00:00

shutils: consider different hierarchies when running command into cgroups

The target platform can have different hierarchies with different cgroup
controllers mounted. If we have a cgroup that uses different controllers
belonging to different hierarchies, that cgroup will be present under the
different hierarchies. Therefore, in such cases we need to take into all those
paths having that cgroup and move the task into all of them.
This commit is contained in:
Michele Di Giorgio 2017-11-20 11:23:08 +00:00 committed by marcbonnici
parent f3b04fcd73
commit c492f2e191

View File

@ -124,14 +124,14 @@ cgroups_run_into() {
# Check if the required CGroup exists
$FIND $CGMOUNT -type d -mindepth 1 | \
$GREP "$CGP" &>/dev/null
$GREP -E "^$CGMOUNT/devlib_cgh[0-9]{1,2}$CGP" &>/dev/null
if [ $? -ne 0 ]; then
echo "ERROR: could not find any $CGP cgroup under $CGMOUNT"
exit 1
fi
$FIND $CGMOUNT -type d -mindepth 1 | \
$GREP -e "^$CGMOUNT$CGP$" | \
$GREP -E "^$CGMOUNT/devlib_cgh[0-9]{1,2}$CGP$" | \
while read CGPATH; do
# Move this shell into that control group
echo $$ > $CGPATH/cgroup.procs