preload_lib=$(readlink -f $el)
addr=$(readelf -sW $preload_lib | grep $preload_open_function | head -1 | awk '{print $2}')
- echo -e "echo \"$preload_lib\" > /sys/kernel/debug/swap/preload/loader/loader_path" >> $filename
- echo -e "echo 0x$addr > /sys/kernel/debug/swap/preload/loader/loader_offset" >> $filename
+ echo -e "/bin/echo \"$preload_lib\" > /sys/kernel/debug/swap/preload/loader/loader_path" >> $filename
+ echo -e "/bin/echo 0x$addr > /sys/kernel/debug/swap/preload/loader/loader_offset" >> $filename
}
function print_probe_lib()
{
filename=$1
- echo -e "echo \"$handlers_lib\" > /sys/kernel/debug/swap/preload/handlers_path" >> $filename
+ echo -e "/bin/echo \"$handlers_lib\" > /sys/kernel/debug/swap/preload/handlers_path" >> $filename
}
function print_linker()
linker=$(readlink -f $el)
r_debug_offset=$(readelf -sW $linker | grep $linker_sym | awk '{print $2}' | uniq)
- echo -e "echo \"$linker\" > /sys/kernel/debug/swap/preload/linker/linker_path" >> $filename
- echo -e "echo 0x$r_debug_offset > /sys/kernel/debug/swap/preload/linker/r_debug_offset" >> $filename
+ echo -e "/bin/echo \"$linker\" > /sys/kernel/debug/swap/preload/linker/linker_path" >> $filename
+ echo -e "/bin/echo 0x$r_debug_offset > /sys/kernel/debug/swap/preload/linker/r_debug_offset" >> $filename
}
##################################
ERR_NO_ST="No errors"
if [ "$1" != "" ];then
- echo "Error code <$1>. TODO decode it."
+ /bin/echo "Error code <$1>. TODO decode it."
exit $1
fi
if [ -e $config_file ]; then
grep -i "feature/container[^>]*>[[:blank:]]*false" "$config_file" > /dev/null
if [ $? -ne 0 ]; then
- echo $ERR_CONTAINER_NOT_SUPPORTED_ST
+ /bin/echo $ERR_CONTAINER_NOT_SUPPORTED_ST
exit $ERR_CONTAINER_NOT_SUPPORTED
fi
fi
fi
# swap enebling
-echo 1 > /sys/kernel/debug/swap/enable
+/bin/echo 1 > /sys/kernel/debug/swap/enable
# Energy coefficients
# CPU coefficients are divided by 10^6 because
# - result should be exposed in uAs
# cpu idle: 62.27 / 1
-echo 62270 > /sys/kernel/debug/swap/energy/cpu_idle/numerator &&
-echo 1000000000 > /sys/kernel/debug/swap/energy/cpu_idle/denominator &&
+/bin/echo 62270 > /sys/kernel/debug/swap/energy/cpu_idle/numerator &&
+/bin/echo 1000000000 > /sys/kernel/debug/swap/energy/cpu_idle/denominator &&
# cpu0 running: 213.21 / 1
-echo 213210 > /sys/kernel/debug/swap/energy/cpu_running/numerator &&
-echo 1000000000 > /sys/kernel/debug/swap/energy/cpu_running/denominator &&
+/bin/echo 213210 > /sys/kernel/debug/swap/energy/cpu_running/numerator &&
+/bin/echo 1000000000 > /sys/kernel/debug/swap/energy/cpu_running/denominator &&
# cpuN running: 97.29 / 1
-echo 97290 > /sys/kernel/debug/swap/energy/cpuN_running/numerator &&
-echo 1000000000 > /sys/kernel/debug/swap/energy/cpuN_running/denominator &&
+/bin/echo 97290 > /sys/kernel/debug/swap/energy/cpuN_running/numerator &&
+/bin/echo 1000000000 > /sys/kernel/debug/swap/energy/cpuN_running/denominator &&
# flash read: 74.32 / 33154239
-echo 74320 > /sys/kernel/debug/swap/energy/flash_read/numerator &&
-echo 33154239 > /sys/kernel/debug/swap/energy/flash_read/denominator &&
+/bin/echo 74320 > /sys/kernel/debug/swap/energy/flash_read/numerator &&
+/bin/echo 33154239 > /sys/kernel/debug/swap/energy/flash_read/denominator &&
# flash write: 141.54 / 27920983
-echo 141540 > /sys/kernel/debug/swap/energy/flash_write/numerator &&
-echo 27920983 > /sys/kernel/debug/swap/energy/flash_write/denominator &&
+/bin/echo 141540 > /sys/kernel/debug/swap/energy/flash_write/numerator &&
+/bin/echo 27920983 > /sys/kernel/debug/swap/energy/flash_write/denominator &&
# LCD:
if [ -d /sys/kernel/debug/swap/energy/lcd/ ]
then
# lcd max (white max - black max) / 2: 255 / 1
- echo 255 > `ls /sys/kernel/debug/swap/energy/lcd/*/max_num` &&
- echo 1000000 > `ls /sys/kernel/debug/swap/energy/lcd/*/max_denom` &&
+ /bin/echo 255 > `ls /sys/kernel/debug/swap/energy/lcd/*/max_num` &&
+ /bin/echo 1000000 > `ls /sys/kernel/debug/swap/energy/lcd/*/max_denom` &&
# lcd min (white min - black min) / 2: 179 / 1
- echo 179 > `ls /sys/kernel/debug/swap/energy/lcd/*/min_num` &&
- echo 1000000 > `ls /sys/kernel/debug/swap/energy/lcd/*/min_denom`
+ /bin/echo 179 > `ls /sys/kernel/debug/swap/energy/lcd/*/min_num` &&
+ /bin/echo 1000000 > `ls /sys/kernel/debug/swap/energy/lcd/*/min_denom`
fi
#Preload