blob: 97dbf7b9f77dc53aa963abe5f8f356475b63755b [file] [log] [blame]
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# EAS Testing - Recents Fling on Android"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The goal of this experiment is to collect frame statistics while swiping up and down tabs of recently opened applications on a Pixel device running Android with an EAS kernel. This process is name **Recents Fling**. The Analysis phase will consist in comparing EAS with other schedulers, that is comparing *sched* governor with:\n",
"\n",
" - interactive\n",
" - performance\n",
" - powersave\n",
" - ondemand\n",
" \n",
"For this experiment it is recommended to open many applications so that we can swipe over more recently opened applications."
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"2016-12-09 14:58:45,902 INFO : root : Using LISA logging configuration:\n",
"2016-12-09 14:58:45,902 INFO : root : /home/vagrant/lisa/logging.conf\n"
]
}
],
"source": [
"import logging\n",
"from conf import LisaLogging\n",
"LisaLogging.setup()"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Populating the interactive namespace from numpy and matplotlib\n"
]
}
],
"source": [
"%pylab inline\n",
"\n",
"import os\n",
"from time import sleep\n",
"\n",
"# Support to access the remote target\n",
"import devlib\n",
"from env import TestEnv\n",
"\n",
"# Import support for Android devices\n",
"from android import Screen, Workload\n",
"\n",
"from devlib.utils.android import adb_command\n",
"\n",
"# Support for trace events analysis\n",
"from trace import Trace\n",
"\n",
"# Suport for FTrace events parsing and visualization\n",
"import trappy"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Test environment setup\n",
"For more details on this please check out **examples/utils/testenv_example.ipynb**."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"**devlib** requires the ANDROID_HOME environment variable configured to point to your local installation of the Android SDK. If you have not this variable configured in the shell used to start the notebook server, you need to run a cell to define where your Android SDK is installed or specify the ANDROID_HOME in your target configuration.\n",
"\n",
"In case more than one Android device are conencted to the host, you must specify the ID of the device you want to target in **my_target_conf**. Run **adb devices** on your host to get the ID."
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"import os\n",
"os.environ['ANDROID_HOME'] = '/ext/android-sdk-linux/'"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"In case more than one Android device are conencted to the host, you must specify the ID of the device you want to target in `my_target_conf`. Run `adb devices` on your host to get the ID."
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"# Setup a target configuration\n",
"my_conf = {\n",
" \n",
" # Target platform and board\n",
" \"platform\" : 'android',\n",
" \"board\" : 'pixel',\n",
"\n",
" # Device ID\n",
" \"device\" : \"HT6670300102\",\n",
" \n",
" # Android home\n",
" \"ANDROID_HOME\" : \"/home/vagrant/lisa/tools/android-sdk-linux\",\n",
"\n",
" # Folder where all the results will be collected\n",
" \"results_dir\" : \"Android_RecentsFling\",\n",
" \n",
" # Define devlib modules to load\n",
" \"modules\" : [\n",
" 'cpufreq' # enable CPUFreq support\n",
" ],\n",
"\n",
" # FTrace events to collect for all the tests configuration which have\n",
" # the \"ftrace\" flag enabled\n",
" \"ftrace\" : {\n",
" \"events\" : [\n",
" \"sched_switch\",\n",
" \"sched_load_avg_cpu\",\n",
" \"cpu_frequency\",\n",
" \"cpu_capacity\"\n",
" ],\n",
" \"buffsize\" : 10 * 1024,\n",
" },\n",
"\n",
" # Tools required by the experiments\n",
" \"tools\" : [ 'trace-cmd' ],\n",
"}"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {
"collapsed": false,
"scrolled": true
},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"2016-12-09 14:58:50,762 INFO : TestEnv : Using base path: /home/vagrant/lisa\n",
"2016-12-09 14:58:50,763 INFO : TestEnv : Loading custom (inline) target configuration\n",
"2016-12-09 14:58:50,764 INFO : TestEnv : External tools using:\n",
"2016-12-09 14:58:50,765 INFO : TestEnv : ANDROID_HOME: /home/vagrant/lisa/tools/android-sdk-linux\n",
"2016-12-09 14:58:50,766 INFO : TestEnv : CATAPULT_HOME: /home/vagrant/lisa/tools/catapult\n",
"2016-12-09 14:58:50,767 INFO : TestEnv : Loading board:\n",
"2016-12-09 14:58:50,767 INFO : TestEnv : /home/vagrant/lisa/libs/utils/platforms/pixel.json\n",
"2016-12-09 14:58:50,768 INFO : TestEnv : Devlib modules to load: [u'bl', u'cpufreq']\n",
"2016-12-09 14:58:50,768 INFO : TestEnv : Connecting Android target [HT6670300102]\n",
"2016-12-09 14:58:50,769 INFO : TestEnv : Connection settings:\n",
"2016-12-09 14:58:50,769 INFO : TestEnv : {'device': 'HT6670300102'}\n",
"2016-12-09 14:58:50,855 INFO : android : ls command is set to ls -1\n",
"2016-12-09 14:58:51,610 INFO : TestEnv : Initializing target workdir:\n",
"2016-12-09 14:58:51,613 INFO : TestEnv : /data/local/tmp/devlib-target\n",
"2016-12-09 14:58:54,009 INFO : TestEnv : Topology:\n",
"2016-12-09 14:58:54,012 INFO : TestEnv : [[0, 1], [2, 3]]\n",
"2016-12-09 14:58:54,279 INFO : TestEnv : Loading default EM:\n",
"2016-12-09 14:58:54,282 INFO : TestEnv : /home/vagrant/lisa/libs/utils/platforms/pixel.json\n",
"2016-12-09 14:58:55,219 INFO : TestEnv : Enabled tracepoints:\n",
"2016-12-09 14:58:55,220 INFO : TestEnv : sched_switch\n",
"2016-12-09 14:58:55,221 INFO : TestEnv : sched_load_avg_cpu\n",
"2016-12-09 14:58:55,221 INFO : TestEnv : cpu_frequency\n",
"2016-12-09 14:58:55,222 INFO : TestEnv : cpu_capacity\n",
"2016-12-09 14:58:55,222 WARNING : TestEnv : Wipe previous contents of the results folder:\n",
"2016-12-09 14:58:55,223 WARNING : TestEnv : /home/vagrant/lisa/results/Android_RecentsFling\n",
"2016-12-09 14:58:55,291 INFO : TestEnv : Set results folder to:\n",
"2016-12-09 14:58:55,291 INFO : TestEnv : /home/vagrant/lisa/results/Android_RecentsFling\n",
"2016-12-09 14:58:55,292 INFO : TestEnv : Experiment results available also in:\n",
"2016-12-09 14:58:55,292 INFO : TestEnv : /home/vagrant/lisa/results_latest\n"
]
}
],
"source": [
"# Initialize a test environment using:\n",
"te = TestEnv(my_conf)\n",
"target = te.target"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Support Functions"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"This set of support functions will help us running the benchmark using different CPUFreq governors."
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"def set_performance():\n",
" target.cpufreq.set_all_governors('performance')\n",
"\n",
"def set_powersave():\n",
" target.cpufreq.set_all_governors('powersave')\n",
"\n",
"def set_interactive():\n",
" target.cpufreq.set_all_governors('interactive')\n",
"\n",
"def set_sched():\n",
" target.cpufreq.set_all_governors('sched')\n",
"\n",
"def set_ondemand():\n",
" target.cpufreq.set_all_governors('ondemand')\n",
" \n",
" for cpu in target.list_online_cpus():\n",
" tunables = target.cpufreq.get_governor_tunables(cpu)\n",
" target.cpufreq.set_governor_tunables(\n",
" cpu,\n",
" 'ondemand',\n",
" **{'sampling_rate' : tunables['sampling_rate_min']}\n",
" )"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"# CPUFreq configurations to test\n",
"confs = {\n",
" 'performance' : {\n",
" 'label' : 'prf',\n",
" 'set' : set_performance,\n",
" },\n",
" 'powersave' : {\n",
" 'label' : 'pws',\n",
" 'set' : set_powersave,\n",
" },\n",
" 'interactive' : {\n",
" 'label' : 'int',\n",
" 'set' : set_interactive,\n",
" },\n",
" 'sched' : {\n",
" 'label' : 'sch',\n",
" 'set' : set_sched,\n",
" },\n",
" 'ondemand' : {\n",
" 'label' : 'odm',\n",
" 'set' : set_ondemand,\n",
" }\n",
"}\n",
"\n",
"# The set of results for each comparison test\n",
"results = {}"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"def open_apps(n):\n",
" \"\"\"\n",
" Open `n` apps on the device\n",
" \n",
" :param n: number of apps to open\n",
" :type n: int\n",
" \"\"\"\n",
" # Get a list of third-party packages\n",
" android_version = target.getprop('ro.build.version.release')\n",
" if android_version >= 'N':\n",
" packages = target.execute('cmd package list packages | cut -d: -f 2')\n",
" packages = packages.splitlines()\n",
" else:\n",
" packages = target.execute('pm list packages -3 | cut -d: -f 2')\n",
" packages = packages.splitlines()\n",
"\n",
" # As a safe fallback let's use a list of standard Android AOSP apps which are always available\n",
" if len(packages) < 8:\n",
" packages = [\n",
" 'com.android.messaging',\n",
" 'com.android.calendar',\n",
" 'com.android.settings',\n",
" 'com.android.calculator2',\n",
" 'com.android.email',\n",
" 'com.android.music',\n",
" 'com.android.deskclock',\n",
" 'com.android.contacts',\n",
" ]\n",
" \n",
" LAUNCH_CMD = 'monkey -p {} -c android.intent.category.LAUNCHER 1 '\n",
" \n",
" if n > len(packages):\n",
" n = len(packages)\n",
" \n",
" logging.info('Trying to open %d apps...', n)\n",
" started = 0\n",
" for app in packages:\n",
" logging.debug(' Launching %s', app)\n",
" try:\n",
" target.execute(LAUNCH_CMD.format(app))\n",
" started = started + 1\n",
" logging.info(' %2d starting %s...', started, app)\n",
" except Exception:\n",
" pass\n",
" if started >= n:\n",
" break\n",
" \n",
" # Close Recents\n",
" target.execute('input keyevent KEYCODE_HOME')\n"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"def recentsfling_run(exp_dir):\n",
" # Unlock device screen (assume no password required)\n",
" target.execute('input keyevent 82')\n",
"\n",
" # Configure screen to max brightness and no dimming\n",
" Screen.set_brightness(target, percent=100)\n",
" Screen.set_dim(target, auto=False)\n",
" Screen.set_timeout(target, 60*60*10) # 10 hours should be enought for an experiment\n",
"\n",
" # Open Recents on the target device\n",
" target.execute('input keyevent KEYCODE_APP_SWITCH')\n",
" # Allow the activity to start\n",
" sleep(5)\n",
" # Reset framestats collection\n",
" target.execute('dumpsys gfxinfo --reset')\n",
" \n",
" w, h = target.screen_resolution\n",
" x = w/2\n",
" yl = int(0.2*h)\n",
" yh = int(0.9*h)\n",
" \n",
" logging.info('Start Swiping Recents')\n",
" for i in range(5):\n",
" # Simulate two fast UP and DOWN swipes\n",
" target.execute('input swipe {} {} {} {} 50'.format(x, yl, x, yh))\n",
" sleep(0.3)\n",
" target.execute('input swipe {} {} {} {} 50'.format(x, yh, x, yl))\n",
" sleep(0.7)\n",
" logging.info('Swiping Recents Completed')\n",
" \n",
" # Reset screen brightness and auto dimming\n",
" Screen.set_defaults(target)\n",
"\n",
" # Get frame stats\n",
" framestats_file = os.path.join(exp_dir, \"framestats.txt\")\n",
" adb_command(target.adb_name, 'shell dumpsys gfxinfo com.android.systemui > {}'.format(framestats_file))\n",
" \n",
" # Close Recents\n",
" target.execute('input keyevent KEYCODE_HOME')\n",
"\n",
" return framestats_file"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"def experiment(governor, exp_dir):\n",
" os.system('mkdir -p {}'.format(exp_dir));\n",
"\n",
" logging.info('------------------------')\n",
" logging.info('Run workload using %s governor', governor)\n",
" confs[governor]['set']()\n",
" \n",
" # Start FTrace\n",
" te.ftrace.start()\n",
" \n",
" ### Run the benchmark ###\n",
" framestats_file = recentsfling_run(exp_dir)\n",
" \n",
" # Stop FTrace\n",
" te.ftrace.stop() \n",
"\n",
" # Collect and keep track of the trace\n",
" trace_file = os.path.join(exp_dir, 'trace.dat')\n",
" te.ftrace.get_trace(trace_file)\n",
" \n",
" # Parse trace\n",
" tr = Trace(te.platform, exp_dir,\n",
" events=my_conf['ftrace']['events'])\n",
" \n",
" # return all the experiment data\n",
" return {\n",
" 'dir' : exp_dir,\n",
" 'framestats_file' : framestats_file,\n",
" 'trace_file' : trace_file,\n",
" 'ftrace' : tr.ftrace,\n",
" 'trace' : tr\n",
" }"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Run Flinger"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Prepare Environment"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"N_APPS = 20"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"2016-12-09 14:59:08,075 INFO : root : Trying to open 8 apps...\n",
"2016-12-09 14:59:09,677 INFO : root : 1 starting com.android.settings...\n"
]
}
],
"source": [
"open_apps(N_APPS)\n",
"\n",
"# Give apps enough time to open\n",
"sleep(5)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Run workload and collect traces"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {
"collapsed": false,
"scrolled": false
},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"2016-12-09 14:59:18,399 INFO : root : ------------------------\n",
"2016-12-09 14:59:18,402 INFO : root : Run workload using performance governor\n",
"2016-12-09 14:59:20,895 INFO : Screen : Set brightness: 100%\n",
"2016-12-09 14:59:21,308 INFO : Screen : Dim screen mode: OFF\n",
"2016-12-09 14:59:21,782 INFO : Screen : Screen timeout: 36000 [s]\n",
"2016-12-09 14:59:27,693 INFO : root : Start Swiping Recents\n",
"2016-12-09 14:59:37,783 INFO : root : Swiping Recents Completed\n",
"2016-12-09 14:59:37,784 INFO : Screen : Set orientation: AUTO\n",
"2016-12-09 14:59:39,042 INFO : Screen : Set brightness: AUTO\n",
"2016-12-09 14:59:39,496 INFO : Screen : Dim screen mode: ON\n",
"2016-12-09 14:59:39,932 INFO : Screen : Screen timeout: 30 [s]\n",
"2016-12-09 14:59:45,387 INFO : Trace : Parsing FTrace format...\n",
"2016-12-09 14:59:53,031 INFO : Trace : Collected events spans a 21.305 [s] time interval\n",
"2016-12-09 14:59:53,031 INFO : Trace : Set plots time range to (0.000000, 21.305402)[s]\n",
"2016-12-09 14:59:53,032 INFO : Analysis : Registering trace analysis modules:\n",
"2016-12-09 14:59:53,033 INFO : Analysis : tasks\n",
"2016-12-09 14:59:53,034 INFO : Analysis : status\n",
"2016-12-09 14:59:53,034 INFO : Analysis : frequency\n",
"2016-12-09 14:59:53,035 INFO : Analysis : cpus\n",
"2016-12-09 14:59:53,036 INFO : Analysis : latency\n",
"2016-12-09 14:59:53,037 INFO : Analysis : idle\n",
"2016-12-09 14:59:53,038 INFO : Analysis : functions\n",
"2016-12-09 14:59:53,038 INFO : Analysis : eas\n",
"2016-12-09 14:59:53,051 INFO : root : ------------------------\n",
"2016-12-09 14:59:53,052 INFO : root : Run workload using sched governor\n",
"2016-12-09 14:59:56,256 INFO : Screen : Set brightness: 100%\n",
"2016-12-09 14:59:56,708 INFO : Screen : Dim screen mode: OFF\n",
"2016-12-09 14:59:57,303 INFO : Screen : Screen timeout: 36000 [s]\n",
"2016-12-09 15:00:03,345 INFO : root : Start Swiping Recents\n",
"2016-12-09 15:00:13,864 INFO : root : Swiping Recents Completed\n",
"2016-12-09 15:00:13,865 INFO : Screen : Set orientation: AUTO\n",
"2016-12-09 15:00:15,221 INFO : Screen : Set brightness: AUTO\n",
"2016-12-09 15:00:15,718 INFO : Screen : Dim screen mode: ON\n",
"2016-12-09 15:00:16,189 INFO : Screen : Screen timeout: 30 [s]\n",
"2016-12-09 15:00:27,259 INFO : Trace : Parsing FTrace format...\n",
"2016-12-09 15:00:35,017 INFO : Trace : Platform clusters verified to be Frequency coherent\n",
"2016-12-09 15:00:38,715 INFO : Trace : Collected events spans a 22.739 [s] time interval\n",
"2016-12-09 15:00:38,715 INFO : Trace : Set plots time range to (0.000000, 22.739051)[s]\n",
"2016-12-09 15:00:38,716 INFO : Analysis : Registering trace analysis modules:\n",
"2016-12-09 15:00:38,716 INFO : Analysis : tasks\n",
"2016-12-09 15:00:38,717 INFO : Analysis : status\n",
"2016-12-09 15:00:38,717 INFO : Analysis : frequency\n",
"2016-12-09 15:00:38,718 INFO : Analysis : cpus\n",
"2016-12-09 15:00:38,719 INFO : Analysis : latency\n",
"2016-12-09 15:00:38,719 INFO : Analysis : idle\n",
"2016-12-09 15:00:38,720 INFO : Analysis : functions\n",
"2016-12-09 15:00:38,720 INFO : Analysis : eas\n",
"2016-12-09 15:00:38,735 INFO : root : ------------------------\n",
"2016-12-09 15:00:38,736 INFO : root : Run workload using powersave governor\n",
"2016-12-09 15:00:49,017 INFO : Screen : Set brightness: 100%\n",
"2016-12-09 15:00:51,668 INFO : Screen : Dim screen mode: OFF\n",
"2016-12-09 15:00:54,328 INFO : Screen : Screen timeout: 36000 [s]\n",
"2016-12-09 15:01:03,584 INFO : root : Start Swiping Recents\n",
"2016-12-09 15:01:37,809 INFO : root : Swiping Recents Completed\n",
"2016-12-09 15:01:37,812 INFO : Screen : Set orientation: AUTO\n",
"2016-12-09 15:01:46,394 INFO : Screen : Set brightness: AUTO\n",
"2016-12-09 15:01:48,971 INFO : Screen : Dim screen mode: ON\n",
"2016-12-09 15:01:51,561 INFO : Screen : Screen timeout: 30 [s]\n",
"2016-12-09 15:02:17,487 INFO : Trace : Parsing FTrace format...\n",
"2016-12-09 15:02:33,993 INFO : Trace : Collected events spans a 75.655 [s] time interval\n",
"2016-12-09 15:02:33,994 INFO : Trace : Set plots time range to (0.000000, 75.654834)[s]\n",
"2016-12-09 15:02:33,994 INFO : Analysis : Registering trace analysis modules:\n",
"2016-12-09 15:02:33,995 INFO : Analysis : tasks\n",
"2016-12-09 15:02:33,996 INFO : Analysis : status\n",
"2016-12-09 15:02:33,996 INFO : Analysis : frequency\n",
"2016-12-09 15:02:33,997 INFO : Analysis : cpus\n",
"2016-12-09 15:02:33,997 INFO : Analysis : latency\n",
"2016-12-09 15:02:33,998 INFO : Analysis : idle\n",
"2016-12-09 15:02:33,998 INFO : Analysis : functions\n",
"2016-12-09 15:02:33,999 INFO : Analysis : eas\n",
"2016-12-09 15:02:34,022 INFO : root : ------------------------\n",
"2016-12-09 15:02:34,023 INFO : root : Run workload using ondemand governor\n",
"2016-12-09 15:02:41,668 INFO : Screen : Set brightness: 100%\n",
"2016-12-09 15:02:42,139 INFO : Screen : Dim screen mode: OFF\n",
"2016-12-09 15:02:42,656 INFO : Screen : Screen timeout: 36000 [s]\n",
"2016-12-09 15:02:48,429 INFO : root : Start Swiping Recents\n",
"2016-12-09 15:02:59,047 INFO : root : Swiping Recents Completed\n",
"2016-12-09 15:02:59,050 INFO : Screen : Set orientation: AUTO\n",
"2016-12-09 15:03:00,468 INFO : Screen : Set brightness: AUTO\n",
"2016-12-09 15:03:00,966 INFO : Screen : Dim screen mode: ON\n",
"2016-12-09 15:03:01,444 INFO : Screen : Screen timeout: 30 [s]\n",
"2016-12-09 15:03:12,685 INFO : Trace : Parsing FTrace format...\n",
"2016-12-09 15:03:21,734 INFO : Trace : Platform clusters verified to be Frequency coherent\n",
"2016-12-09 15:03:26,708 INFO : Trace : Collected events spans a 22.503 [s] time interval\n",
"2016-12-09 15:03:26,708 INFO : Trace : Set plots time range to (0.000000, 22.502716)[s]\n",
"2016-12-09 15:03:26,709 INFO : Analysis : Registering trace analysis modules:\n",
"2016-12-09 15:03:26,710 INFO : Analysis : tasks\n",
"2016-12-09 15:03:26,710 INFO : Analysis : status\n",
"2016-12-09 15:03:26,711 INFO : Analysis : frequency\n",
"2016-12-09 15:03:26,711 INFO : Analysis : cpus\n",
"2016-12-09 15:03:26,712 INFO : Analysis : latency\n",
"2016-12-09 15:03:26,712 INFO : Analysis : idle\n",
"2016-12-09 15:03:26,713 INFO : Analysis : functions\n",
"2016-12-09 15:03:26,713 INFO : Analysis : eas\n",
"2016-12-09 15:03:26,730 INFO : root : ------------------------\n",
"2016-12-09 15:03:26,731 INFO : root : Run workload using interactive governor\n",
"2016-12-09 15:03:29,716 INFO : Screen : Set brightness: 100%\n",
"2016-12-09 15:03:30,177 INFO : Screen : Dim screen mode: OFF\n",
"2016-12-09 15:03:30,645 INFO : Screen : Screen timeout: 36000 [s]\n",
"2016-12-09 15:03:36,422 INFO : root : Start Swiping Recents\n",
"2016-12-09 15:03:46,719 INFO : root : Swiping Recents Completed\n",
"2016-12-09 15:03:46,721 INFO : Screen : Set orientation: AUTO\n",
"2016-12-09 15:03:48,071 INFO : Screen : Set brightness: AUTO\n",
"2016-12-09 15:03:48,532 INFO : Screen : Dim screen mode: ON\n",
"2016-12-09 15:03:48,991 INFO : Screen : Screen timeout: 30 [s]\n",
"2016-12-09 15:03:55,795 INFO : Trace : Parsing FTrace format...\n",
"2016-12-09 15:04:06,933 INFO : Trace : Collected events spans a 21.791 [s] time interval\n",
"2016-12-09 15:04:06,934 INFO : Trace : Set plots time range to (0.000000, 21.791161)[s]\n",
"2016-12-09 15:04:06,934 INFO : Analysis : Registering trace analysis modules:\n",
"2016-12-09 15:04:06,935 INFO : Analysis : tasks\n",
"2016-12-09 15:04:06,936 INFO : Analysis : status\n",
"2016-12-09 15:04:06,936 INFO : Analysis : frequency\n",
"2016-12-09 15:04:06,937 INFO : Analysis : cpus\n",
"2016-12-09 15:04:06,938 INFO : Analysis : latency\n",
"2016-12-09 15:04:06,938 INFO : Analysis : idle\n",
"2016-12-09 15:04:06,939 INFO : Analysis : functions\n",
"2016-12-09 15:04:06,939 INFO : Analysis : eas\n"
]
}
],
"source": [
"# Unlock device screen (assume no password required)\n",
"target.execute('input keyevent 82')\n",
"\n",
"# Run the benchmark in all the configured governors\n",
"for governor in confs:\n",
" test_dir = os.path.join(te.res_dir, governor)\n",
" results[governor] = experiment(governor, test_dir)"
]
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": false
},
"source": [
"## UI Performance Analysis"
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Frame Statistics for PERFORMANCE governor\n",
"Stats since: 22107824648ns\n",
"Total frames rendered: 10844\n",
"Janky frames: 550 (5.07%)\n",
"50th percentile: 6ms\n",
"90th percentile: 11ms\n",
"95th percentile: 16ms\n",
"99th percentile: 61ms\n",
"\n",
"Frame Statistics for SCHED governor\n",
"Stats since: 22107824648ns\n",
"Total frames rendered: 11367\n",
"Janky frames: 555 (4.88%)\n",
"50th percentile: 6ms\n",
"90th percentile: 10ms\n",
"95th percentile: 16ms\n",
"99th percentile: 61ms\n",
"\n",
"Frame Statistics for POWERSAVE governor\n",
"Stats since: 22107824648ns\n",
"Total frames rendered: 11500\n",
"Janky frames: 645 (5.61%)\n",
"50th percentile: 6ms\n",
"90th percentile: 11ms\n",
"95th percentile: 18ms\n",
"99th percentile: 61ms\n",
"\n",
"Frame Statistics for ONDEMAND governor\n",
"Stats since: 22107824648ns\n",
"Total frames rendered: 11660\n",
"Janky frames: 661 (5.67%)\n",
"50th percentile: 6ms\n",
"90th percentile: 11ms\n",
"95th percentile: 18ms\n",
"99th percentile: 61ms\n",
"\n",
"Frame Statistics for INTERACTIVE governor\n",
"Stats since: 22107824648ns\n",
"Total frames rendered: 12174\n",
"Janky frames: 661 (5.43%)\n",
"50th percentile: 6ms\n",
"90th percentile: 11ms\n",
"95th percentile: 17ms\n",
"99th percentile: 61ms\n",
"\n"
]
}
],
"source": [
"for governor in confs:\n",
" framestats_file = results[governor]['framestats_file']\n",
" print \"Frame Statistics for {} governor\".format(governor.upper())\n",
" !sed '/Stats since/,/99th/!d;/99th/q' $framestats_file\n",
" print \"\""
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 2",
"language": "python",
"name": "python2"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.6"
},
"toc": {
"toc_cell": false,
"toc_number_sections": true,
"toc_threshold": 6,
"toc_window_display": false
}
},
"nbformat": 4,
"nbformat_minor": 0
}