1
0
mirror of https://github.com/ARM-software/devlib.git synced 2024-10-06 02:40:50 +01:00

shutils/cgroups: Use busybox ps to fix output format

Different `ps` implementations (e.g. Android vs GNU) have different
default columns and process selections.
This commit is contained in:
Brendan Jackman 2016-11-25 16:01:20 +00:00
parent 3dd4ea69b4
commit 0dc65bddb6

View File

@ -9,6 +9,7 @@ GREP=${GREP:-$BUSYBOX grep}
SED=${SED:-$BUSYBOX sed}
CAT=${CAT:-$BUSYBOX cat}
AWK=${AWK:-$BUSYBOX awk}
PS=${PS:-$BUSYBOX ps}
################################################################################
# CPUFrequency Utility Functions
@ -156,7 +157,7 @@ cgroups_tasks_move() {
[ "x$FILTERS" = "x" ] && exit 0
PIDS=`ps | $GREP $FILTERS | $AWK '{print $2}'`
PIDS=`$PS -o comm,pid | $GREP $FILTERS | $AWK '{print $2}'`
PIDS=`echo $PIDS`
echo "PIDs to save: [$PIDS]"
for TID in $PIDS; do