2015-03-10 13:09:31 +00:00
|
|
|
#!{{ device.binaries_directory.rstrip('/') }}/sh
|
|
|
|
|
|
|
|
|
|
|
|
{% for sensor in sensors %}
|
|
|
|
GET_{{ sensor.label }}="cat {{ sensor.filepath }}"
|
|
|
|
{% endfor %}
|
|
|
|
|
|
|
|
LAUNCH_COMMAND="am start -W -n {{ package }}/{{ activity }} {{ options }}"
|
|
|
|
STOP_COMMAND="am force-stop {{ package }}"
|
|
|
|
TEMP_FILE=tmp.txt
|
|
|
|
|
|
|
|
TIME_RESULT=""
|
|
|
|
{% for sensor in sensors %}
|
|
|
|
{{ sensor.label }}=""
|
|
|
|
{% endfor %}
|
|
|
|
|
|
|
|
cd {{ device.working_directory }}
|
|
|
|
|
|
|
|
# esc esc down down down ENTER (this should bring up the apps menu)
|
|
|
|
input keyevent 111
|
|
|
|
sleep 1
|
|
|
|
input keyevent 111
|
|
|
|
sleep 1
|
|
|
|
input keyevent 20
|
|
|
|
sleep 1
|
|
|
|
input keyevent 20
|
|
|
|
sleep 1
|
|
|
|
input keyevent 20
|
|
|
|
sleep 1
|
|
|
|
input keyevent 66
|
|
|
|
sleep 1
|
|
|
|
|
|
|
|
# Warm up caches.
|
|
|
|
$LAUNCH_COMMAND
|
|
|
|
$STOP_COMMAND
|
|
|
|
$LAUNCH_COMMAND
|
|
|
|
$STOP_COMMAND
|
|
|
|
$LAUNCH_COMMAND
|
|
|
|
$STOP_COMMAND
|
|
|
|
|
2016-01-14 23:52:50 -08:00
|
|
|
{% if io_scheduler != None %}
|
|
|
|
echo {{ io_scheduler }} > /sys/block/mmcblk0/queue/scheduler
|
|
|
|
{% endif %}
|
|
|
|
|
2016-03-23 16:28:18 +00:00
|
|
|
for i in $({{ busybox }} seq 1 {{ iterations }})
|
2015-03-10 13:09:31 +00:00
|
|
|
do
|
|
|
|
{% for sensor in sensors %}
|
|
|
|
{{ sensor.label }}="${{ sensor.label }} `$GET_{{ sensor.label }}`"
|
|
|
|
{% endfor %}
|
|
|
|
|
2016-01-14 23:52:50 -08:00
|
|
|
{% if io_stress %}
|
|
|
|
# Drop caches to get a cold start.
|
|
|
|
sync; echo 3 > /proc/sys/vm/drop_caches
|
|
|
|
# Run IO stress during App launch.
|
2016-03-23 16:28:18 +00:00
|
|
|
{{ busybox }} dd if=/dev/zero of=write.img bs=1048576 count=2000 conv=fsync > dd_write.txt 2>&1 &
|
2016-01-14 23:52:50 -08:00
|
|
|
io_write=$!
|
2016-03-23 16:28:18 +00:00
|
|
|
{{ busybox }} dd if=/dev/block/mmcblk0 of=/dev/null bs=1048576 > dd_read.txt 2>&1 &
|
2016-01-14 23:52:50 -08:00
|
|
|
io_read=$!
|
|
|
|
{% endif %}
|
|
|
|
|
2015-03-10 13:09:31 +00:00
|
|
|
$LAUNCH_COMMAND > $TEMP_FILE
|
|
|
|
|
|
|
|
{% for sensor in sensors %}
|
|
|
|
{{ sensor.label }}="${{ sensor.label }} `$GET_{{ sensor.label }}`"
|
|
|
|
{% endfor %}
|
|
|
|
|
2016-03-23 16:28:18 +00:00
|
|
|
TIME=`{{ busybox }} awk '{if($1~"TotalTime") print $2}' $TEMP_FILE`
|
2015-03-10 13:09:31 +00:00
|
|
|
TIME_RESULT="$TIME_RESULT $TIME"
|
|
|
|
{% if cleanup %}
|
|
|
|
rm $TEMP_FILE
|
2016-01-14 23:52:50 -08:00
|
|
|
{% if io_stress %}
|
|
|
|
kill $io_write
|
|
|
|
kill $io_read
|
|
|
|
rm -f write.img
|
|
|
|
{% endif %}
|
2015-03-10 13:09:31 +00:00
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
$STOP_COMMAND
|
|
|
|
sleep 2
|
|
|
|
done
|
|
|
|
|
|
|
|
{% for sensor in sensors %}
|
|
|
|
echo ${{ sensor.label }} > {{ sensor.label }}.result
|
|
|
|
{% endfor %}
|
|
|
|
echo $TIME_RESULT > time.result
|
|
|
|
# esc esc down down down ENTER (this should bring up the apps menu)
|
|
|
|
input keyevent 111
|
|
|
|
sleep 1
|