Skip to content

Instantly share code, notes, and snippets.

@shakalaca
Last active December 21, 2018 13:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shakalaca/789637aea2014de53ef780075b7517b8 to your computer and use it in GitHub Desktop.
Save shakalaca/789637aea2014de53ef780075b7517b8 to your computer and use it in GitHub Desktop.
/vendor/etc/Storage_Benchmark.sh
#ASUS_BSP Deeo : set io_is_busy while benchmark +++
service StorageBench /vendor/bin/sh /vendor/etc/Storage_Benchmark.sh
class core
user root
oneshot
disabled
on property:sys.foregroundapp=*
start StorageBench
#ASUS_BSP Deeo : set io_is_busy while benchmark ---
#!/system/bin/sh
list=(
'com.quicinc.vellamo'
'com.andromeda.androbench2'
'com.a1dev.sdbench'
'com.futuremark.pcmark.android.benchmark'
)
checklist()
{
i=0
while [ $i -ne ${#list[@]} ]
do
if [ ${list[$i]} = $1 ]; then
echo 1
return
fi
((i++))
done
echo 0
return
}
#app=`getprop sys.storage.bchmode`
app=`getprop sys.foregroundapp`
#echo "onFgAPP is $app"
result=`checklist $app`
#echo $result
if [ $result != "0" ]; then
echo "set 1"
echo 1 > sys/devices/system/cpu/cpufreq/policy0/interactive/io_is_busy
echo 1 > sys/devices/system/cpu/cpufreq/policy4/interactive/io_is_busy
else
echo "set 0"
echo 0 > sys/devices/system/cpu/cpufreq/policy0/interactive/io_is_busy
echo 0 > sys/devices/system/cpu/cpufreq/policy4/interactive/io_is_busy
fi
if [ $app != "com.a1dev.sdbench" ];then
echo 20 > /proc/sys/vm/dirty_ratio
else
echo 1 > /proc/sys/vm/dirty_ratio
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment