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:
parent
b9a16982d8
commit
83c1312b22
@ -7,6 +7,7 @@ BUSYBOX=${BUSYBOX:-__DEVLIB_BUSYBOX__}
|
|||||||
FIND=${FIND:-$BUSYBOX find}
|
FIND=${FIND:-$BUSYBOX find}
|
||||||
GREP=${GREP:-$BUSYBOX grep}
|
GREP=${GREP:-$BUSYBOX grep}
|
||||||
SED=${SED:-$BUSYBOX sed}
|
SED=${SED:-$BUSYBOX sed}
|
||||||
|
CAT=${CAT:-$BUSYBOX cat}
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# CPUFrequency Utility Functions
|
# CPUFrequency Utility Functions
|
||||||
@ -37,7 +38,7 @@ cpufreq_get_all_governors() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
cpufreq_trace_all_frequencies() {
|
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
|
CPU=0; for F in $FREQS; do
|
||||||
echo "cpu_frequency: state=$F cpu_id=$CPU" > /sys/kernel/debug/tracing/trace_marker
|
echo "cpu_frequency: state=$F cpu_id=$CPU" > /sys/kernel/debug/tracing/trace_marker
|
||||||
CPU=$((CPU + 1))
|
CPU=$((CPU + 1))
|
||||||
@ -51,7 +52,7 @@ cpufreq_trace_all_frequencies() {
|
|||||||
ftrace_get_function_stats() {
|
ftrace_get_function_stats() {
|
||||||
for CPU in $(ls /sys/kernel/debug/tracing/trace_stat | sed 's/function//'); do
|
for CPU in $(ls /sys/kernel/debug/tracing/trace_stat | sed 's/function//'); do
|
||||||
REPLACE_STRING="s/ Function/\n Function (CPU$CPU)/"
|
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"
|
| sed "$REPLACE_STRING"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
@ -135,7 +136,7 @@ cgroups_tasks_move() {
|
|||||||
DST_GRP=${2}
|
DST_GRP=${2}
|
||||||
GREP_EXCLUSE=${3:-''}
|
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
|
echo $TID > $DST_GRP/cgroup.procs
|
||||||
done
|
done
|
||||||
|
|
||||||
@ -145,7 +146,7 @@ cgroups_tasks_move() {
|
|||||||
PIDS=`echo $PIDS`
|
PIDS=`echo $PIDS`
|
||||||
echo "PIDs to save: [$PIDS]"
|
echo "PIDs to save: [$PIDS]"
|
||||||
for TID in $PIDS; do
|
for TID in $PIDS; do
|
||||||
CMDLINE=`cat /proc/$TID/cmdline`
|
CMDLINE=`$CAT /proc/$TID/cmdline`
|
||||||
echo "$TID : $CMDLINE"
|
echo "$TID : $CMDLINE"
|
||||||
echo $TID > $SRC_GRP/cgroup.procs
|
echo $TID > $SRC_GRP/cgroup.procs
|
||||||
done
|
done
|
||||||
|
Loading…
x
Reference in New Issue
Block a user