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

shutils: ensure we use "cat" version provided by Busybox

Signed-off-by: Patrick Bellasi <patrick.bellasi@arm.com>
This commit is contained in:
Patrick Bellasi 2016-08-26 16:12:23 +01:00
parent b9a16982d8
commit 83c1312b22

View File

@ -7,6 +7,7 @@ BUSYBOX=${BUSYBOX:-__DEVLIB_BUSYBOX__}
FIND=${FIND:-$BUSYBOX find}
GREP=${GREP:-$BUSYBOX grep}
SED=${SED:-$BUSYBOX sed}
CAT=${CAT:-$BUSYBOX cat}
################################################################################
# CPUFrequency Utility Functions
@ -37,7 +38,7 @@ cpufreq_get_all_governors() {
}
cpufreq_trace_all_frequencies() {
FREQS=$(cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_cur_freq)
FREQS=$($CAT /sys/devices/system/cpu/cpu*/cpufreq/scaling_cur_freq)
CPU=0; for F in $FREQS; do
echo "cpu_frequency: state=$F cpu_id=$CPU" > /sys/kernel/debug/tracing/trace_marker
CPU=$((CPU + 1))
@ -51,7 +52,7 @@ cpufreq_trace_all_frequencies() {
ftrace_get_function_stats() {
for CPU in $(ls /sys/kernel/debug/tracing/trace_stat | sed 's/function//'); do
REPLACE_STRING="s/ Function/\n Function (CPU$CPU)/"
cat /sys/kernel/debug/tracing/trace_stat/function$CPU \
$CAT /sys/kernel/debug/tracing/trace_stat/function$CPU \
| sed "$REPLACE_STRING"
done
}
@ -135,7 +136,7 @@ cgroups_tasks_move() {
DST_GRP=${2}
GREP_EXCLUSE=${3:-''}
cat $SRC_GRP/tasks | while read TID; do
$CAT $SRC_GRP/tasks | while read TID; do
echo $TID > $DST_GRP/cgroup.procs
done
@ -145,7 +146,7 @@ cgroups_tasks_move() {
PIDS=`echo $PIDS`
echo "PIDs to save: [$PIDS]"
for TID in $PIDS; do
CMDLINE=`cat /proc/$TID/cmdline`
CMDLINE=`$CAT /proc/$TID/cmdline`
echo "$TID : $CMDLINE"
echo $TID > $SRC_GRP/cgroup.procs
done