summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorTodd Kjos <tkjos@google.com>2015-07-17 12:52:59 -0700
committerTodd Kjos <tkjos@google.com>2015-07-17 12:53:40 -0700
commit99eb5eaeb69a8ebb496daa55dc92df4caf268947 (patch)
tree2350879938a85a064ddcba00ff6be45c9c2c1499 /tests
parentf7ae71d941f4ef0a99da449bf9e25423acf58cd2 (diff)
downloadextras-99eb5eaeb69a8ebb496daa55dc92df4caf268947.tar.gz
Workload script updates from bullhead/angler testing
Put test script in background if appropriate. Add ability to dump memory stats independent of atrace data. Bugfixes (fix atrace analysis when running on device). Change-Id: Ic7b0e6d315d4d9a56ff8d60ae841a19d0ff3a62f
Diffstat (limited to 'tests')
-rw-r--r--tests/workloads/atrace-uncompress.py2
-rwxr-xr-xtests/workloads/defs.sh53
-rwxr-xr-xtests/workloads/recentfling.sh8
-rwxr-xr-xtests/workloads/systemapps.sh23
4 files changed, 68 insertions, 18 deletions
diff --git a/tests/workloads/atrace-uncompress.py b/tests/workloads/atrace-uncompress.py
index d478e746..5efb6982 100644
--- a/tests/workloads/atrace-uncompress.py
+++ b/tests/workloads/atrace-uncompress.py
@@ -6,7 +6,7 @@
import sys, zlib
def main():
-
+
if len(sys.argv) != 2:
print >> sys.stderr, ('Usage: %s inputfile' % sys.argv[0])
sys.exit(1)
diff --git a/tests/workloads/defs.sh b/tests/workloads/defs.sh
index a2b71387..0f50fe16 100755
--- a/tests/workloads/defs.sh
+++ b/tests/workloads/defs.sh
@@ -16,15 +16,16 @@ youtubeActivity='com.google.android.youtube/com.google.android.apps.youtube.app.
cameraActivity='com.google.android.GoogleCamera/com.android.camera.CameraActivity'
playActivity='com.android.vending/com.google.android.finsky.activities.MainActivity'
feedlyActivity='com.devhd.feedly/com.devhd.feedly.Main'
-photosActivity='com.google.android.apps.plus/com.google.android.apps.photos.phone.PhotosHomeActivity'
+photosActivity='com.google.android.apps.photos/com.google.android.apps.photos.home.HomeActivity'
mapsActivity='com.google.android.apps.maps/com.google.android.maps.MapsActivity'
calendarActivity='com.google.android.calendar/com.android.calendar.AllInOneActivity'
earthActivity='com.google.earth/com.google.earth.EarthActivity'
-calculatorActivity='com.android.calculator2/com.android.calculator2.Calculator'
+calculatorActivity='com.google.android.calculator/com.android.calculator2.Calculator'
sheetsActivity='com.google.android.apps.docs.editors.sheets/com.google.android.apps.docs.app.NewMainProxyActivity'
docsActivity='com.google.android.apps.docs.editors.docs/com.google.android.apps.docs.app.NewMainProxyActivity'
operaActivity='com.opera.mini.native/com.opera.mini.android.Browser'
firefoxActivity='org.mozilla.firefox/org.mozilla.firefox.App'
+suntempleActivity='com.BrueComputing.SunTemple/com.epicgames.ue4.GameActivity'
homeActivity='com.google.android.googlequicksearchbox/com.google.android.launcher.GEL'
function showUsage {
@@ -97,6 +98,18 @@ else
isOnDevice=0
fi
+if [ $isOnDevice -gt 0 ]; then
+ case "$DEVICE" in
+ (bullhead|angler)
+ if ! echo $$ > /dev/cpuset/background/tasks; then
+ echo Could not put PID $$ in background
+ fi
+ ;;
+ (*)
+ ;;
+ esac
+fi
+
# default values if not set by options or calling script
appList=${appList:=$dfltAppList}
savetmpfiles=${savetmpfiles:=0}
@@ -109,7 +122,9 @@ ADB=${ADB:=""}
output=${output:="./out"}
# clear the output file
-> $output
+if [ -f $output ]; then
+ > $output
+fi
# ADB commands
AM_FORCE_START="${ADB}am start -W -S"
@@ -162,6 +177,7 @@ function log2msec {
in=$1
in=${in:=0.0}
set -- $(echo $in | tr . " ")
+
# shell addition via (( )) doesn't like leading zeroes in msecs
# field so remove leading zeroes
msecfield=$(expr 0 + $2)
@@ -209,7 +225,7 @@ function getEndTime {
function resetJankyFrames {
_gfxapp=$1
- _gfxapp=${app:="com.android.systemui"}
+ _gfxapp=${_gfxapp:="com.android.systemui"}
${ADB}dumpsys gfxinfo $_gfxapp reset 2>&1 >/dev/null
}
@@ -256,14 +272,21 @@ function checkForDirectReclaim {
}
function startInstramentation {
+ _iter=$1
+ _iter=${_iter:=0}
+ enableAtrace=$2
+ enableAtrace=${enableAtrace:=1}
# Called at beginning of loop. Turn on instramentation like atrace
vout start instramentation $(date)
echo =============================== >> $output
- echo Before iteration >> $output
+ echo Before iteration $_iter >> $output
echo =============================== >> $output
${ADB}cat /proc/meminfo 2>&1 >> $output
${ADB}dumpsys meminfo 2>&1 >> $output
- if [ "$user" = root ]; then
+ if [ "$DEVICE" = volantis ]; then
+ ${ADB}cat /d/nvmap/iovmm/procrank 2>&1 >> $output
+ fi
+ if [ "$user" = root -a $enableAtrace -gt 0 ]; then
vout ${ADB}atrace -b 32768 --async_start $tracecategories
${ADB}atrace -b 32768 --async_start $tracecategories >> $output
echo >> $output
@@ -271,14 +294,15 @@ function startInstramentation {
}
function stopInstramentation {
- if [ "$user" = root ]; then
+ enableAtrace=$1
+ enableAtrace=${enableAtrace:=1}
+ if [ "$user" = root -a $enableAtrace -gt 0 ]; then
vout ${ADB}atrace --async_stop
${ADB}atrace --async_stop > /dev/null
fi
}
function stopAndDumpInstramentation {
- # Called at beginning of loop. Turn on instramentation like atrace
vout stop instramentation $(date)
echo =============================== >> $output
echo After iteration >> $output
@@ -300,9 +324,9 @@ function stopAndDumpInstramentation {
python $UNCOMPRESS $tmpTrace >> $traceout
rm -f $tmpTrace
else
- ${ADB}atrace $zarg -b 32768 --async_dump >> $traceout
+ ${ADB}atrace -b 32768 --async_dump > $traceout
fi
- vout ${ADB}atrace $zarg --async_dump
+ vout ${ADB}atrace $zarg -b 32768 --async_dump
vout ${ADB}atrace --async_stop
${ADB}atrace --async_stop > /dev/null
fi
@@ -375,7 +399,14 @@ function checkActivity {
function doSwipe {
vout ${ADB}input swipe $*
- ${ADB}input swipe $*
+ ${ADB}nice input swipe $*
+}
+
+function doText {
+ echo $* > ./tmpOutput
+ vout ${ADB}input text \"$*\"
+ ${ADB}input text "$(cat ./tmpOutput)"
+ rm -f ./tmpOutput
}
function doTap {
diff --git a/tests/workloads/recentfling.sh b/tests/workloads/recentfling.sh
index 092c8d92..d495934e 100755
--- a/tests/workloads/recentfling.sh
+++ b/tests/workloads/recentfling.sh
@@ -44,6 +44,12 @@ case $DEVICE in
upCount=6
UP="70 400 70 100 $flingtime"
DOWN="70 100 70 400 $flingtime";;
+(angler)
+ flingtime=150
+ downCount=4
+ upCount=3
+ UP="500 1200 500 550 $flingtime"
+ DOWN="500 550 500 1200 $flingtime";;
(bullhead)
flingtime=200
downCount=5
@@ -122,7 +128,6 @@ do
latency99=$5
if [ ${totalDiff:=0} -eq 0 ]; then
echo Error: could not read frame info with \"dumpsys gfxinfo\"
- exit 1
fi
((frameSum=frameSum+totalDiff))
@@ -132,7 +137,6 @@ do
((latency99Sum=latency99Sum+latency99))
if [ "$totalDiff" -eq 0 ]; then
echo Error: no frames detected. Is the display off?
- exit 1
fi
((jankPct=jankyDiff*100/totalDiff))
resetJankyFrames
diff --git a/tests/workloads/systemapps.sh b/tests/workloads/systemapps.sh
index a263e7d2..eec1c146 100755
--- a/tests/workloads/systemapps.sh
+++ b/tests/workloads/systemapps.sh
@@ -23,12 +23,13 @@
# Other options are described below.
#
iterations=1
-tracecategories="gfx view am input memreclaim"
+tracecategories="gfx am memreclaim"
totaltimetest=0
forcecoldstart=0
waitTime=3.0
+memstats=0
-appList="gmail hangouts chrome youtube play home"
+appList="gmail maps chrome youtube play home"
function processLocalOption {
ret=0
@@ -38,6 +39,7 @@ function processLocalOption {
(-L) appList=$2; shift; ret=1;;
(-T) totaltimetest=1;;
(-W) waitTime=$2; shift; ret=1;;
+ (-M) memstats=1;;
(*)
echo "$0: unrecognized option: $1"
echo; echo "Usage: $0 [options]"
@@ -141,6 +143,7 @@ do
if [ $iterations -gt 1 ]; then
echo =========================================
echo Iteration $cur of $iterations
+ date
echo =========================================
fi
if [ $iterations -gt 1 -o $cur -eq 1 ]; then
@@ -160,8 +163,11 @@ do
if [ $totaltimetest -eq 0 ]; then
tmpTraceOut="$tmpTraceOutBase-$app.out"
>$tmpTraceOut
- startInstramentation
+ startInstramentation $cur
else
+ if [ "$memstats" -gt 0 ]; then
+ startInstramentation $cur 0
+ fi
if [ $appnum -eq 0 ]; then
printf "%-8s %5s(ms) %3s(ms) %s %s\n" App Start Iter Jank Latency
fi
@@ -239,6 +245,8 @@ if [ $totaltimetest -gt 0 ]; then
printf "%-10s %5.0f %5.0f\n" TOTAL $totaltime $diffTime
fi
+overallSum=0
+appCount=0
if [ $iterations -gt 1 -a $totaltimetest -eq 0 ]; then
echo
echo =========================================
@@ -258,7 +266,14 @@ if [ $iterations -gt 1 -a $totaltimetest -eq 0 ]; then
((ave90=l90/iterations))
((ave95=l95/iterations))
((ave99=l99/iterations))
- ((jankPct=100*janks/frames))
+ if [ $frames -gt 0 ]; then
+ ((jankPct=100*janks/frames))
+ fi
printf "%-12s %5d %5d %5d %5d %5d %5d(%d%%) %d/%d/%d\n" $app $1 $ave $2 $4 $5 $janks $jankPct $ave90 $ave95 $ave99
+ ((overallSum=overallSum+ave))
+ ((appCount=appCount+1))
done
+ if [ $appCount -gt 0 ]; then
+ printf "Average Start Time: %.2f\n", $(echo $overallSum $appCount | awk '{ printf "%.2f\n", $1/$2 }')
+ fi
fi