1#!/bin/sh
2
3parseoptions() {
4    verbose=false
5    user_experience=false
6    little_cores_off=false
7    iterations=0
8    pagecached=false
9
10    adb="adb"
11    while [ $# -gt 1 ]
12    do
13        case $1 in
14            -a)
15                ;;
16            -b)
17                little_cores_off=true
18                ;;
19            -c)
20                pagecached=true
21                ;;
22            -h)
23                usage
24                ;;
25            -s)
26                if [ -z $2 ]; then
27                    usage
28                fi
29                adb="adb -s $2"
30                shift
31                ;;
32            -u)
33                user_experience=true
34                ;;
35            -v)
36                verbose=true
37                ;;
38            *)
39                usage
40                ;;
41            esac
42        shift
43    done
44
45    iterations=$1
46    if [ $iterations -lt 100 ]; then
47        usage
48    fi
49}
50
51getstats () {
52    infile=$1
53    app=$2
54    echo "Data for $app :"
55
56    # Activity Manager reports ThisTime and TotalTime. TotalTime seems to be
57    # a more measure of the launch from the users perspective. So using TotalTime
58    # as our metric for launch latency
59
60    # From Activity Manager
61    echo "Launch Time (TotalTime) :"
62    fgrep TotalTime $infile | awk '{print $2}' | computestats
63
64    # Data from simpleperf
65    echo "cpu-cycles :"
66    fgrep cpu-cycles $infile | awk '{print $1}' | sed s/,//g | computestats
67
68    # CPU util% Data from /proc/stat
69    echo "cpu-util% :"
70    fgrep 'Total CPU util' $infile | awk '{print $5}' | computestatsf
71    echo "user-cpu-util% :"
72    fgrep 'User CPU util' $infile | awk '{print $5}' | computestatsf
73    echo "sys-cpu-util% (incl hardirq/softirq) :"
74    fgrep 'Sys CPU util' $infile | awk '{print $5}' | computestatsf
75
76    if [ $verbose == true ]; then
77        echo "instructions : "
78        fgrep instructions $infile | awk '{print $1}' | sed s/,//g | computestats
79
80        echo "cycles per instruction : "
81        fgrep instructions $infile | awk '{print $4}' | sed s/,//g | computestatsf
82
83        echo "branch-misses : "
84        fgrep branch-misses $infile | awk '{print $1}' | sed s/,//g | computestats
85
86        echo "context-switches : "
87        fgrep context-switches $infile | awk '{print $1}' | sed s/,//g | computestats
88
89        echo "page-faults : "
90        fgrep page-faults $infile | awk '{print $1}' | sed s/,//g | computestats
91    fi
92
93    if [ $system_bdev_set == true ]; then
94        # (Storage) Data from /proc we've collected
95        echo "KB read for $system_block_device blkdev :"
96        fgrep KB $infile | grep system | awk '{print $5}' | computestats
97
98        echo "iowait% :"
99        fgrep IOwait $infile | awk '{print $3}' | computestatsf
100
101        echo "Device util% for $system_block_device blkdev :"
102        fgrep 'Device util' $infile | awk '{print $4}' | computestatsf
103    fi
104}
105
106cpufreq_volantis() {
107    echo "Setting Governor to performance"
108    if [ $little_cores_off == true ]; then
109        echo "Cannot turn off Little cores on $model"
110        exit 1
111    fi
112    i=0
113    num_cores=2
114    while [ $i -lt  $num_cores ]
115    do
116        $adb shell "echo performance  > /sys/devices/system/cpu/cpu$i/cpufreq/scaling_g\
117overnor"
118        $adb shell "echo 2499000 > /sys/devices/system/cpu/cpu$i/cpufreq/scaling_max_fr\
119eq"
120        i=`expr $i + 1`
121    done
122    # Lock the GPU frequencies
123    echo -n 852000000 > /d/clock/override.gbus/rate
124    echo -n 1 > /d/clock/override.gbus/state
125}
126
127cpufreq_fugu() {
128    echo "Setting Governor to performance"
129    if [ $little_cores_off == true ]; then
130        echo "Cannot turn off Little cores on $model"
131        exit 1
132    fi
133    i=0
134    num_cores=4
135    while [ $i -lt  $num_cores ]
136    do
137        $adb shell "echo performance  > /sys/devices/system/cpu/cpu$i/cpufreq/scaling_governor"
138        $adb shell "echo 1833000 > /sys/devices/system/cpu/cpu$i/cpufreq/scaling_max_freq"
139        i=`expr $i + 1`
140    done
141}
142
143cpufreq_taimen_walleye () {
144    echo "Setting Governor to performance"
145    # GPU Governor and Frequency
146    $adb shell 'echo performance > /sys/class/kgsl/kgsl-3d0/devfreq/governor'
147    $adb shell 'echo 624000000 > /sys/class/kgsl/kgsl-3d0/devfreq/max_freq'
148    if [ $little_cores_off == true ]; then
149        # Disable Little Cores, force app to run on big cores
150        echo "Disabling Little Cores"
151        $adb shell 'echo 0 > /sys/devices/system/cpu/cpu0/online'
152        $adb shell 'echo 0 > /sys/devices/system/cpu/cpu1/online'
153        $adb shell 'echo 0 > /sys/devices/system/cpu/cpu2/online'
154        $adb shell 'echo 0 > /sys/devices/system/cpu/cpu3/online'
155    else
156        echo "Enabling All Cores"
157        $adb shell 'echo 1 > /sys/devices/system/cpu/cpu0/online'
158        $adb shell 'echo 1 > /sys/devices/system/cpu/cpu1/online'
159        $adb shell 'echo 1 > /sys/devices/system/cpu/cpu2/online'
160        $adb shell 'echo 1 > /sys/devices/system/cpu/cpu3/online'
161        $adb shell 'echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor'
162        $adb shell 'echo 1900800 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq'
163    fi
164    # Set Governor to performance, up scaling_max_frequency to highest
165    $adb shell 'echo performance  > /sys/devices/system/cpu/cpu4/cpufreq/scaling_governor'
166    # Only necessary to set max_freq on cpu4, cpu5-7 are in same cluster and will
167    # automatically get the same settings
168    $adb shell 'echo 2457600 > /sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq'
169}
170
171cpufreq_marlin_sailfish () {
172    echo "Setting Governor to performance"
173    # GPU Governor and Frequency
174    $adb shell 'echo performance > /sys/class/kgsl/kgsl-3d0/devfreq/governor'
175    $adb shell 'echo 624000000 > /sys/class/kgsl/kgsl-3d0/devfreq/max_freq'
176    if [ $little_cores_off == true ]; then
177        # Disable Little Cores, force app to run on big cores
178        echo "Disabling Little Cores"
179        $adb shell 'echo 0 > /sys/devices/system/cpu/cpu0/online'
180        $adb shell 'echo 0 > /sys/devices/system/cpu/cpu1/online'
181    else
182        echo "Enabling All Cores"
183        $adb shell 'echo 1 > /sys/devices/system/cpu/cpu0/online'
184        $adb shell 'echo 1 > /sys/devices/system/cpu/cpu1/online'
185        $adb shell 'echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor'
186        $adb shell 'echo 1996800 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq'
187        # cpu1 needed ?
188        $adb shell 'echo performance > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor'
189        $adb shell 'echo 1996800 > /sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq'
190    fi
191    # Set Governor to performance, up scaling_max_frequency to highest
192    $adb shell 'echo performance  > /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor'
193    # Only necessary to set max_freq on cpu2, cpu3 is in same cluster and will
194    # automatically get the same settings
195    $adb shell 'echo 2150400 > /sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq'
196}
197
198cpufreq_angler () {
199    echo "Setting Governor and Frequency"
200    # GPU Governor and Frequency
201    $adb shell "echo performance > /sys/class/kgsl/kgsl-3d0/devfreq/governor"
202    $adb shell "echo 0 > /sys/class/kgsl/kgsl-3d0/bus_split"
203    $adb shell "echo 1 > /sys/class/kgsl/kgsl-3d0/force_clk_on"
204    $adb shell "echo 10000 > /sys/class/kgsl/kgsl-3d0/idle_timer"
205    if [ $little_cores_off == true ]; then
206        # Disable Little Cores, force app to run on big cores
207        echo "Disabling Little Cores"
208        i=0
209        num_cores=4
210        while [ $i -lt $num_cores ]
211        do
212            $adb shell "echo 0 > /sys/devices/system/cpu/cpu$i/online"
213            i=`expr $i + 1`
214        done
215    else
216        echo "Enabling All Cores"
217        # Enable Little cores here, set governor to performance
218        # Lock frequency of little cores
219        i=0
220        num_cores=4
221        while [ $i -lt $num_cores ]
222        do
223            $adb shell "echo 1 > /sys/devices/system/cpu/cpu$i/online"
224            $adb shell "echo performance > /sys/devices/system/cpu/cpu$i/cpufreq/scaling_governor"
225            # Lock frequency of little cores
226            $adb shell "echo 1555200 > /sys/devices/system/cpu/cpu$i/cpufreq/scaling_max_freq"
227            i=`expr $i + 1`
228        done
229    fi
230    i=4
231    num_cores=8
232    while [ $i -lt $num_cores ]
233    do
234        $adb shell "echo performance > /sys/devices/system/cpu/cpu$i/cpufreq/scaling_governor"
235        # Lock frequency of big cores
236        $adb shell "echo 1958400 > /sys/devices/system/cpu/cpu$i/cpufreq/scaling_max_freq"
237        i=`expr $i + 1`
238    done
239}
240
241cpufreq_go() {
242    echo "Setting Governor to performance"
243    adb shell 'echo 0 > /proc/hps/enabled'
244    for i in 0 1 2 3
245    do
246	adb shell "echo 1 > /sys/devices/system/cpu/cpu$i/online"
247	adb shell "echo performance > /sys/devices/system/cpu/cpu$i/cpufreq/scaling_governor"
248	adb shell "echo 1092000 > /sys/devices/system/cpu/cpu$i/cpufreq/scaling_max_freq"
249    done
250}
251
252get_taimen_walleye_devnames () {
253    # This bit of code required to get the block dev for /system and /vendor
254    # Suffix can be _a or _b, depending on what the active /system partition is
255#    suffix=`$adb shell getprop ro.boot.slot_suffix`
256    # Get the blockdevice using the suffix we got above
257#    system_block_device=`$adb shell ls -l /dev/block/platform/soc/*ufs*/by-name/system$suffix | awk '{ print $10 }' `
258    # Vendor is more straightforward, but we don't use it right now
259#    vendor_block_device=`$adb shell df /vendor | grep -v Filesystem | awk '{print $1}' `
260    # finally extract the last component of the absolute device pathname we got above
261#    system_block_device=`echo $system_block_device | awk 'BEGIN { FS ="/" } ; { print $4 }' `
262#    vendor_block_device=`echo $vendor_block_device | awk 'BEGIN { FS ="/" } ; { print $4 }' `
263    system_bdev_set=true
264#   For now, hardcode sda for Marlin/Sailfish block device
265#   XXX - We'll get stats for entire device
266    system_block_device=sda
267    echo Block Device $system_block_device
268}
269
270#
271# This strange bit of logic is needed to get the underlying block devices for /system
272# for Marlin/Sailfish
273#
274get_marlin_sailfish_devnames () {
275    # This bit of code required to get the block dev for /system and /vendor
276    # Suffix can be _a or _b, depending on what the active /system partition is
277#    suffix=`$adb shell getprop ro.boot.slot_suffix`
278    # Get the blockdevice using the suffix we got above
279#    system_block_device=`$adb shell ls -l /dev/block/platform/soc/*ufs*/by-name/system$suffix | awk '{ print $10 }' `
280    # Vendor is more straightforward, but we don't use it right now
281#    vendor_block_device=`$adb shell df /vendor | grep -v Filesystem | awk '{print $1}' `
282    # finally extract the last component of the absolute device pathname we got above
283#    system_block_device=`echo $system_block_device | awk 'BEGIN { FS ="/" } ; { print $4 }' `
284#    vendor_block_device=`echo $vendor_block_device | awk 'BEGIN { FS ="/" } ; { print $4 }' `
285    system_bdev_set=true
286#   For now, hardcode sda for Marlin/Sailfish block device
287#   XXX - We'll get stats for entire device
288    system_block_device=sda
289    echo Block Device $system_block_device
290}
291
292get_angler_devnames () {
293    # Get the underlying bdev from the "by-name" mapping
294    system_block_device=`$adb shell 'find /dev/block/platform -name by-name | xargs ls -l' | grep system | awk '{ print $10 }' `
295    # extract the last component of the absolute device pathname we got above
296    system_block_device=`echo $system_block_device | awk 'BEGIN { FS ="/" } ; { print $4 }' `
297    # vendor is unused right now, but get the bdev anyway in case we decide to use it
298    # Get the underlying bdev from the "by-name" mapping
299    vendor_block_device=`$adb shell 'find /dev/block/platform -name by-name | xargs ls -l' | grep vendor | awk '{ print $10 }' `
300    # extract the last component of the absolute device pathname we got above
301   vendor_block_device=`echo $vendor_block_device | awk 'BEGIN { FS ="/" } ; { print $4 }' `
302   system_bdev_set=true
303}
304
305get_fugu_devnames () {
306    system_block_device=`$adb shell ls -l /dev/block/by-name/system | awk '{ print $10 }' `
307    system_block_device=`echo $system_block_device | awk 'BEGIN { FS ="/" } ; { print $4 }' `
308    system_bdev_set=true
309}
310
311dev_name_default_mmc () {
312    system_block_device=mmcblk0
313    system_bdev_set=true
314}
315
316get_volantis_devnames () {
317    dev_name_default_mmc
318}
319
320get_go_devnames () {
321    dev_name_default_mmc
322}
323
324system_stats_before() {
325    if [ $system_bdev_set == true ]; then
326        # Get BEFORE read stats for /system
327        system=`$adb shell 'cat /proc/diskstats' | grep -w $system_block_device`
328        BEFORE_RD_IOS_SYSTEM=`echo $system | awk '{ print $4 }'`
329        BEFORE_RD_SECTORS_SYSTEM=`echo $system | awk '{ print $6 }'`
330        # iowait% computation
331        procstat=`$adb shell 'cat /proc/stat' | grep -w cpu`
332        user_ticks_before=`echo $procstat | awk '{ print ($2 + $3) }'`
333        sys_ticks_before=`echo $procstat | awk '{ print ($4 + $7 + $8) }'`
334        cpubusy_ticks_before=`echo $procstat | awk '{ print ($2 + $3 + $4 + $7 + $8) }'`
335        iowait_ticks_before=`echo $procstat | awk '{ print $6 }'`
336        total_ticks_before=`echo $procstat | awk '{ print ($2 + $3 + $4 + $5 + $7 + $8) }'`
337        # Device util% computation
338        # Note hz=100, so multiplying uptime (in seconds) by 100, gives us
339        # the uptime in hz.
340        uptime=`$adb shell 'cat /proc/uptime'`
341        uptime_before_hz=`echo $uptime | awk '{ print ($1 * 100) }'`
342        # Note that the device (busy) ticks is in ms. Since hz=100, dividing
343        # device (busy) ticks by 10, gives us this in the correct ticks units
344        device_util_before_hz=`echo $uptime | awk '{ print ($13 / 10) }'`
345    fi
346}
347
348system_stats_after() {
349    if [ $system_bdev_set == true ]; then
350        # Get AFTER read stats for /system
351        system=`$adb shell 'cat /proc/diskstats' | grep -w $system_block_device`
352        AFTER_RD_IOS_SYSTEM=`echo $system | awk '{ print $4 }'`
353        AFTER_RD_SECTORS_SYSTEM=`echo $system | awk '{ print $6 }'`
354        # iowait% computation
355        procstat=`$adb shell 'cat /proc/stat' | grep -w cpu`
356        user_ticks_after=`echo $procstat | awk '{ print ($2 + $3) }'`
357        sys_ticks_after=`echo $procstat | awk '{ print ($4 + $7 + $8) }'`
358        cpubusy_ticks_after=`echo $procstat | awk '{ print ($2 + $3 + $4 + $7 + $8) }'`
359        iowait_ticks_after=`echo $procstat | awk '{ print $6 }'`
360        total_ticks_after=`echo $procstat | awk '{ print ($2 + $3 + $4 + $5 + $7 + $8) }'`
361        # Device util% computation
362        # Note hz=100, so multiplying uptime (in seconds) by 100, gives us
363        # the uptime in hz.
364        uptime=`$adb shell 'cat /proc/uptime'`
365        uptime_after_hz=`echo $uptime | awk '{ print ($1 * 100) }'`
366        # Note that the device (busy) ticks is in ms. Since hz=100, dividing
367        # device (busy) ticks by 10, gives us this in the correct ticks units
368        device_util_after_hz=`echo $system | awk '{ print ($13 / 10) }'`
369    fi
370}
371
372system_stats_delta() {
373    if [ $system_bdev_set == true ]; then
374        # Sectors to KB
375        READ_KB_SYSTEM=`expr $AFTER_RD_SECTORS_SYSTEM - $BEFORE_RD_SECTORS_SYSTEM`
376        READ_KB_SYSTEM=`expr $READ_KB_SYSTEM / 2`
377        echo Read IOs /system = `expr $AFTER_RD_IOS_SYSTEM - $BEFORE_RD_IOS_SYSTEM`
378        echo Read KB /system = $READ_KB_SYSTEM
379        echo $iowait_ticks_before $iowait_ticks_after $total_ticks_before $total_ticks_after | awk '{ printf "IOwait = %.2f\n", (($2 - $1) * 100.0) / ($4 - $3) }'
380        echo $device_util_before_hz $device_util_after_hz $uptime_before_hz $uptime_after_hz | awk '{ printf "Device util% = %.2f\n", (($2 - $1) * 100.0) / ($4 - $3) }'
381        echo $user_ticks_after $user_ticks_before $total_ticks_after $total_ticks_before | awk '{ printf "User CPU util% = %.2f\n", (($1 - $2) * 100.0) / ($3 - $4) }'
382        echo $sys_ticks_after $sys_ticks_before $total_ticks_after $total_ticks_before | awk '{ printf "Sys CPU util% = %.2f\n", (($1 - $2) * 100.0) / ($3 - $4) }'
383        echo $cpubusy_ticks_after $cpubusy_ticks_before $total_ticks_after $total_ticks_before | awk '{ printf "Total CPU util% = %.2f\n", (($1 - $2) * 100.0) / ($3 - $4) }'
384    fi
385}
386
387launch_app() {
388    package=$1
389    activity=$2
390    $adb shell "am force-stop $package"
391    sleep 1
392
393    printf "Testing %s: \n" "$package" 1>&2
394    i=0
395    while [ $i -lt $iterations ]
396    do
397        if [ $pagecached == false ]; then
398            $adb shell 'echo 3 > /proc/sys/vm/drop_caches'
399        fi
400        printf '[ %d%% ]\r' "$(($i * 100 / $iterations))" 1>&2
401        # The -W argument to am start forces am start to wait till the launch completes.
402        # The -S argument forces it to kill any existing app that is running first
403        # eg. adb shell 'am start -W -S -n com.android.chrome/com.google.android.apps.chrome.Main'
404        system_stats_before
405        $adb shell "simpleperf stat -a am start -W -n $package/$activity"
406        system_stats_after
407        system_stats_delta
408        sleep 1
409        $adb shell "am force-stop $package"
410        sleep 1
411        i=`expr $i + 1`
412    done
413    printf "\n" 1>&2
414}
415
416launch_fugu_apps() {
417    launch_app com.google.android.youtube.tv com.google.android.apps.youtube.tv.activity.TvGuideActivity > $BASHPID-youtube-$model
418    getstats $BASHPID-youtube-$model YouTube
419    launch_app com.google.android.play.games com.google.android.gms.games.pano.activity.PanoGamesOnboardHostActivity > $BASHPID-games-$model
420    getstats $BASHPID-games-$model Games
421    launch_app com.google.android.music com.android.music.activitymanagement.TopLevelActivity > $BASHPID-music-$model
422    getstats $BASHPID-music-$model Music
423}
424
425launch_phone_apps() {
426    launch_app com.android.chrome com.google.android.apps.chrome.Main > $BASHPID-chrome-$model
427    getstats $BASHPID-chrome-$model Chrome
428    launch_app com.google.android.GoogleCamera com.android.camera.CameraActivity > $BASHPID-camera-$model
429    getstats $BASHPID-camera-$model Camera
430    launch_app com.google.android.apps.maps com.google.android.maps.MapsActivity > $BASHPID-maps-$model
431    getstats $BASHPID-maps-$model Maps
432    launch_app com.google.android.youtube com.google.android.apps.youtube.app.WatchWhileActivity > $BASHPID-youtube-$model
433    getstats $BASHPID-youtube-$model YouTube
434}
435
436launch_go_apps() {
437    launch_app com.android.chrome com.google.android.apps.chrome.Main > $BASHPID-chrome-$model
438    getstats $BASHPID-chrome-$model Chrome
439    launch_app com.google.android.gm .ConversationListActivityGmail > $BASHPID-gmail-$model
440    getstats $BASHPID-gmail-$model Gmail
441    launch_app com.google.android.videos .mobile.usecase.home.RootActivity > $BASHPID-movies-$model
442    getstats $BASHPID-movies-$model Movies
443    launch_app com.android.vending com.google.android.finsky.activities.MainActivity > $BASHPID-play-$model
444    getstats $BASHPID-play-$model Play
445}
446
447usage() {
448    echo 'Usage: app-launcher [-c|-v|-s <serial num>] -a|-b|-u num-iterations'
449    echo 'where num-iterations >= 100'
450    echo '-v (optional) for verbose stats dump'
451    echo '-s <serial num> (optional) run test on specific device'
452    echo '-a|-b|-u required:'
453    echo '        -a:all cores'
454    echo '        -b:only big cores'
455    echo '        -c:pagecached. Do not drop pagecache before each launch (not default)'
456    echo '        -h:Dump this help menu'
457    echo '        -u:user experience, no change to cpu/gpu frequencies or governors'
458    echo '        -a/-b locks CPU/GPU freqs to max, performance governor, thermal/perfd off'
459    echo '        -u runs with default device configs, as users would see it'
460    exit 1
461}
462
463setup() {
464    echo "Setting up device"
465    # Set developer options, will automatically 'Stay Awake'
466    $adb shell 'am start -n com.android.settings/.DevelopmentSettings'
467    # Set screen timeout to 30 minutes
468    $adb shell 'settings put system screen_off_timeout 1800000'
469
470    # TODO: Consider rebooting device to start with a clean state
471
472    # Disable automatic rotation and NFC
473    # This works on OC, but haven't tested on NYC or earlier
474    $adb shell 'content insert --uri content://settings/system --bind name:s:accelerometer_rotation --bind value:i:0'
475    $adb shell 'svc nfc disable'
476
477    # Clear all notifications
478    $adb shell 'service call notification 1'
479    # Go to home screen
480    $adb shell 'input keyevent KEYCODE_WAKEUP' && sleep 0.5
481    $adb shell 'input keyevent KEYCODE_MENU'   && sleep 0.5
482    $adb shell 'input keyevent KEYCODE_HOME'   && sleep 0.5
483    sleep 2
484    # TODO: kill all background apps
485    # TODO: clear popups
486}
487
488#
489# The main() part of the script follows :
490#
491
492if [ $# -lt 2 ]; then
493    usage
494fi
495
496which computestats > /dev/null
497if [ $? != 0 ]; then
498    echo "ERROR: Please add computestats utiliy to your PATH"
499    exit 1
500fi
501
502which computestatsf > /dev/null
503if [ $? != 0 ]; then
504    echo "Error: Please add computestatsf utility to your PATH"
505    exit 1
506fi
507
508parseoptions $@
509
510$adb root && $adb wait-for-device
511
512if [ $user_experience == false ]; then
513    # Important to stop the thermal-engine to prevent throttling while test is running
514    # and stop perfd
515    $adb shell 'stop thermal-engine'
516    $adb shell 'stop perfd'
517else
518    echo "User Experience: Default Configs. No changes to cpufreq settings"
519fi
520
521model=`$adb shell getprop ro.product.name`
522# Releases are inconsistent with various trailing characters, remove them all
523model=`echo $model | sed 's/[ \t\r\n]*$//' `
524
525echo Found $model Device
526
527system_bdev_set=false
528case $model in
529    # Android Go
530    aosp_gobo | full_k37_y33_gms)
531	if [ $user_experience == false ]; then
532	    cpufreq_go
533        fi
534	get_go_devnames
535        ;;
536    taimen | muskie | walleye)
537        if [ $user_experience == false ]; then
538            cpufreq_taimen_walleye
539        fi
540        get_taimen_walleye_devnames
541        ;;
542    marlin | sailfish)
543        if [ $user_experience == false ]; then
544            cpufreq_marlin_sailfish
545        fi
546        get_marlin_sailfish_devnames
547        ;;
548    angler)
549        if [ $user_experience == false ]; then
550            cpufreq_angler
551        fi
552        get_angler_devnames
553        ;;
554    fugu)
555        if [ $user_experience == false ]; then
556            cpufreq_fugu
557        fi
558        get_fugu_devnames
559        ;;
560    volantis | volantisg)
561        if [ $user_experience == false ]; then
562            cpufreq_volantis
563        fi
564        get_volantis_devnames
565        ;;
566    *)
567        echo Unknown Device $model
568        exit 1
569        ;;
570esac
571
572setup
573
574#
575# launch each app in turn
576#
577case $model in
578    # Android Go
579    aosp_gobo | full_k37_y33_gms)
580	launch_go_apps
581	;;
582    fugu)
583	launch_fugu_apps
584        ;;
585    *)
586	launch_phone_apps
587        ;;
588esac
589
590# cleanup
591rm $BASHPID*
592