summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2017-07-09 07:36:15 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2017-07-09 07:36:15 +0000
commit20785cc5402b466f7c4a732889a39302d1e9c1ee (patch)
treee559734b916b5dfcf4ffaa1c95e3b99a77c40538
parent1413c2fbc6ec8a0db65818a92ffcdc1418ff9901 (diff)
parentb5aca0236fdcb1f8934e2caf32397346676ffee3 (diff)
downloadextras-20785cc5402b466f7c4a732889a39302d1e9c1ee.tar.gz
release-request-bf3460d4-15ec-4b2b-816a-b106ef372c4b-for-git_oc-dr1-release-4164433 snap-temp-L62100000080728136
Change-Id: Ifa5085be0c2f72a313b95f08d4e2718698832508
-rw-r--r--app-launcher/README9
-rwxr-xr-xapp-launcher/app-launcher96
-rw-r--r--ext4_utils/Android.mk8
3 files changed, 68 insertions, 45 deletions
diff --git a/app-launcher/README b/app-launcher/README
index 238350e5..863a749a 100644
--- a/app-launcher/README
+++ b/app-launcher/README
@@ -5,6 +5,15 @@ Introduction: app-launcher is a script that launches apps many times,
measures various system metrics, computes basic stats for the metrics
and reports that stats.
+Setup:
+1) Make sure the device is seen via 'adb devices' and authorize adb via the
+popup dialog.
+2) Clear the setup wizard.
+3) Login to an android user test account.
+4) Clear the first time user dialogs on supported apps for your device (see
+below).
+5) Enable wifi and connect to a network (ex. GoogleGuest).
+
Launching app-launcher :
app-launcher -a|-b|-u [-c|-v|-s <serial number>] num-iterations
-a:Run on all cores
diff --git a/app-launcher/app-launcher b/app-launcher/app-launcher
index c9e4c8a4..703aafa0 100755
--- a/app-launcher/app-launcher
+++ b/app-launcher/app-launcher
@@ -306,48 +306,48 @@ get_volantis_devnames () {
system_stats_before() {
if [ $system_bdev_set == true ]; then
# Get BEFORE read stats for /system
- $adb shell 'cat /proc/diskstats' | grep -w $system_block_device > /tmp/$model-system
- BEFORE_RD_IOS_SYSTEM=`awk '{ print $4 }' /tmp/$model-system`
- BEFORE_RD_SECTORS_SYSTEM=`awk '{ print $6 }' /tmp/$model-system`
+ system=`$adb shell 'cat /proc/diskstats' | grep -w $system_block_device`
+ BEFORE_RD_IOS_SYSTEM=`echo $system | awk '{ print $4 }'`
+ BEFORE_RD_SECTORS_SYSTEM=`echo $system | awk '{ print $6 }'`
# iowait% computation
- $adb shell 'cat /proc/stat' | grep -w cpu > /tmp/procstat
- user_ticks_before=`awk '{ print ($2 + $3) }' /tmp/procstat`
- sys_ticks_before=`awk '{ print ($4 + $7 + $8) }' /tmp/procstat`
- cpubusy_ticks_before=`awk '{ print ($2 + $3 + $4 + $7 + $8) }' /tmp/procstat`
- iowait_ticks_before=`awk '{ print $6 }' /tmp/procstat`
- total_ticks_before=`awk '{ print ($2 + $3 + $4 + $5 + $7 + $8) }' /tmp/procstat`
+ procstat=`$adb shell 'cat /proc/stat' | grep -w cpu`
+ user_ticks_before=`echo $procstat | awk '{ print ($2 + $3) }'`
+ sys_ticks_before=`echo $procstat | awk '{ print ($4 + $7 + $8) }'`
+ cpubusy_ticks_before=`echo $procstat | awk '{ print ($2 + $3 + $4 + $7 + $8) }'`
+ iowait_ticks_before=`echo $procstat | awk '{ print $6 }'`
+ total_ticks_before=`echo $procstat | awk '{ print ($2 + $3 + $4 + $5 + $7 + $8) }'`
# Device util% computation
# Note hz=100, so multiplying uptime (in seconds) by 100, gives us
# the uptime in hz.
- $adb shell 'cat /proc/uptime' > /tmp/uptime
- uptime_before_hz=`awk '{ print ($1 * 100) }' /tmp/uptime`
+ uptime=`$adb shell 'cat /proc/uptime'`
+ uptime_before_hz=`echo $uptime | awk '{ print ($1 * 100) }'`
# Note that the device (busy) ticks is in ms. Since hz=100, dividing
# device (busy) ticks by 10, gives us this in the correct ticks units
- device_util_before_hz=`awk '{ print ($13 / 10) }' /tmp/$model-system`
+ device_util_before_hz=`echo $uptime | awk '{ print ($13 / 10) }'`
fi
}
system_stats_after() {
if [ $system_bdev_set == true ]; then
# Get AFTER read stats for /system
- $adb shell 'cat /proc/diskstats' | grep -w $system_block_device > /tmp/$model-system
- AFTER_RD_IOS_SYSTEM=`awk '{ print $4 }' /tmp/$model-system`
- AFTER_RD_SECTORS_SYSTEM=`awk '{ print $6 }' /tmp/$model-system`
+ system=`$adb shell 'cat /proc/diskstats' | grep -w $system_block_device`
+ AFTER_RD_IOS_SYSTEM=`echo $system | awk '{ print $4 }'`
+ AFTER_RD_SECTORS_SYSTEM=`echo $system | awk '{ print $6 }'`
# iowait% computation
- $adb shell 'cat /proc/stat' | grep -w cpu > /tmp/procstat
- user_ticks_after=`awk '{ print ($2 + $3) }' /tmp/procstat`
- sys_ticks_after=`awk '{ print ($4 + $7 + $8) }' /tmp/procstat`
- cpubusy_ticks_after=`awk '{ print ($2 + $3 + $4 + $7 + $8) }' /tmp/procstat`
- iowait_ticks_after=`awk '{ print $6 }' /tmp/procstat`
- total_ticks_after=`awk '{ print ($2 + $3 + $4 + $5 + $7 + $8) }' /tmp/procstat`
+ procstat=`$adb shell 'cat /proc/stat' | grep -w cpu`
+ user_ticks_after=`echo $procstat | awk '{ print ($2 + $3) }'`
+ sys_ticks_after=`echo $procstat | awk '{ print ($4 + $7 + $8) }'`
+ cpubusy_ticks_after=`echo $procstat | awk '{ print ($2 + $3 + $4 + $7 + $8) }'`
+ iowait_ticks_after=`echo $procstat | awk '{ print $6 }'`
+ total_ticks_after=`echo $procstat | awk '{ print ($2 + $3 + $4 + $5 + $7 + $8) }'`
# Device util% computation
# Note hz=100, so multiplying uptime (in seconds) by 100, gives us
# the uptime in hz.
- $adb shell 'cat /proc/uptime' > /tmp/uptime
- uptime_after_hz=`awk '{ print ($1 * 100) }' /tmp/uptime`
+ uptime=`$adb shell 'cat /proc/uptime'`
+ uptime_after_hz=`echo $uptime | awk '{ print ($1 * 100) }'`
# Note that the device (busy) ticks is in ms. Since hz=100, dividing
# device (busy) ticks by 10, gives us this in the correct ticks units
- device_util_after_hz=`awk '{ print ($13 / 10) }' /tmp/$model-system`
+ device_util_after_hz=`echo $system | awk '{ print ($13 / 10) }'`
fi
}
@@ -396,23 +396,23 @@ launch_app() {
}
launch_fugu_apps() {
- launch_app com.google.android.youtube.tv com.google.android.apps.youtube.tv.activity.TvGuideActivity > youtube-$model
- getstats youtube-$model YouTube
- launch_app com.google.android.play.games com.google.android.gms.games.pano.activity.PanoGamesOnboardHostActivity > games-$model
- getstats games-$model Games
- launch_app com.google.android.music com.android.music.activitymanagement.TopLevelActivity > music-$model
- getstats music-$model Music
+ launch_app com.google.android.youtube.tv com.google.android.apps.youtube.tv.activity.TvGuideActivity > $BASHPID-youtube-$model
+ getstats $BASHPID-youtube-$model YouTube
+ launch_app com.google.android.play.games com.google.android.gms.games.pano.activity.PanoGamesOnboardHostActivity > $BASHPID-games-$model
+ getstats $BASHPID-games-$model Games
+ launch_app com.google.android.music com.android.music.activitymanagement.TopLevelActivity > $BASHPID-music-$model
+ getstats $BASHPID-music-$model Music
}
launch_phone_apps() {
- launch_app com.android.chrome com.google.android.apps.chrome.Main > chrome-$model
- getstats chrome-$model Chrome
- launch_app com.google.android.GoogleCamera com.android.camera.CameraActivity > camera-$model
- getstats camera-$model Camera
- launch_app com.google.android.apps.maps com.google.android.maps.MapsActivity > maps-$model
- getstats maps-$model Maps
- launch_app com.google.android.youtube com.google.android.apps.youtube.app.WatchWhileActivity > youtube-$model
- getstats youtube-$model YouTube
+ launch_app com.android.chrome com.google.android.apps.chrome.Main > $BASHPID-chrome-$model
+ getstats $BASHPID-chrome-$model Chrome
+ launch_app com.google.android.GoogleCamera com.android.camera.CameraActivity > $BASHPID-camera-$model
+ getstats $BASHPID-camera-$model Camera
+ launch_app com.google.android.apps.maps com.google.android.maps.MapsActivity > $BASHPID-maps-$model
+ getstats $BASHPID-maps-$model Maps
+ launch_app com.google.android.youtube com.google.android.apps.youtube.app.WatchWhileActivity > $BASHPID-youtube-$model
+ getstats $BASHPID-youtube-$model YouTube
}
usage() {
@@ -432,21 +432,24 @@ usage() {
}
setup() {
- # Disable automatic rotation, NFC and wifi
- # This works on OC, but haven't tested on NYC or earlier
- $adb shell 'content insert --uri content://settings/system --bind name:s:accelerometer_rotation --bind value:i:0'
- $adb shell 'svc nfc disable'
- $adb shell 'svc wifi disable'
-
+ echo "Setting up device"
# Set developer options, will automatically 'Stay Awake'
$adb shell 'am start -n com.android.settings/.DevelopmentSettings'
# Set screen timeout to 30 minutes
$adb shell 'settings put system screen_off_timeout 1800000'
+
+ # TODO: Consider rebooting device to start with a clean state
+
+ # Disable automatic rotation and NFC
+ # This works on OC, but haven't tested on NYC or earlier
+ $adb shell 'content insert --uri content://settings/system --bind name:s:accelerometer_rotation --bind value:i:0'
+ $adb shell 'svc nfc disable'
+
# Clear all notifications
$adb shell 'service call notification 1'
# Go to home screen
$adb shell 'input keyevent KEYCODE_WAKEUP' && sleep 0.5
- $adb shell 'input keyevent KEYCODE_ENTER' && sleep 0.5
+ $adb shell 'input keyevent KEYCODE_MENU' && sleep 0.5
$adb shell 'input keyevent KEYCODE_HOME' && sleep 0.5
sleep 2
# TODO: kill all background apps
@@ -540,3 +543,6 @@ if [ $model == "fugu" ]; then
else # Phone Apps
launch_phone_apps
fi
+
+# cleanup
+rm $BASHPID*
diff --git a/ext4_utils/Android.mk b/ext4_utils/Android.mk
index 4e350b33..a80e473d 100644
--- a/ext4_utils/Android.mk
+++ b/ext4_utils/Android.mk
@@ -110,4 +110,12 @@ LOCAL_MODULE_CLASS := EXECUTABLES
LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/etc
include $(BUILD_PREBUILT)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := mke2fs.conf
+LOCAL_SRC_FILES := $(LOCAL_MODULE)
+LOCAL_MODULE_CLASS := ETC
+LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)
+include $(BUILD_PREBUILT)
+
endif