aboutsummaryrefslogtreecommitdiffhomepage
path: root/infra
diff options
context:
space:
mode:
authorGravatar Kevin Lubick <kjlubick@google.com>2017-12-12 07:33:48 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-12-12 12:36:09 +0000
commitf1585aabeb23cf770c62dd9a1147df885f918671 (patch)
tree3cbdf960820678bf309be56b4508d4a31b991220 /infra
parent376fd31ad485c3df35d934c56364ff0c34eacdfa (diff)
Scale extra CPUs to powersave during nanobench.
This scaling logic correctly accounts for some devices which have multiple CPUs. Previously, we were scaling the smaller of these CPUs, which likely had a negative impact on nanobench, given nanobench was single threaded and the CPUs weren't allowed to idle much (because we set the CPU). This CL sets those additional CPUs to powersave when we run nanobench and then correctly scales down the beefier CPU we want to run nanobench on. For DM, we just run it in ondemand mode, which will hopefully be "as fast as possible", but allow the CPU governor to scale down if overheating becomes a problem. Bug: skia:7378 notry=TRUE Change-Id: I45ca5d9fb32182233d1b2d094842c879f2b84da4 Reviewed-on: https://skia-review.googlesource.com/83240 Commit-Queue: Kevin Lubick <kjlubick@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org>
Diffstat (limited to 'infra')
-rw-r--r--infra/bots/recipe_modules/flavor/examples/full.expected/Perf-Android-Clang-GalaxyS7_G930FD-GPU-MaliT880-arm64-Debug-All-Android.json802
-rw-r--r--infra/bots/recipe_modules/flavor/examples/full.expected/Perf-Android-Clang-NexusPlayer-GPU-PowerVR-x86-Debug-All-Android.json145
-rw-r--r--infra/bots/recipe_modules/flavor/examples/full.expected/Perf-Android-Clang-Pixel-GPU-Adreno530-arm64-Debug-All-Android.json145
-rw-r--r--infra/bots/recipe_modules/flavor/examples/full.expected/Test-Android-Clang-Nexus5x-GPU-Adreno418-arm64-Debug-All-Android.json109
-rw-r--r--infra/bots/recipe_modules/flavor/examples/full.expected/Test-Android-Clang-Nexus7-CPU-Tegra3-arm-Release-All-Android.json71
-rw-r--r--infra/bots/recipe_modules/flavor/examples/full.expected/Test-Android-Clang-Pixel-GPU-Adreno530-arm64-Debug-All-Android.json109
-rw-r--r--infra/bots/recipe_modules/flavor/examples/full.expected/cpu_scale_failed.json202
-rw-r--r--infra/bots/recipe_modules/flavor/examples/full.expected/failed_infra_step.json145
-rw-r--r--infra/bots/recipe_modules/flavor/examples/full.expected/failed_read_version.json145
-rw-r--r--infra/bots/recipe_modules/flavor/examples/full.expected/retry_adb_command.json145
-rw-r--r--infra/bots/recipe_modules/flavor/examples/full.py3
-rw-r--r--infra/bots/recipe_modules/flavor/gn_android_flavor.py132
-rw-r--r--infra/bots/recipes/perf.expected/Perf-Android-Clang-Nexus5-GPU-Adreno330-arm-Debug-All-Android.json101
-rw-r--r--infra/bots/recipes/perf.expected/Perf-Android-Clang-Nexus5x-GPU-Adreno418-arm64-Release-All-Android.json145
-rw-r--r--infra/bots/recipes/perf.expected/Perf-Android-Clang-Nexus7-CPU-Tegra3-arm-Release-All-Android.json101
-rw-r--r--infra/bots/recipes/perf.expected/Perf-Android-Clang-Nexus7-GPU-Tegra3-arm-Release-All-Android.json101
-rw-r--r--infra/bots/recipes/perf.expected/Perf-Android-Clang-NexusPlayer-GPU-PowerVR-x86-Release-All-Android.json145
-rw-r--r--infra/bots/recipes/perf.expected/Perf-Android-Clang-NexusPlayer-GPU-PowerVR-x86-Release-All-Android_Vulkan.json145
-rw-r--r--infra/bots/recipes/perf.expected/Perf-Android-Clang-PixelC-GPU-TegraX1-arm64-Release-All-Android_Skpbench.json101
-rw-r--r--infra/bots/recipes/perf.expected/cpu_scale_failed.json261
-rw-r--r--infra/bots/recipes/perf.expected/cpu_scale_failed_once.json202
-rw-r--r--infra/bots/recipes/perf.py8
-rw-r--r--infra/bots/recipes/test.expected/Test-Android-Clang-AndroidOne-GPU-Mali400MP2-arm-Release-All-Android.json71
-rw-r--r--infra/bots/recipes/test.expected/Test-Android-Clang-Nexus5-GPU-Adreno330-arm-Release-All-Android.json71
-rw-r--r--infra/bots/recipes/test.expected/Test-Android-Clang-Nexus5x-GPU-Adreno418-arm64-Debug-All-Android_NoGPUThreads.json109
-rw-r--r--infra/bots/recipes/test.expected/Test-Android-Clang-Nexus7-CPU-Tegra3-arm-Release-All-Android.json71
-rw-r--r--infra/bots/recipes/test.expected/Test-Android-Clang-Nexus7-GPU-Tegra3-arm-Debug-All-Android.json71
-rw-r--r--infra/bots/recipes/test.expected/Test-Android-Clang-NexusPlayer-CPU-Moorefield-x86-Release-All-Android.json109
-rw-r--r--infra/bots/recipes/test.expected/Test-Android-Clang-NexusPlayer-GPU-PowerVR-x86-Release-All-Android_Vulkan.json109
-rw-r--r--infra/bots/recipes/test.expected/Test-Android-Clang-Pixel-GPU-Adreno530-arm64-Debug-All-Android_CCPR.json109
-rw-r--r--infra/bots/recipes/test.expected/Test-Android-Clang-Pixel-GPU-Adreno530-arm64-Debug-All-Android_Vulkan.json109
-rw-r--r--infra/bots/recipes/test.expected/failed_get_hashes.json71
-rw-r--r--infra/bots/recipes/test.expected/failed_pull.json71
33 files changed, 2934 insertions, 1500 deletions
diff --git a/infra/bots/recipe_modules/flavor/examples/full.expected/Perf-Android-Clang-GalaxyS7_G930FD-GPU-MaliT880-arm64-Debug-All-Android.json b/infra/bots/recipe_modules/flavor/examples/full.expected/Perf-Android-Clang-GalaxyS7_G930FD-GPU-MaliT880-arm64-Debug-All-Android.json
new file mode 100644
index 0000000000..9fae7c2f7a
--- /dev/null
+++ b/infra/bots/recipe_modules/flavor/examples/full.expected/Perf-Android-Clang-GalaxyS7_G930FD-GPU-MaliT880-arm64-Debug-All-Android.json
@@ -0,0 +1,802 @@
+[
+ {
+ "cmd": [
+ "python",
+ "-u",
+ "[START_DIR]/skia/bin/fetch-gn"
+ ],
+ "cwd": "[START_DIR]/skia",
+ "env": {
+ "BUILDTYPE": "Debug",
+ "CHROME_HEADLESS": "1",
+ "PATH": "<PATH>:RECIPE_PACKAGE_REPO[depot_tools]",
+ "SKIA_OUT": "[START_DIR]/out"
+ },
+ "infra_step": true,
+ "name": "fetch-gn"
+ },
+ {
+ "cmd": [
+ "[START_DIR]/skia/bin/gn",
+ "gen",
+ "[START_DIR]/out/Debug",
+ "--args=extra_cflags=[\"-O1\"] ndk=\"[START_DIR]/android_ndk_linux\" target_cpu=\"None\""
+ ],
+ "cwd": "[START_DIR]/skia",
+ "env": {
+ "BUILDTYPE": "Debug",
+ "CHROME_HEADLESS": "1",
+ "PATH": "<PATH>:RECIPE_PACKAGE_REPO[depot_tools]",
+ "SKIA_OUT": "[START_DIR]/out"
+ },
+ "name": "gn gen"
+ },
+ {
+ "cmd": [
+ "ninja",
+ "-k",
+ "0",
+ "-C",
+ "[START_DIR]/out/Debug"
+ ],
+ "cwd": "[START_DIR]/skia",
+ "env": {
+ "BUILDTYPE": "Debug",
+ "CHROME_HEADLESS": "1",
+ "PATH": "<PATH>:RECIPE_PACKAGE_REPO[depot_tools]",
+ "SKIA_OUT": "[START_DIR]/out"
+ },
+ "name": "ninja"
+ },
+ {
+ "cmd": [
+ "/usr/bin/adb.1.0.35",
+ "push",
+ "file.txt",
+ "file.txt"
+ ],
+ "cwd": "[START_DIR]/skia",
+ "env": {
+ "BUILDTYPE": "Debug",
+ "CHROME_HEADLESS": "1",
+ "PATH": "<PATH>:RECIPE_PACKAGE_REPO[depot_tools]",
+ "SKIA_OUT": "[START_DIR]/out"
+ },
+ "infra_step": true,
+ "name": "push file.txt file.txt"
+ },
+ {
+ "cmd": [
+ "python",
+ "-u",
+ "RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py",
+ "--json-output",
+ "/path/to/tmp/json",
+ "rmtree",
+ "results_dir"
+ ],
+ "infra_step": true,
+ "name": "rmtree results_dir"
+ },
+ {
+ "cmd": [
+ "python",
+ "-u",
+ "RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py",
+ "--json-output",
+ "/path/to/tmp/json",
+ "ensure-directory",
+ "--mode",
+ "0777",
+ "results_dir"
+ ],
+ "infra_step": true,
+ "name": "makedirs results_dir"
+ },
+ {
+ "cmd": [
+ "/usr/bin/adb.1.0.35",
+ "shell",
+ "rm",
+ "-rf",
+ "device_results_dir"
+ ],
+ "cwd": "[START_DIR]/skia",
+ "env": {
+ "BUILDTYPE": "Debug",
+ "CHROME_HEADLESS": "1",
+ "PATH": "<PATH>:RECIPE_PACKAGE_REPO[depot_tools]",
+ "SKIA_OUT": "[START_DIR]/out"
+ },
+ "infra_step": true,
+ "name": "rm device_results_dir"
+ },
+ {
+ "cmd": [
+ "/usr/bin/adb.1.0.35",
+ "shell",
+ "mkdir",
+ "-p",
+ "device_results_dir"
+ ],
+ "cwd": "[START_DIR]/skia",
+ "env": {
+ "BUILDTYPE": "Debug",
+ "CHROME_HEADLESS": "1",
+ "PATH": "<PATH>:RECIPE_PACKAGE_REPO[depot_tools]",
+ "SKIA_OUT": "[START_DIR]/out"
+ },
+ "infra_step": true,
+ "name": "mkdir device_results_dir"
+ },
+ {
+ "cmd": [
+ "/usr/bin/adb.1.0.35",
+ "shell",
+ "mkdir",
+ "-p",
+ "/sdcard/revenge_of_the_skiabot/resources"
+ ],
+ "cwd": "[START_DIR]/skia",
+ "env": {
+ "BUILDTYPE": "Debug",
+ "CHROME_HEADLESS": "1",
+ "PATH": "<PATH>:RECIPE_PACKAGE_REPO[depot_tools]",
+ "SKIA_OUT": "[START_DIR]/out"
+ },
+ "infra_step": true,
+ "name": "mkdir /sdcard/revenge_of_the_skiabot/resources"
+ },
+ {
+ "cmd": [
+ "python",
+ "-u",
+ "\nimport os\nimport subprocess\nimport sys\nhost = sys.argv[1]\ndevice = sys.argv[2]\nfor d, _, fs in os.walk(host):\n p = os.path.relpath(d, host)\n if p != '.' and p.startswith('.'):\n continue\n for f in fs:\n print os.path.join(p,f)\n subprocess.check_call(['/usr/bin/adb.1.0.35', 'push',\n os.path.realpath(os.path.join(host, p, f)),\n os.path.join(device, p, f)])\n",
+ "[START_DIR]/skia/resources",
+ "/sdcard/revenge_of_the_skiabot/resources"
+ ],
+ "env": {
+ "BUILDTYPE": "Debug",
+ "CHROME_HEADLESS": "1",
+ "PATH": "<PATH>:RECIPE_PACKAGE_REPO[depot_tools]",
+ "SKIA_OUT": "[START_DIR]/out"
+ },
+ "infra_step": true,
+ "name": "push [START_DIR]/skia/resources/* /sdcard/revenge_of_the_skiabot/resources",
+ "~followup_annotations": [
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@import os@@@",
+ "@@@STEP_LOG_LINE@python.inline@import subprocess@@@",
+ "@@@STEP_LOG_LINE@python.inline@import sys@@@",
+ "@@@STEP_LOG_LINE@python.inline@host = sys.argv[1]@@@",
+ "@@@STEP_LOG_LINE@python.inline@device = sys.argv[2]@@@",
+ "@@@STEP_LOG_LINE@python.inline@for d, _, fs in os.walk(host):@@@",
+ "@@@STEP_LOG_LINE@python.inline@ p = os.path.relpath(d, host)@@@",
+ "@@@STEP_LOG_LINE@python.inline@ if p != '.' and p.startswith('.'):@@@",
+ "@@@STEP_LOG_LINE@python.inline@ continue@@@",
+ "@@@STEP_LOG_LINE@python.inline@ for f in fs:@@@",
+ "@@@STEP_LOG_LINE@python.inline@ print os.path.join(p,f)@@@",
+ "@@@STEP_LOG_LINE@python.inline@ subprocess.check_call(['/usr/bin/adb.1.0.35', 'push',@@@",
+ "@@@STEP_LOG_LINE@python.inline@ os.path.realpath(os.path.join(host, p, f)),@@@",
+ "@@@STEP_LOG_LINE@python.inline@ os.path.join(device, p, f)])@@@",
+ "@@@STEP_LOG_END@python.inline@@@"
+ ]
+ },
+ {
+ "cmd": [
+ "python",
+ "-u",
+ "RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py",
+ "--json-output",
+ "/path/to/tmp/json",
+ "copy",
+ "[START_DIR]/skia/infra/bots/assets/skp/VERSION",
+ "/path/to/tmp/"
+ ],
+ "infra_step": true,
+ "name": "Get downloaded SKP VERSION"
+ },
+ {
+ "cmd": [
+ "python",
+ "-u",
+ "RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py",
+ "--json-output",
+ "/path/to/tmp/json",
+ "copy",
+ "42",
+ "[START_DIR]/tmp/SKP_VERSION"
+ ],
+ "infra_step": true,
+ "name": "write SKP_VERSION"
+ },
+ {
+ "cmd": [
+ "/usr/bin/adb.1.0.35",
+ "shell",
+ "cat",
+ "/sdcard/revenge_of_the_skiabot/SKP_VERSION"
+ ],
+ "cwd": "[START_DIR]/skia",
+ "env": {
+ "BUILDTYPE": "Debug",
+ "CHROME_HEADLESS": "1",
+ "PATH": "<PATH>:RECIPE_PACKAGE_REPO[depot_tools]",
+ "SKIA_OUT": "[START_DIR]/out"
+ },
+ "infra_step": true,
+ "name": "read /sdcard/revenge_of_the_skiabot/SKP_VERSION",
+ "stdout": "/path/to/tmp/"
+ },
+ {
+ "cmd": [
+ "/usr/bin/adb.1.0.35",
+ "shell",
+ "rm",
+ "-f",
+ "/sdcard/revenge_of_the_skiabot/SKP_VERSION"
+ ],
+ "cwd": "[START_DIR]/skia",
+ "env": {
+ "BUILDTYPE": "Debug",
+ "CHROME_HEADLESS": "1",
+ "PATH": "<PATH>:RECIPE_PACKAGE_REPO[depot_tools]",
+ "SKIA_OUT": "[START_DIR]/out"
+ },
+ "infra_step": true,
+ "name": "rm /sdcard/revenge_of_the_skiabot/SKP_VERSION"
+ },
+ {
+ "cmd": [
+ "/usr/bin/adb.1.0.35",
+ "shell",
+ "rm",
+ "-rf",
+ "/sdcard/revenge_of_the_skiabot/skps"
+ ],
+ "cwd": "[START_DIR]/skia",
+ "env": {
+ "BUILDTYPE": "Debug",
+ "CHROME_HEADLESS": "1",
+ "PATH": "<PATH>:RECIPE_PACKAGE_REPO[depot_tools]",
+ "SKIA_OUT": "[START_DIR]/out"
+ },
+ "infra_step": true,
+ "name": "rm /sdcard/revenge_of_the_skiabot/skps"
+ },
+ {
+ "cmd": [
+ "/usr/bin/adb.1.0.35",
+ "shell",
+ "mkdir",
+ "-p",
+ "/sdcard/revenge_of_the_skiabot/skps"
+ ],
+ "cwd": "[START_DIR]/skia",
+ "env": {
+ "BUILDTYPE": "Debug",
+ "CHROME_HEADLESS": "1",
+ "PATH": "<PATH>:RECIPE_PACKAGE_REPO[depot_tools]",
+ "SKIA_OUT": "[START_DIR]/out"
+ },
+ "infra_step": true,
+ "name": "mkdir /sdcard/revenge_of_the_skiabot/skps"
+ },
+ {
+ "cmd": [
+ "python",
+ "-u",
+ "\nimport os\nimport subprocess\nimport sys\nhost = sys.argv[1]\ndevice = sys.argv[2]\nfor d, _, fs in os.walk(host):\n p = os.path.relpath(d, host)\n if p != '.' and p.startswith('.'):\n continue\n for f in fs:\n print os.path.join(p,f)\n subprocess.check_call(['/usr/bin/adb.1.0.35', 'push',\n os.path.realpath(os.path.join(host, p, f)),\n os.path.join(device, p, f)])\n",
+ "[START_DIR]/skp",
+ "/sdcard/revenge_of_the_skiabot/skps"
+ ],
+ "env": {
+ "BUILDTYPE": "Debug",
+ "CHROME_HEADLESS": "1",
+ "PATH": "<PATH>:RECIPE_PACKAGE_REPO[depot_tools]",
+ "SKIA_OUT": "[START_DIR]/out"
+ },
+ "infra_step": true,
+ "name": "push [START_DIR]/skp/* /sdcard/revenge_of_the_skiabot/skps",
+ "~followup_annotations": [
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@import os@@@",
+ "@@@STEP_LOG_LINE@python.inline@import subprocess@@@",
+ "@@@STEP_LOG_LINE@python.inline@import sys@@@",
+ "@@@STEP_LOG_LINE@python.inline@host = sys.argv[1]@@@",
+ "@@@STEP_LOG_LINE@python.inline@device = sys.argv[2]@@@",
+ "@@@STEP_LOG_LINE@python.inline@for d, _, fs in os.walk(host):@@@",
+ "@@@STEP_LOG_LINE@python.inline@ p = os.path.relpath(d, host)@@@",
+ "@@@STEP_LOG_LINE@python.inline@ if p != '.' and p.startswith('.'):@@@",
+ "@@@STEP_LOG_LINE@python.inline@ continue@@@",
+ "@@@STEP_LOG_LINE@python.inline@ for f in fs:@@@",
+ "@@@STEP_LOG_LINE@python.inline@ print os.path.join(p,f)@@@",
+ "@@@STEP_LOG_LINE@python.inline@ subprocess.check_call(['/usr/bin/adb.1.0.35', 'push',@@@",
+ "@@@STEP_LOG_LINE@python.inline@ os.path.realpath(os.path.join(host, p, f)),@@@",
+ "@@@STEP_LOG_LINE@python.inline@ os.path.join(device, p, f)])@@@",
+ "@@@STEP_LOG_END@python.inline@@@"
+ ]
+ },
+ {
+ "cmd": [
+ "/usr/bin/adb.1.0.35",
+ "push",
+ "[START_DIR]/tmp/SKP_VERSION",
+ "/sdcard/revenge_of_the_skiabot/SKP_VERSION"
+ ],
+ "cwd": "[START_DIR]/skia",
+ "env": {
+ "BUILDTYPE": "Debug",
+ "CHROME_HEADLESS": "1",
+ "PATH": "<PATH>:RECIPE_PACKAGE_REPO[depot_tools]",
+ "SKIA_OUT": "[START_DIR]/out"
+ },
+ "infra_step": true,
+ "name": "push [START_DIR]/tmp/SKP_VERSION /sdcard/revenge_of_the_skiabot/SKP_VERSION"
+ },
+ {
+ "cmd": [
+ "python",
+ "-u",
+ "RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py",
+ "--json-output",
+ "/path/to/tmp/json",
+ "copy",
+ "[START_DIR]/skia/infra/bots/assets/skimage/VERSION",
+ "/path/to/tmp/"
+ ],
+ "infra_step": true,
+ "name": "Get downloaded skimage VERSION"
+ },
+ {
+ "cmd": [
+ "python",
+ "-u",
+ "RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py",
+ "--json-output",
+ "/path/to/tmp/json",
+ "copy",
+ "42",
+ "[START_DIR]/tmp/SK_IMAGE_VERSION"
+ ],
+ "infra_step": true,
+ "name": "write SK_IMAGE_VERSION"
+ },
+ {
+ "cmd": [
+ "/usr/bin/adb.1.0.35",
+ "shell",
+ "cat",
+ "/sdcard/revenge_of_the_skiabot/SK_IMAGE_VERSION"
+ ],
+ "cwd": "[START_DIR]/skia",
+ "env": {
+ "BUILDTYPE": "Debug",
+ "CHROME_HEADLESS": "1",
+ "PATH": "<PATH>:RECIPE_PACKAGE_REPO[depot_tools]",
+ "SKIA_OUT": "[START_DIR]/out"
+ },
+ "infra_step": true,
+ "name": "read /sdcard/revenge_of_the_skiabot/SK_IMAGE_VERSION",
+ "stdout": "/path/to/tmp/"
+ },
+ {
+ "cmd": [
+ "/usr/bin/adb.1.0.35",
+ "shell",
+ "rm",
+ "-f",
+ "/sdcard/revenge_of_the_skiabot/SK_IMAGE_VERSION"
+ ],
+ "cwd": "[START_DIR]/skia",
+ "env": {
+ "BUILDTYPE": "Debug",
+ "CHROME_HEADLESS": "1",
+ "PATH": "<PATH>:RECIPE_PACKAGE_REPO[depot_tools]",
+ "SKIA_OUT": "[START_DIR]/out"
+ },
+ "infra_step": true,
+ "name": "rm /sdcard/revenge_of_the_skiabot/SK_IMAGE_VERSION"
+ },
+ {
+ "cmd": [
+ "/usr/bin/adb.1.0.35",
+ "shell",
+ "rm",
+ "-rf",
+ "/sdcard/revenge_of_the_skiabot/images"
+ ],
+ "cwd": "[START_DIR]/skia",
+ "env": {
+ "BUILDTYPE": "Debug",
+ "CHROME_HEADLESS": "1",
+ "PATH": "<PATH>:RECIPE_PACKAGE_REPO[depot_tools]",
+ "SKIA_OUT": "[START_DIR]/out"
+ },
+ "infra_step": true,
+ "name": "rm /sdcard/revenge_of_the_skiabot/images"
+ },
+ {
+ "cmd": [
+ "/usr/bin/adb.1.0.35",
+ "shell",
+ "mkdir",
+ "-p",
+ "/sdcard/revenge_of_the_skiabot/images"
+ ],
+ "cwd": "[START_DIR]/skia",
+ "env": {
+ "BUILDTYPE": "Debug",
+ "CHROME_HEADLESS": "1",
+ "PATH": "<PATH>:RECIPE_PACKAGE_REPO[depot_tools]",
+ "SKIA_OUT": "[START_DIR]/out"
+ },
+ "infra_step": true,
+ "name": "mkdir /sdcard/revenge_of_the_skiabot/images"
+ },
+ {
+ "cmd": [
+ "python",
+ "-u",
+ "\nimport os\nimport subprocess\nimport sys\nhost = sys.argv[1]\ndevice = sys.argv[2]\nfor d, _, fs in os.walk(host):\n p = os.path.relpath(d, host)\n if p != '.' and p.startswith('.'):\n continue\n for f in fs:\n print os.path.join(p,f)\n subprocess.check_call(['/usr/bin/adb.1.0.35', 'push',\n os.path.realpath(os.path.join(host, p, f)),\n os.path.join(device, p, f)])\n",
+ "[START_DIR]/skimage",
+ "/sdcard/revenge_of_the_skiabot/images"
+ ],
+ "env": {
+ "BUILDTYPE": "Debug",
+ "CHROME_HEADLESS": "1",
+ "PATH": "<PATH>:RECIPE_PACKAGE_REPO[depot_tools]",
+ "SKIA_OUT": "[START_DIR]/out"
+ },
+ "infra_step": true,
+ "name": "push [START_DIR]/skimage/* /sdcard/revenge_of_the_skiabot/images",
+ "~followup_annotations": [
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@import os@@@",
+ "@@@STEP_LOG_LINE@python.inline@import subprocess@@@",
+ "@@@STEP_LOG_LINE@python.inline@import sys@@@",
+ "@@@STEP_LOG_LINE@python.inline@host = sys.argv[1]@@@",
+ "@@@STEP_LOG_LINE@python.inline@device = sys.argv[2]@@@",
+ "@@@STEP_LOG_LINE@python.inline@for d, _, fs in os.walk(host):@@@",
+ "@@@STEP_LOG_LINE@python.inline@ p = os.path.relpath(d, host)@@@",
+ "@@@STEP_LOG_LINE@python.inline@ if p != '.' and p.startswith('.'):@@@",
+ "@@@STEP_LOG_LINE@python.inline@ continue@@@",
+ "@@@STEP_LOG_LINE@python.inline@ for f in fs:@@@",
+ "@@@STEP_LOG_LINE@python.inline@ print os.path.join(p,f)@@@",
+ "@@@STEP_LOG_LINE@python.inline@ subprocess.check_call(['/usr/bin/adb.1.0.35', 'push',@@@",
+ "@@@STEP_LOG_LINE@python.inline@ os.path.realpath(os.path.join(host, p, f)),@@@",
+ "@@@STEP_LOG_LINE@python.inline@ os.path.join(device, p, f)])@@@",
+ "@@@STEP_LOG_END@python.inline@@@"
+ ]
+ },
+ {
+ "cmd": [
+ "/usr/bin/adb.1.0.35",
+ "push",
+ "[START_DIR]/tmp/SK_IMAGE_VERSION",
+ "/sdcard/revenge_of_the_skiabot/SK_IMAGE_VERSION"
+ ],
+ "cwd": "[START_DIR]/skia",
+ "env": {
+ "BUILDTYPE": "Debug",
+ "CHROME_HEADLESS": "1",
+ "PATH": "<PATH>:RECIPE_PACKAGE_REPO[depot_tools]",
+ "SKIA_OUT": "[START_DIR]/out"
+ },
+ "infra_step": true,
+ "name": "push [START_DIR]/tmp/SK_IMAGE_VERSION /sdcard/revenge_of_the_skiabot/SK_IMAGE_VERSION"
+ },
+ {
+ "cmd": [
+ "python",
+ "-u",
+ "RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py",
+ "--json-output",
+ "/path/to/tmp/json",
+ "copy",
+ "[START_DIR]/skia/infra/bots/assets/svg/VERSION",
+ "/path/to/tmp/"
+ ],
+ "infra_step": true,
+ "name": "Get downloaded SVG VERSION"
+ },
+ {
+ "cmd": [
+ "python",
+ "-u",
+ "RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py",
+ "--json-output",
+ "/path/to/tmp/json",
+ "copy",
+ "42",
+ "[START_DIR]/tmp/SVG_VERSION"
+ ],
+ "infra_step": true,
+ "name": "write SVG_VERSION"
+ },
+ {
+ "cmd": [
+ "/usr/bin/adb.1.0.35",
+ "shell",
+ "cat",
+ "/sdcard/revenge_of_the_skiabot/SVG_VERSION"
+ ],
+ "cwd": "[START_DIR]/skia",
+ "env": {
+ "BUILDTYPE": "Debug",
+ "CHROME_HEADLESS": "1",
+ "PATH": "<PATH>:RECIPE_PACKAGE_REPO[depot_tools]",
+ "SKIA_OUT": "[START_DIR]/out"
+ },
+ "infra_step": true,
+ "name": "read /sdcard/revenge_of_the_skiabot/SVG_VERSION",
+ "stdout": "/path/to/tmp/"
+ },
+ {
+ "cmd": [
+ "/usr/bin/adb.1.0.35",
+ "shell",
+ "rm",
+ "-f",
+ "/sdcard/revenge_of_the_skiabot/SVG_VERSION"
+ ],
+ "cwd": "[START_DIR]/skia",
+ "env": {
+ "BUILDTYPE": "Debug",
+ "CHROME_HEADLESS": "1",
+ "PATH": "<PATH>:RECIPE_PACKAGE_REPO[depot_tools]",
+ "SKIA_OUT": "[START_DIR]/out"
+ },
+ "infra_step": true,
+ "name": "rm /sdcard/revenge_of_the_skiabot/SVG_VERSION"
+ },
+ {
+ "cmd": [
+ "/usr/bin/adb.1.0.35",
+ "shell",
+ "rm",
+ "-rf",
+ "/sdcard/revenge_of_the_skiabot/svgs"
+ ],
+ "cwd": "[START_DIR]/skia",
+ "env": {
+ "BUILDTYPE": "Debug",
+ "CHROME_HEADLESS": "1",
+ "PATH": "<PATH>:RECIPE_PACKAGE_REPO[depot_tools]",
+ "SKIA_OUT": "[START_DIR]/out"
+ },
+ "infra_step": true,
+ "name": "rm /sdcard/revenge_of_the_skiabot/svgs"
+ },
+ {
+ "cmd": [
+ "/usr/bin/adb.1.0.35",
+ "shell",
+ "mkdir",
+ "-p",
+ "/sdcard/revenge_of_the_skiabot/svgs"
+ ],
+ "cwd": "[START_DIR]/skia",
+ "env": {
+ "BUILDTYPE": "Debug",
+ "CHROME_HEADLESS": "1",
+ "PATH": "<PATH>:RECIPE_PACKAGE_REPO[depot_tools]",
+ "SKIA_OUT": "[START_DIR]/out"
+ },
+ "infra_step": true,
+ "name": "mkdir /sdcard/revenge_of_the_skiabot/svgs"
+ },
+ {
+ "cmd": [
+ "python",
+ "-u",
+ "\nimport os\nimport subprocess\nimport sys\nhost = sys.argv[1]\ndevice = sys.argv[2]\nfor d, _, fs in os.walk(host):\n p = os.path.relpath(d, host)\n if p != '.' and p.startswith('.'):\n continue\n for f in fs:\n print os.path.join(p,f)\n subprocess.check_call(['/usr/bin/adb.1.0.35', 'push',\n os.path.realpath(os.path.join(host, p, f)),\n os.path.join(device, p, f)])\n",
+ "[START_DIR]/svg",
+ "/sdcard/revenge_of_the_skiabot/svgs"
+ ],
+ "env": {
+ "BUILDTYPE": "Debug",
+ "CHROME_HEADLESS": "1",
+ "PATH": "<PATH>:RECIPE_PACKAGE_REPO[depot_tools]",
+ "SKIA_OUT": "[START_DIR]/out"
+ },
+ "infra_step": true,
+ "name": "push [START_DIR]/svg/* /sdcard/revenge_of_the_skiabot/svgs",
+ "~followup_annotations": [
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@import os@@@",
+ "@@@STEP_LOG_LINE@python.inline@import subprocess@@@",
+ "@@@STEP_LOG_LINE@python.inline@import sys@@@",
+ "@@@STEP_LOG_LINE@python.inline@host = sys.argv[1]@@@",
+ "@@@STEP_LOG_LINE@python.inline@device = sys.argv[2]@@@",
+ "@@@STEP_LOG_LINE@python.inline@for d, _, fs in os.walk(host):@@@",
+ "@@@STEP_LOG_LINE@python.inline@ p = os.path.relpath(d, host)@@@",
+ "@@@STEP_LOG_LINE@python.inline@ if p != '.' and p.startswith('.'):@@@",
+ "@@@STEP_LOG_LINE@python.inline@ continue@@@",
+ "@@@STEP_LOG_LINE@python.inline@ for f in fs:@@@",
+ "@@@STEP_LOG_LINE@python.inline@ print os.path.join(p,f)@@@",
+ "@@@STEP_LOG_LINE@python.inline@ subprocess.check_call(['/usr/bin/adb.1.0.35', 'push',@@@",
+ "@@@STEP_LOG_LINE@python.inline@ os.path.realpath(os.path.join(host, p, f)),@@@",
+ "@@@STEP_LOG_LINE@python.inline@ os.path.join(device, p, f)])@@@",
+ "@@@STEP_LOG_END@python.inline@@@"
+ ]
+ },
+ {
+ "cmd": [
+ "/usr/bin/adb.1.0.35",
+ "push",
+ "[START_DIR]/tmp/SVG_VERSION",
+ "/sdcard/revenge_of_the_skiabot/SVG_VERSION"
+ ],
+ "cwd": "[START_DIR]/skia",
+ "env": {
+ "BUILDTYPE": "Debug",
+ "CHROME_HEADLESS": "1",
+ "PATH": "<PATH>:RECIPE_PACKAGE_REPO[depot_tools]",
+ "SKIA_OUT": "[START_DIR]/out"
+ },
+ "infra_step": true,
+ "name": "push [START_DIR]/tmp/SVG_VERSION /sdcard/revenge_of_the_skiabot/SVG_VERSION"
+ },
+ {
+ "cmd": [
+ "/usr/bin/adb.1.0.35",
+ "push",
+ "[START_DIR]/out/Debug/nanobench",
+ "/data/local/tmp/"
+ ],
+ "cwd": "[START_DIR]/skia",
+ "env": {
+ "BUILDTYPE": "Debug",
+ "CHROME_HEADLESS": "1",
+ "PATH": "<PATH>:RECIPE_PACKAGE_REPO[depot_tools]",
+ "SKIA_OUT": "[START_DIR]/out"
+ },
+ "infra_step": true,
+ "name": "push nanobench"
+ },
+ {
+ "cmd": [
+ "python",
+ "-u",
+ "RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py",
+ "--json-output",
+ "/path/to/tmp/json",
+ "copy",
+ "set -x; /data/local/tmp/nanobench --some-flag; echo $? >/data/local/tmp/rc",
+ "[START_DIR]/tmp/nanobench.sh"
+ ],
+ "infra_step": true,
+ "name": "write nanobench.sh"
+ },
+ {
+ "cmd": [
+ "/usr/bin/adb.1.0.35",
+ "push",
+ "[START_DIR]/tmp/nanobench.sh",
+ "/data/local/tmp/"
+ ],
+ "cwd": "[START_DIR]/skia",
+ "env": {
+ "BUILDTYPE": "Debug",
+ "CHROME_HEADLESS": "1",
+ "PATH": "<PATH>:RECIPE_PACKAGE_REPO[depot_tools]",
+ "SKIA_OUT": "[START_DIR]/out"
+ },
+ "infra_step": true,
+ "name": "push nanobench.sh"
+ },
+ {
+ "cmd": [
+ "/usr/bin/adb.1.0.35",
+ "logcat",
+ "-c"
+ ],
+ "cwd": "[START_DIR]/skia",
+ "env": {
+ "BUILDTYPE": "Debug",
+ "CHROME_HEADLESS": "1",
+ "PATH": "<PATH>:RECIPE_PACKAGE_REPO[depot_tools]",
+ "SKIA_OUT": "[START_DIR]/out"
+ },
+ "infra_step": true,
+ "name": "clear log"
+ },
+ {
+ "cmd": [
+ "python",
+ "-u",
+ "\nimport subprocess\nimport sys\nbin_dir = sys.argv[1]\nsh = sys.argv[2]\nsubprocess.check_call(['/usr/bin/adb.1.0.35', 'shell', 'sh', bin_dir + sh])\ntry:\n sys.exit(int(subprocess.check_output(['/usr/bin/adb.1.0.35', 'shell', 'cat',\n bin_dir + 'rc'])))\nexcept ValueError:\n print \"Couldn't read the return code. Probably killed for OOM.\"\n sys.exit(1)\n",
+ "/data/local/tmp/",
+ "nanobench.sh"
+ ],
+ "name": "nanobench",
+ "~followup_annotations": [
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@import subprocess@@@",
+ "@@@STEP_LOG_LINE@python.inline@import sys@@@",
+ "@@@STEP_LOG_LINE@python.inline@bin_dir = sys.argv[1]@@@",
+ "@@@STEP_LOG_LINE@python.inline@sh = sys.argv[2]@@@",
+ "@@@STEP_LOG_LINE@python.inline@subprocess.check_call(['/usr/bin/adb.1.0.35', 'shell', 'sh', bin_dir + sh])@@@",
+ "@@@STEP_LOG_LINE@python.inline@try:@@@",
+ "@@@STEP_LOG_LINE@python.inline@ sys.exit(int(subprocess.check_output(['/usr/bin/adb.1.0.35', 'shell', 'cat',@@@",
+ "@@@STEP_LOG_LINE@python.inline@ bin_dir + 'rc'])))@@@",
+ "@@@STEP_LOG_LINE@python.inline@except ValueError:@@@",
+ "@@@STEP_LOG_LINE@python.inline@ print \"Couldn't read the return code. Probably killed for OOM.\"@@@",
+ "@@@STEP_LOG_LINE@python.inline@ sys.exit(1)@@@",
+ "@@@STEP_LOG_END@python.inline@@@"
+ ]
+ },
+ {
+ "cmd": [
+ "/usr/bin/adb.1.0.35",
+ "pull",
+ "/sdcard/revenge_of_the_skiabot/perf",
+ "[CUSTOM_[SWARM_OUT_DIR]]/perfdata/Perf-Android-Clang-GalaxyS7_G930FD-GPU-MaliT880-arm64-Debug-All-Android/data"
+ ],
+ "cwd": "[START_DIR]/skia",
+ "env": {
+ "BUILDTYPE": "Debug",
+ "CHROME_HEADLESS": "1",
+ "PATH": "<PATH>:RECIPE_PACKAGE_REPO[depot_tools]",
+ "SKIA_OUT": "[START_DIR]/out"
+ },
+ "infra_step": true,
+ "name": "pull /sdcard/revenge_of_the_skiabot/perf [CUSTOM_[SWARM_OUT_DIR]]/perfdata/Perf-Android-Clang-GalaxyS7_G930FD-GPU-MaliT880-arm64-Debug-All-Android/data"
+ },
+ {
+ "cmd": [
+ "python",
+ "-u",
+ "\nimport os\nimport subprocess\nimport sys\nout = sys.argv[1]\nlog = subprocess.check_output(['/usr/bin/adb.1.0.35', 'logcat', '-d'])\nfor line in log.split('\\n'):\n tokens = line.split()\n if len(tokens) == 11 and tokens[-7] == 'F' and tokens[-3] == 'pc':\n addr, path = tokens[-2:]\n local = os.path.join(out, os.path.basename(path))\n if os.path.exists(local):\n sym = subprocess.check_output(['addr2line', '-Cfpe', local, addr])\n line = line.replace(addr, addr + ' ' + sym.strip())\n print line\n",
+ "[START_DIR]/out/Debug"
+ ],
+ "env": {
+ "BUILDTYPE": "Debug",
+ "CHROME_HEADLESS": "1",
+ "PATH": "<PATH>:RECIPE_PACKAGE_REPO[depot_tools]",
+ "SKIA_OUT": "[START_DIR]/out"
+ },
+ "infra_step": true,
+ "name": "dump log",
+ "timeout": 300,
+ "~followup_annotations": [
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@import os@@@",
+ "@@@STEP_LOG_LINE@python.inline@import subprocess@@@",
+ "@@@STEP_LOG_LINE@python.inline@import sys@@@",
+ "@@@STEP_LOG_LINE@python.inline@out = sys.argv[1]@@@",
+ "@@@STEP_LOG_LINE@python.inline@log = subprocess.check_output(['/usr/bin/adb.1.0.35', 'logcat', '-d'])@@@",
+ "@@@STEP_LOG_LINE@python.inline@for line in log.split('\\n'):@@@",
+ "@@@STEP_LOG_LINE@python.inline@ tokens = line.split()@@@",
+ "@@@STEP_LOG_LINE@python.inline@ if len(tokens) == 11 and tokens[-7] == 'F' and tokens[-3] == 'pc':@@@",
+ "@@@STEP_LOG_LINE@python.inline@ addr, path = tokens[-2:]@@@",
+ "@@@STEP_LOG_LINE@python.inline@ local = os.path.join(out, os.path.basename(path))@@@",
+ "@@@STEP_LOG_LINE@python.inline@ if os.path.exists(local):@@@",
+ "@@@STEP_LOG_LINE@python.inline@ sym = subprocess.check_output(['addr2line', '-Cfpe', local, addr])@@@",
+ "@@@STEP_LOG_LINE@python.inline@ line = line.replace(addr, addr + ' ' + sym.strip())@@@",
+ "@@@STEP_LOG_LINE@python.inline@ print line@@@",
+ "@@@STEP_LOG_END@python.inline@@@"
+ ]
+ },
+ {
+ "cmd": [
+ "/usr/bin/adb.1.0.35",
+ "kill-server"
+ ],
+ "cwd": "[START_DIR]/skia",
+ "env": {
+ "BUILDTYPE": "Debug",
+ "CHROME_HEADLESS": "1",
+ "PATH": "<PATH>:RECIPE_PACKAGE_REPO[depot_tools]",
+ "SKIA_OUT": "[START_DIR]/out"
+ },
+ "infra_step": true,
+ "name": "kill adb server"
+ },
+ {
+ "name": "$result",
+ "recipe_result": null,
+ "status_code": 0
+ }
+] \ No newline at end of file
diff --git a/infra/bots/recipe_modules/flavor/examples/full.expected/Perf-Android-Clang-NexusPlayer-GPU-PowerVR-x86-Debug-All-Android.json b/infra/bots/recipe_modules/flavor/examples/full.expected/Perf-Android-Clang-NexusPlayer-GPU-PowerVR-x86-Debug-All-Android.json
index 9f3cb903a1..3d2d053ff9 100644
--- a/infra/bots/recipe_modules/flavor/examples/full.expected/Perf-Android-Clang-NexusPlayer-GPU-PowerVR-x86-Debug-All-Android.json
+++ b/infra/bots/recipe_modules/flavor/examples/full.expected/Perf-Android-Clang-NexusPlayer-GPU-PowerVR-x86-Debug-All-Android.json
@@ -642,10 +642,10 @@
"cmd": [
"python",
"-u",
- "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\nmodel = sys.argv[2]\ntarget_percent = float(sys.argv[3])\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nif model == 'Nexus7':\n # Nexus7 claims to support 1300000, but only really allows 1200000\n available_freqs = [51000, 102000, 204000, 340000, 475000, 640000, 760000,\n 860000, 1000000, 1100000, 1200000]\nelse:\n # Temporary logging to get a sense of what devices have multiple cpus\n try:\n print subprocess.check_output([ADB, 'shell', 'cat ',\n '/sys/devices/system/cpu/cpu?/cpufreq/affected_cpus'])\n print subprocess.check_output([ADB, 'shell', 'cat ',\n '/sys/devices/system/cpu/cpu?/cpufreq/scaling_available_frequencies'])\n except Exception as e:\n print e.output.strip()\n # Most devices give a list of their available frequencies.\n available_freqs = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies'])\n\n # Check for message like '/system/bin/sh: file not found'\n if available_freqs and '/system/bin/sh' not in available_freqs:\n available_freqs = sorted(\n int(i) for i in available_freqs.strip().split())\n else:\n raise Exception('Could not get list of available frequencies: %s' %\n available_freqs)\n\nmaxfreq = available_freqs[-1]\ntarget = int(round(maxfreq * target_percent))\nfreq = maxfreq\nfor f in reversed(available_freqs):\n if f <= target:\n freq = f\n break\n\nprint 'Setting frequency to %d' % freq\n\nsubprocess.check_output([ADB, 'shell', 'echo \"userspace\" > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor'])\n# If scaling_max_freq is lower than our attempted setting, it won't take.\n# We must set min first, because if we try to set max to be less than min\n# (which sometimes happens after certain devices reboot) it returns a\n# perplexing permissions error.\nsubprocess.check_output([ADB, 'shell', 'echo 0 > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq'])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed' % freq])\ntime.sleep(5)\nactual_freq = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq']).strip()\nif actual_freq != str(freq):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_freq, freq))\n",
+ "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ncpu = int(sys.argv[2])\ngov = sys.argv[3]\n\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nsubprocess.check_output([ADB, 'shell', 'echo \"%s\" > '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])\nactual_gov = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()\nif actual_gov != str(gov):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_gov, gov))\n",
"/usr/bin/adb.1.0.35",
- "NexusPlayer",
- "0.6"
+ "0",
+ "powersave"
],
"env": {
"BUILDTYPE": "Debug",
@@ -654,7 +654,7 @@
"SKIA_OUT": "[START_DIR]/out"
},
"infra_step": true,
- "name": "Scale CPU to 0.600000",
+ "name": "Set CPU 0's governor to powersave",
"timeout": 30,
"~followup_annotations": [
"@@@STEP_LOG_LINE@python.inline@@@@",
@@ -663,38 +663,115 @@
"@@@STEP_LOG_LINE@python.inline@import sys@@@",
"@@@STEP_LOG_LINE@python.inline@import time@@@",
"@@@STEP_LOG_LINE@python.inline@ADB = sys.argv[1]@@@",
- "@@@STEP_LOG_LINE@python.inline@model = sys.argv[2]@@@",
- "@@@STEP_LOG_LINE@python.inline@target_percent = float(sys.argv[3])@@@",
+ "@@@STEP_LOG_LINE@python.inline@cpu = int(sys.argv[2])@@@",
+ "@@@STEP_LOG_LINE@python.inline@gov = sys.argv[3]@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@log = subprocess.check_output([ADB, 'root'])@@@",
"@@@STEP_LOG_LINE@python.inline@# check for message like 'adbd cannot run as root in production builds'@@@",
"@@@STEP_LOG_LINE@python.inline@print log@@@",
"@@@STEP_LOG_LINE@python.inline@if 'cannot' in log:@@@",
"@@@STEP_LOG_LINE@python.inline@ raise Exception('adb root failed')@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@if model == 'Nexus7':@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Nexus7 claims to support 1300000, but only really allows 1200000@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = [51000, 102000, 204000, 340000, 475000, 640000, 760000,@@@",
- "@@@STEP_LOG_LINE@python.inline@ 860000, 1000000, 1100000, 1200000]@@@",
- "@@@STEP_LOG_LINE@python.inline@else:@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Temporary logging to get a sense of what devices have multiple cpus@@@",
- "@@@STEP_LOG_LINE@python.inline@ try:@@@",
- "@@@STEP_LOG_LINE@python.inline@ print subprocess.check_output([ADB, 'shell', 'cat ',@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu?/cpufreq/affected_cpus'])@@@",
- "@@@STEP_LOG_LINE@python.inline@ print subprocess.check_output([ADB, 'shell', 'cat ',@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu?/cpufreq/scaling_available_frequencies'])@@@",
- "@@@STEP_LOG_LINE@python.inline@ except Exception as e:@@@",
- "@@@STEP_LOG_LINE@python.inline@ print e.output.strip()@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Most devices give a list of their available frequencies.@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = subprocess.check_output([ADB, 'shell', 'cat '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies'])@@@",
+ "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo \"%s\" > '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])@@@",
+ "@@@STEP_LOG_LINE@python.inline@actual_gov = subprocess.check_output([ADB, 'shell', 'cat '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()@@@",
+ "@@@STEP_LOG_LINE@python.inline@if actual_gov != str(gov):@@@",
+ "@@@STEP_LOG_LINE@python.inline@ raise Exception('(actual, expected) (%s, %d)'@@@",
+ "@@@STEP_LOG_LINE@python.inline@ % (actual_gov, gov))@@@",
+ "@@@STEP_LOG_END@python.inline@@@"
+ ]
+ },
+ {
+ "cmd": [
+ "python",
+ "-u",
+ "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ncpu = int(sys.argv[2])\ngov = sys.argv[3]\n\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nsubprocess.check_output([ADB, 'shell', 'echo \"%s\" > '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])\nactual_gov = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()\nif actual_gov != str(gov):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_gov, gov))\n",
+ "/usr/bin/adb.1.0.35",
+ "2",
+ "userspace"
+ ],
+ "env": {
+ "BUILDTYPE": "Debug",
+ "CHROME_HEADLESS": "1",
+ "PATH": "<PATH>:RECIPE_PACKAGE_REPO[depot_tools]",
+ "SKIA_OUT": "[START_DIR]/out"
+ },
+ "infra_step": true,
+ "name": "Set CPU 2's governor to userspace",
+ "timeout": 30,
+ "~followup_annotations": [
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@import os@@@",
+ "@@@STEP_LOG_LINE@python.inline@import subprocess@@@",
+ "@@@STEP_LOG_LINE@python.inline@import sys@@@",
+ "@@@STEP_LOG_LINE@python.inline@import time@@@",
+ "@@@STEP_LOG_LINE@python.inline@ADB = sys.argv[1]@@@",
+ "@@@STEP_LOG_LINE@python.inline@cpu = int(sys.argv[2])@@@",
+ "@@@STEP_LOG_LINE@python.inline@gov = sys.argv[3]@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@log = subprocess.check_output([ADB, 'root'])@@@",
+ "@@@STEP_LOG_LINE@python.inline@# check for message like 'adbd cannot run as root in production builds'@@@",
+ "@@@STEP_LOG_LINE@python.inline@print log@@@",
+ "@@@STEP_LOG_LINE@python.inline@if 'cannot' in log:@@@",
+ "@@@STEP_LOG_LINE@python.inline@ raise Exception('adb root failed')@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Check for message like '/system/bin/sh: file not found'@@@",
- "@@@STEP_LOG_LINE@python.inline@ if available_freqs and '/system/bin/sh' not in available_freqs:@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = sorted(@@@",
- "@@@STEP_LOG_LINE@python.inline@ int(i) for i in available_freqs.strip().split())@@@",
- "@@@STEP_LOG_LINE@python.inline@ else:@@@",
- "@@@STEP_LOG_LINE@python.inline@ raise Exception('Could not get list of available frequencies: %s' %@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs)@@@",
+ "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo \"%s\" > '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])@@@",
+ "@@@STEP_LOG_LINE@python.inline@actual_gov = subprocess.check_output([ADB, 'shell', 'cat '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()@@@",
+ "@@@STEP_LOG_LINE@python.inline@if actual_gov != str(gov):@@@",
+ "@@@STEP_LOG_LINE@python.inline@ raise Exception('(actual, expected) (%s, %d)'@@@",
+ "@@@STEP_LOG_LINE@python.inline@ % (actual_gov, gov))@@@",
+ "@@@STEP_LOG_END@python.inline@@@"
+ ]
+ },
+ {
+ "cmd": [
+ "python",
+ "-u",
+ "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ntarget_percent = float(sys.argv[2])\ncpu = int(sys.argv[3])\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nroot = '/sys/devices/system/cpu/cpu%d/cpufreq' %cpu\n\n# All devices we test on give a list of their available frequencies.\navailable_freqs = subprocess.check_output([ADB, 'shell',\n 'cat %s/scaling_available_frequencies' % root])\n\n# Check for message like '/system/bin/sh: file not found'\nif available_freqs and '/system/bin/sh' not in available_freqs:\n available_freqs = sorted(\n int(i) for i in available_freqs.strip().split())\nelse:\n raise Exception('Could not get list of available frequencies: %s' %\n available_freqs)\n\nmaxfreq = available_freqs[-1]\ntarget = int(round(maxfreq * target_percent))\nfreq = maxfreq\nfor f in reversed(available_freqs):\n if f <= target:\n freq = f\n break\n\nprint 'Setting frequency to %d' % freq\n\n# If scaling_max_freq is lower than our attempted setting, it won't take.\n# We must set min first, because if we try to set max to be less than min\n# (which sometimes happens after certain devices reboot) it returns a\n# perplexing permissions error.\nsubprocess.check_output([ADB, 'shell', 'echo 0 > '\n '%s/scaling_min_freq' % root])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '%s/scaling_max_freq' % (freq, root)])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '%s/scaling_setspeed' % (freq, root)])\ntime.sleep(5)\nactual_freq = subprocess.check_output([ADB, 'shell', 'cat '\n '%s/scaling_cur_freq' % root]).strip()\nif actual_freq != str(freq):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_freq, freq))\n",
+ "/usr/bin/adb.1.0.35",
+ "0.6",
+ "2"
+ ],
+ "env": {
+ "BUILDTYPE": "Debug",
+ "CHROME_HEADLESS": "1",
+ "PATH": "<PATH>:RECIPE_PACKAGE_REPO[depot_tools]",
+ "SKIA_OUT": "[START_DIR]/out"
+ },
+ "infra_step": true,
+ "name": "Scale CPU 2 to 0.600000",
+ "timeout": 30,
+ "~followup_annotations": [
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@import os@@@",
+ "@@@STEP_LOG_LINE@python.inline@import subprocess@@@",
+ "@@@STEP_LOG_LINE@python.inline@import sys@@@",
+ "@@@STEP_LOG_LINE@python.inline@import time@@@",
+ "@@@STEP_LOG_LINE@python.inline@ADB = sys.argv[1]@@@",
+ "@@@STEP_LOG_LINE@python.inline@target_percent = float(sys.argv[2])@@@",
+ "@@@STEP_LOG_LINE@python.inline@cpu = int(sys.argv[3])@@@",
+ "@@@STEP_LOG_LINE@python.inline@log = subprocess.check_output([ADB, 'root'])@@@",
+ "@@@STEP_LOG_LINE@python.inline@# check for message like 'adbd cannot run as root in production builds'@@@",
+ "@@@STEP_LOG_LINE@python.inline@print log@@@",
+ "@@@STEP_LOG_LINE@python.inline@if 'cannot' in log:@@@",
+ "@@@STEP_LOG_LINE@python.inline@ raise Exception('adb root failed')@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@root = '/sys/devices/system/cpu/cpu%d/cpufreq' %cpu@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@# All devices we test on give a list of their available frequencies.@@@",
+ "@@@STEP_LOG_LINE@python.inline@available_freqs = subprocess.check_output([ADB, 'shell',@@@",
+ "@@@STEP_LOG_LINE@python.inline@ 'cat %s/scaling_available_frequencies' % root])@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@# Check for message like '/system/bin/sh: file not found'@@@",
+ "@@@STEP_LOG_LINE@python.inline@if available_freqs and '/system/bin/sh' not in available_freqs:@@@",
+ "@@@STEP_LOG_LINE@python.inline@ available_freqs = sorted(@@@",
+ "@@@STEP_LOG_LINE@python.inline@ int(i) for i in available_freqs.strip().split())@@@",
+ "@@@STEP_LOG_LINE@python.inline@else:@@@",
+ "@@@STEP_LOG_LINE@python.inline@ raise Exception('Could not get list of available frequencies: %s' %@@@",
+ "@@@STEP_LOG_LINE@python.inline@ available_freqs)@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@maxfreq = available_freqs[-1]@@@",
"@@@STEP_LOG_LINE@python.inline@target = int(round(maxfreq * target_percent))@@@",
@@ -706,21 +783,19 @@
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@print 'Setting frequency to %d' % freq@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo \"userspace\" > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor'])@@@",
"@@@STEP_LOG_LINE@python.inline@# If scaling_max_freq is lower than our attempted setting, it won't take.@@@",
"@@@STEP_LOG_LINE@python.inline@# We must set min first, because if we try to set max to be less than min@@@",
"@@@STEP_LOG_LINE@python.inline@# (which sometimes happens after certain devices reboot) it returns a@@@",
"@@@STEP_LOG_LINE@python.inline@# perplexing permissions error.@@@",
"@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo 0 > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq'])@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '%s/scaling_min_freq' % root])@@@",
"@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo %d > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '%s/scaling_max_freq' % (freq, root)])@@@",
"@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo %d > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed' % freq])@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '%s/scaling_setspeed' % (freq, root)])@@@",
"@@@STEP_LOG_LINE@python.inline@time.sleep(5)@@@",
"@@@STEP_LOG_LINE@python.inline@actual_freq = subprocess.check_output([ADB, 'shell', 'cat '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq']).strip()@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '%s/scaling_cur_freq' % root]).strip()@@@",
"@@@STEP_LOG_LINE@python.inline@if actual_freq != str(freq):@@@",
"@@@STEP_LOG_LINE@python.inline@ raise Exception('(actual, expected) (%s, %d)'@@@",
"@@@STEP_LOG_LINE@python.inline@ % (actual_freq, freq))@@@",
diff --git a/infra/bots/recipe_modules/flavor/examples/full.expected/Perf-Android-Clang-Pixel-GPU-Adreno530-arm64-Debug-All-Android.json b/infra/bots/recipe_modules/flavor/examples/full.expected/Perf-Android-Clang-Pixel-GPU-Adreno530-arm64-Debug-All-Android.json
index cb571cb01d..a68cf30392 100644
--- a/infra/bots/recipe_modules/flavor/examples/full.expected/Perf-Android-Clang-Pixel-GPU-Adreno530-arm64-Debug-All-Android.json
+++ b/infra/bots/recipe_modules/flavor/examples/full.expected/Perf-Android-Clang-Pixel-GPU-Adreno530-arm64-Debug-All-Android.json
@@ -642,10 +642,10 @@
"cmd": [
"python",
"-u",
- "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\nmodel = sys.argv[2]\ntarget_percent = float(sys.argv[3])\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nif model == 'Nexus7':\n # Nexus7 claims to support 1300000, but only really allows 1200000\n available_freqs = [51000, 102000, 204000, 340000, 475000, 640000, 760000,\n 860000, 1000000, 1100000, 1200000]\nelse:\n # Temporary logging to get a sense of what devices have multiple cpus\n try:\n print subprocess.check_output([ADB, 'shell', 'cat ',\n '/sys/devices/system/cpu/cpu?/cpufreq/affected_cpus'])\n print subprocess.check_output([ADB, 'shell', 'cat ',\n '/sys/devices/system/cpu/cpu?/cpufreq/scaling_available_frequencies'])\n except Exception as e:\n print e.output.strip()\n # Most devices give a list of their available frequencies.\n available_freqs = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies'])\n\n # Check for message like '/system/bin/sh: file not found'\n if available_freqs and '/system/bin/sh' not in available_freqs:\n available_freqs = sorted(\n int(i) for i in available_freqs.strip().split())\n else:\n raise Exception('Could not get list of available frequencies: %s' %\n available_freqs)\n\nmaxfreq = available_freqs[-1]\ntarget = int(round(maxfreq * target_percent))\nfreq = maxfreq\nfor f in reversed(available_freqs):\n if f <= target:\n freq = f\n break\n\nprint 'Setting frequency to %d' % freq\n\nsubprocess.check_output([ADB, 'shell', 'echo \"userspace\" > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor'])\n# If scaling_max_freq is lower than our attempted setting, it won't take.\n# We must set min first, because if we try to set max to be less than min\n# (which sometimes happens after certain devices reboot) it returns a\n# perplexing permissions error.\nsubprocess.check_output([ADB, 'shell', 'echo 0 > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq'])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed' % freq])\ntime.sleep(5)\nactual_freq = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq']).strip()\nif actual_freq != str(freq):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_freq, freq))\n",
+ "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ncpu = int(sys.argv[2])\ngov = sys.argv[3]\n\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nsubprocess.check_output([ADB, 'shell', 'echo \"%s\" > '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])\nactual_gov = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()\nif actual_gov != str(gov):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_gov, gov))\n",
"/usr/bin/adb.1.0.35",
- "Pixel",
- "0.6"
+ "0",
+ "powersave"
],
"env": {
"BUILDTYPE": "Debug",
@@ -654,7 +654,7 @@
"SKIA_OUT": "[START_DIR]/out"
},
"infra_step": true,
- "name": "Scale CPU to 0.600000",
+ "name": "Set CPU 0's governor to powersave",
"timeout": 30,
"~followup_annotations": [
"@@@STEP_LOG_LINE@python.inline@@@@",
@@ -663,38 +663,115 @@
"@@@STEP_LOG_LINE@python.inline@import sys@@@",
"@@@STEP_LOG_LINE@python.inline@import time@@@",
"@@@STEP_LOG_LINE@python.inline@ADB = sys.argv[1]@@@",
- "@@@STEP_LOG_LINE@python.inline@model = sys.argv[2]@@@",
- "@@@STEP_LOG_LINE@python.inline@target_percent = float(sys.argv[3])@@@",
+ "@@@STEP_LOG_LINE@python.inline@cpu = int(sys.argv[2])@@@",
+ "@@@STEP_LOG_LINE@python.inline@gov = sys.argv[3]@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@log = subprocess.check_output([ADB, 'root'])@@@",
"@@@STEP_LOG_LINE@python.inline@# check for message like 'adbd cannot run as root in production builds'@@@",
"@@@STEP_LOG_LINE@python.inline@print log@@@",
"@@@STEP_LOG_LINE@python.inline@if 'cannot' in log:@@@",
"@@@STEP_LOG_LINE@python.inline@ raise Exception('adb root failed')@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@if model == 'Nexus7':@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Nexus7 claims to support 1300000, but only really allows 1200000@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = [51000, 102000, 204000, 340000, 475000, 640000, 760000,@@@",
- "@@@STEP_LOG_LINE@python.inline@ 860000, 1000000, 1100000, 1200000]@@@",
- "@@@STEP_LOG_LINE@python.inline@else:@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Temporary logging to get a sense of what devices have multiple cpus@@@",
- "@@@STEP_LOG_LINE@python.inline@ try:@@@",
- "@@@STEP_LOG_LINE@python.inline@ print subprocess.check_output([ADB, 'shell', 'cat ',@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu?/cpufreq/affected_cpus'])@@@",
- "@@@STEP_LOG_LINE@python.inline@ print subprocess.check_output([ADB, 'shell', 'cat ',@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu?/cpufreq/scaling_available_frequencies'])@@@",
- "@@@STEP_LOG_LINE@python.inline@ except Exception as e:@@@",
- "@@@STEP_LOG_LINE@python.inline@ print e.output.strip()@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Most devices give a list of their available frequencies.@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = subprocess.check_output([ADB, 'shell', 'cat '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies'])@@@",
+ "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo \"%s\" > '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])@@@",
+ "@@@STEP_LOG_LINE@python.inline@actual_gov = subprocess.check_output([ADB, 'shell', 'cat '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()@@@",
+ "@@@STEP_LOG_LINE@python.inline@if actual_gov != str(gov):@@@",
+ "@@@STEP_LOG_LINE@python.inline@ raise Exception('(actual, expected) (%s, %d)'@@@",
+ "@@@STEP_LOG_LINE@python.inline@ % (actual_gov, gov))@@@",
+ "@@@STEP_LOG_END@python.inline@@@"
+ ]
+ },
+ {
+ "cmd": [
+ "python",
+ "-u",
+ "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ncpu = int(sys.argv[2])\ngov = sys.argv[3]\n\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nsubprocess.check_output([ADB, 'shell', 'echo \"%s\" > '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])\nactual_gov = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()\nif actual_gov != str(gov):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_gov, gov))\n",
+ "/usr/bin/adb.1.0.35",
+ "2",
+ "userspace"
+ ],
+ "env": {
+ "BUILDTYPE": "Debug",
+ "CHROME_HEADLESS": "1",
+ "PATH": "<PATH>:RECIPE_PACKAGE_REPO[depot_tools]",
+ "SKIA_OUT": "[START_DIR]/out"
+ },
+ "infra_step": true,
+ "name": "Set CPU 2's governor to userspace",
+ "timeout": 30,
+ "~followup_annotations": [
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@import os@@@",
+ "@@@STEP_LOG_LINE@python.inline@import subprocess@@@",
+ "@@@STEP_LOG_LINE@python.inline@import sys@@@",
+ "@@@STEP_LOG_LINE@python.inline@import time@@@",
+ "@@@STEP_LOG_LINE@python.inline@ADB = sys.argv[1]@@@",
+ "@@@STEP_LOG_LINE@python.inline@cpu = int(sys.argv[2])@@@",
+ "@@@STEP_LOG_LINE@python.inline@gov = sys.argv[3]@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@log = subprocess.check_output([ADB, 'root'])@@@",
+ "@@@STEP_LOG_LINE@python.inline@# check for message like 'adbd cannot run as root in production builds'@@@",
+ "@@@STEP_LOG_LINE@python.inline@print log@@@",
+ "@@@STEP_LOG_LINE@python.inline@if 'cannot' in log:@@@",
+ "@@@STEP_LOG_LINE@python.inline@ raise Exception('adb root failed')@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Check for message like '/system/bin/sh: file not found'@@@",
- "@@@STEP_LOG_LINE@python.inline@ if available_freqs and '/system/bin/sh' not in available_freqs:@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = sorted(@@@",
- "@@@STEP_LOG_LINE@python.inline@ int(i) for i in available_freqs.strip().split())@@@",
- "@@@STEP_LOG_LINE@python.inline@ else:@@@",
- "@@@STEP_LOG_LINE@python.inline@ raise Exception('Could not get list of available frequencies: %s' %@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs)@@@",
+ "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo \"%s\" > '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])@@@",
+ "@@@STEP_LOG_LINE@python.inline@actual_gov = subprocess.check_output([ADB, 'shell', 'cat '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()@@@",
+ "@@@STEP_LOG_LINE@python.inline@if actual_gov != str(gov):@@@",
+ "@@@STEP_LOG_LINE@python.inline@ raise Exception('(actual, expected) (%s, %d)'@@@",
+ "@@@STEP_LOG_LINE@python.inline@ % (actual_gov, gov))@@@",
+ "@@@STEP_LOG_END@python.inline@@@"
+ ]
+ },
+ {
+ "cmd": [
+ "python",
+ "-u",
+ "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ntarget_percent = float(sys.argv[2])\ncpu = int(sys.argv[3])\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nroot = '/sys/devices/system/cpu/cpu%d/cpufreq' %cpu\n\n# All devices we test on give a list of their available frequencies.\navailable_freqs = subprocess.check_output([ADB, 'shell',\n 'cat %s/scaling_available_frequencies' % root])\n\n# Check for message like '/system/bin/sh: file not found'\nif available_freqs and '/system/bin/sh' not in available_freqs:\n available_freqs = sorted(\n int(i) for i in available_freqs.strip().split())\nelse:\n raise Exception('Could not get list of available frequencies: %s' %\n available_freqs)\n\nmaxfreq = available_freqs[-1]\ntarget = int(round(maxfreq * target_percent))\nfreq = maxfreq\nfor f in reversed(available_freqs):\n if f <= target:\n freq = f\n break\n\nprint 'Setting frequency to %d' % freq\n\n# If scaling_max_freq is lower than our attempted setting, it won't take.\n# We must set min first, because if we try to set max to be less than min\n# (which sometimes happens after certain devices reboot) it returns a\n# perplexing permissions error.\nsubprocess.check_output([ADB, 'shell', 'echo 0 > '\n '%s/scaling_min_freq' % root])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '%s/scaling_max_freq' % (freq, root)])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '%s/scaling_setspeed' % (freq, root)])\ntime.sleep(5)\nactual_freq = subprocess.check_output([ADB, 'shell', 'cat '\n '%s/scaling_cur_freq' % root]).strip()\nif actual_freq != str(freq):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_freq, freq))\n",
+ "/usr/bin/adb.1.0.35",
+ "0.6",
+ "2"
+ ],
+ "env": {
+ "BUILDTYPE": "Debug",
+ "CHROME_HEADLESS": "1",
+ "PATH": "<PATH>:RECIPE_PACKAGE_REPO[depot_tools]",
+ "SKIA_OUT": "[START_DIR]/out"
+ },
+ "infra_step": true,
+ "name": "Scale CPU 2 to 0.600000",
+ "timeout": 30,
+ "~followup_annotations": [
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@import os@@@",
+ "@@@STEP_LOG_LINE@python.inline@import subprocess@@@",
+ "@@@STEP_LOG_LINE@python.inline@import sys@@@",
+ "@@@STEP_LOG_LINE@python.inline@import time@@@",
+ "@@@STEP_LOG_LINE@python.inline@ADB = sys.argv[1]@@@",
+ "@@@STEP_LOG_LINE@python.inline@target_percent = float(sys.argv[2])@@@",
+ "@@@STEP_LOG_LINE@python.inline@cpu = int(sys.argv[3])@@@",
+ "@@@STEP_LOG_LINE@python.inline@log = subprocess.check_output([ADB, 'root'])@@@",
+ "@@@STEP_LOG_LINE@python.inline@# check for message like 'adbd cannot run as root in production builds'@@@",
+ "@@@STEP_LOG_LINE@python.inline@print log@@@",
+ "@@@STEP_LOG_LINE@python.inline@if 'cannot' in log:@@@",
+ "@@@STEP_LOG_LINE@python.inline@ raise Exception('adb root failed')@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@root = '/sys/devices/system/cpu/cpu%d/cpufreq' %cpu@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@# All devices we test on give a list of their available frequencies.@@@",
+ "@@@STEP_LOG_LINE@python.inline@available_freqs = subprocess.check_output([ADB, 'shell',@@@",
+ "@@@STEP_LOG_LINE@python.inline@ 'cat %s/scaling_available_frequencies' % root])@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@# Check for message like '/system/bin/sh: file not found'@@@",
+ "@@@STEP_LOG_LINE@python.inline@if available_freqs and '/system/bin/sh' not in available_freqs:@@@",
+ "@@@STEP_LOG_LINE@python.inline@ available_freqs = sorted(@@@",
+ "@@@STEP_LOG_LINE@python.inline@ int(i) for i in available_freqs.strip().split())@@@",
+ "@@@STEP_LOG_LINE@python.inline@else:@@@",
+ "@@@STEP_LOG_LINE@python.inline@ raise Exception('Could not get list of available frequencies: %s' %@@@",
+ "@@@STEP_LOG_LINE@python.inline@ available_freqs)@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@maxfreq = available_freqs[-1]@@@",
"@@@STEP_LOG_LINE@python.inline@target = int(round(maxfreq * target_percent))@@@",
@@ -706,21 +783,19 @@
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@print 'Setting frequency to %d' % freq@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo \"userspace\" > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor'])@@@",
"@@@STEP_LOG_LINE@python.inline@# If scaling_max_freq is lower than our attempted setting, it won't take.@@@",
"@@@STEP_LOG_LINE@python.inline@# We must set min first, because if we try to set max to be less than min@@@",
"@@@STEP_LOG_LINE@python.inline@# (which sometimes happens after certain devices reboot) it returns a@@@",
"@@@STEP_LOG_LINE@python.inline@# perplexing permissions error.@@@",
"@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo 0 > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq'])@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '%s/scaling_min_freq' % root])@@@",
"@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo %d > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '%s/scaling_max_freq' % (freq, root)])@@@",
"@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo %d > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed' % freq])@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '%s/scaling_setspeed' % (freq, root)])@@@",
"@@@STEP_LOG_LINE@python.inline@time.sleep(5)@@@",
"@@@STEP_LOG_LINE@python.inline@actual_freq = subprocess.check_output([ADB, 'shell', 'cat '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq']).strip()@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '%s/scaling_cur_freq' % root]).strip()@@@",
"@@@STEP_LOG_LINE@python.inline@if actual_freq != str(freq):@@@",
"@@@STEP_LOG_LINE@python.inline@ raise Exception('(actual, expected) (%s, %d)'@@@",
"@@@STEP_LOG_LINE@python.inline@ % (actual_freq, freq))@@@",
diff --git a/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Android-Clang-Nexus5x-GPU-Adreno418-arm64-Debug-All-Android.json b/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Android-Clang-Nexus5x-GPU-Adreno418-arm64-Debug-All-Android.json
index 6c78798af4..0cc200d2e4 100644
--- a/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Android-Clang-Nexus5x-GPU-Adreno418-arm64-Debug-All-Android.json
+++ b/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Android-Clang-Nexus5x-GPU-Adreno418-arm64-Debug-All-Android.json
@@ -642,10 +642,10 @@
"cmd": [
"python",
"-u",
- "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\nmodel = sys.argv[2]\ntarget_percent = float(sys.argv[3])\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nif model == 'Nexus7':\n # Nexus7 claims to support 1300000, but only really allows 1200000\n available_freqs = [51000, 102000, 204000, 340000, 475000, 640000, 760000,\n 860000, 1000000, 1100000, 1200000]\nelse:\n # Temporary logging to get a sense of what devices have multiple cpus\n try:\n print subprocess.check_output([ADB, 'shell', 'cat ',\n '/sys/devices/system/cpu/cpu?/cpufreq/affected_cpus'])\n print subprocess.check_output([ADB, 'shell', 'cat ',\n '/sys/devices/system/cpu/cpu?/cpufreq/scaling_available_frequencies'])\n except Exception as e:\n print e.output.strip()\n # Most devices give a list of their available frequencies.\n available_freqs = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies'])\n\n # Check for message like '/system/bin/sh: file not found'\n if available_freqs and '/system/bin/sh' not in available_freqs:\n available_freqs = sorted(\n int(i) for i in available_freqs.strip().split())\n else:\n raise Exception('Could not get list of available frequencies: %s' %\n available_freqs)\n\nmaxfreq = available_freqs[-1]\ntarget = int(round(maxfreq * target_percent))\nfreq = maxfreq\nfor f in reversed(available_freqs):\n if f <= target:\n freq = f\n break\n\nprint 'Setting frequency to %d' % freq\n\nsubprocess.check_output([ADB, 'shell', 'echo \"userspace\" > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor'])\n# If scaling_max_freq is lower than our attempted setting, it won't take.\n# We must set min first, because if we try to set max to be less than min\n# (which sometimes happens after certain devices reboot) it returns a\n# perplexing permissions error.\nsubprocess.check_output([ADB, 'shell', 'echo 0 > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq'])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed' % freq])\ntime.sleep(5)\nactual_freq = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq']).strip()\nif actual_freq != str(freq):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_freq, freq))\n",
+ "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ncpu = int(sys.argv[2])\ngov = sys.argv[3]\n\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nsubprocess.check_output([ADB, 'shell', 'echo \"%s\" > '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])\nactual_gov = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()\nif actual_gov != str(gov):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_gov, gov))\n",
"/opt/infra-android/tools/adb",
- "Nexus5x",
- "1.0"
+ "4",
+ "ondemand"
],
"env": {
"BUILDTYPE": "Debug",
@@ -654,7 +654,7 @@
"SKIA_OUT": "[START_DIR]/out"
},
"infra_step": true,
- "name": "Scale CPU to 1.000000",
+ "name": "Set CPU 4's governor to ondemand",
"timeout": 30,
"~followup_annotations": [
"@@@STEP_LOG_LINE@python.inline@@@@",
@@ -663,67 +663,66 @@
"@@@STEP_LOG_LINE@python.inline@import sys@@@",
"@@@STEP_LOG_LINE@python.inline@import time@@@",
"@@@STEP_LOG_LINE@python.inline@ADB = sys.argv[1]@@@",
- "@@@STEP_LOG_LINE@python.inline@model = sys.argv[2]@@@",
- "@@@STEP_LOG_LINE@python.inline@target_percent = float(sys.argv[3])@@@",
+ "@@@STEP_LOG_LINE@python.inline@cpu = int(sys.argv[2])@@@",
+ "@@@STEP_LOG_LINE@python.inline@gov = sys.argv[3]@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@log = subprocess.check_output([ADB, 'root'])@@@",
"@@@STEP_LOG_LINE@python.inline@# check for message like 'adbd cannot run as root in production builds'@@@",
"@@@STEP_LOG_LINE@python.inline@print log@@@",
"@@@STEP_LOG_LINE@python.inline@if 'cannot' in log:@@@",
"@@@STEP_LOG_LINE@python.inline@ raise Exception('adb root failed')@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@if model == 'Nexus7':@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Nexus7 claims to support 1300000, but only really allows 1200000@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = [51000, 102000, 204000, 340000, 475000, 640000, 760000,@@@",
- "@@@STEP_LOG_LINE@python.inline@ 860000, 1000000, 1100000, 1200000]@@@",
- "@@@STEP_LOG_LINE@python.inline@else:@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Temporary logging to get a sense of what devices have multiple cpus@@@",
- "@@@STEP_LOG_LINE@python.inline@ try:@@@",
- "@@@STEP_LOG_LINE@python.inline@ print subprocess.check_output([ADB, 'shell', 'cat ',@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu?/cpufreq/affected_cpus'])@@@",
- "@@@STEP_LOG_LINE@python.inline@ print subprocess.check_output([ADB, 'shell', 'cat ',@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu?/cpufreq/scaling_available_frequencies'])@@@",
- "@@@STEP_LOG_LINE@python.inline@ except Exception as e:@@@",
- "@@@STEP_LOG_LINE@python.inline@ print e.output.strip()@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Most devices give a list of their available frequencies.@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = subprocess.check_output([ADB, 'shell', 'cat '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies'])@@@",
- "@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Check for message like '/system/bin/sh: file not found'@@@",
- "@@@STEP_LOG_LINE@python.inline@ if available_freqs and '/system/bin/sh' not in available_freqs:@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = sorted(@@@",
- "@@@STEP_LOG_LINE@python.inline@ int(i) for i in available_freqs.strip().split())@@@",
- "@@@STEP_LOG_LINE@python.inline@ else:@@@",
- "@@@STEP_LOG_LINE@python.inline@ raise Exception('Could not get list of available frequencies: %s' %@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs)@@@",
+ "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo \"%s\" > '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])@@@",
+ "@@@STEP_LOG_LINE@python.inline@actual_gov = subprocess.check_output([ADB, 'shell', 'cat '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()@@@",
+ "@@@STEP_LOG_LINE@python.inline@if actual_gov != str(gov):@@@",
+ "@@@STEP_LOG_LINE@python.inline@ raise Exception('(actual, expected) (%s, %d)'@@@",
+ "@@@STEP_LOG_LINE@python.inline@ % (actual_gov, gov))@@@",
+ "@@@STEP_LOG_END@python.inline@@@"
+ ]
+ },
+ {
+ "cmd": [
+ "python",
+ "-u",
+ "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ncpu = int(sys.argv[2])\ngov = sys.argv[3]\n\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nsubprocess.check_output([ADB, 'shell', 'echo \"%s\" > '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])\nactual_gov = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()\nif actual_gov != str(gov):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_gov, gov))\n",
+ "/opt/infra-android/tools/adb",
+ "0",
+ "ondemand"
+ ],
+ "env": {
+ "BUILDTYPE": "Debug",
+ "CHROME_HEADLESS": "1",
+ "PATH": "<PATH>:RECIPE_PACKAGE_REPO[depot_tools]",
+ "SKIA_OUT": "[START_DIR]/out"
+ },
+ "infra_step": true,
+ "name": "Set CPU 0's governor to ondemand",
+ "timeout": 30,
+ "~followup_annotations": [
"@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@maxfreq = available_freqs[-1]@@@",
- "@@@STEP_LOG_LINE@python.inline@target = int(round(maxfreq * target_percent))@@@",
- "@@@STEP_LOG_LINE@python.inline@freq = maxfreq@@@",
- "@@@STEP_LOG_LINE@python.inline@for f in reversed(available_freqs):@@@",
- "@@@STEP_LOG_LINE@python.inline@ if f <= target:@@@",
- "@@@STEP_LOG_LINE@python.inline@ freq = f@@@",
- "@@@STEP_LOG_LINE@python.inline@ break@@@",
+ "@@@STEP_LOG_LINE@python.inline@import os@@@",
+ "@@@STEP_LOG_LINE@python.inline@import subprocess@@@",
+ "@@@STEP_LOG_LINE@python.inline@import sys@@@",
+ "@@@STEP_LOG_LINE@python.inline@import time@@@",
+ "@@@STEP_LOG_LINE@python.inline@ADB = sys.argv[1]@@@",
+ "@@@STEP_LOG_LINE@python.inline@cpu = int(sys.argv[2])@@@",
+ "@@@STEP_LOG_LINE@python.inline@gov = sys.argv[3]@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@print 'Setting frequency to %d' % freq@@@",
+ "@@@STEP_LOG_LINE@python.inline@log = subprocess.check_output([ADB, 'root'])@@@",
+ "@@@STEP_LOG_LINE@python.inline@# check for message like 'adbd cannot run as root in production builds'@@@",
+ "@@@STEP_LOG_LINE@python.inline@print log@@@",
+ "@@@STEP_LOG_LINE@python.inline@if 'cannot' in log:@@@",
+ "@@@STEP_LOG_LINE@python.inline@ raise Exception('adb root failed')@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo \"userspace\" > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor'])@@@",
- "@@@STEP_LOG_LINE@python.inline@# If scaling_max_freq is lower than our attempted setting, it won't take.@@@",
- "@@@STEP_LOG_LINE@python.inline@# We must set min first, because if we try to set max to be less than min@@@",
- "@@@STEP_LOG_LINE@python.inline@# (which sometimes happens after certain devices reboot) it returns a@@@",
- "@@@STEP_LOG_LINE@python.inline@# perplexing permissions error.@@@",
- "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo 0 > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq'])@@@",
- "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo %d > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])@@@",
- "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo %d > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed' % freq])@@@",
- "@@@STEP_LOG_LINE@python.inline@time.sleep(5)@@@",
- "@@@STEP_LOG_LINE@python.inline@actual_freq = subprocess.check_output([ADB, 'shell', 'cat '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq']).strip()@@@",
- "@@@STEP_LOG_LINE@python.inline@if actual_freq != str(freq):@@@",
+ "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo \"%s\" > '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])@@@",
+ "@@@STEP_LOG_LINE@python.inline@actual_gov = subprocess.check_output([ADB, 'shell', 'cat '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()@@@",
+ "@@@STEP_LOG_LINE@python.inline@if actual_gov != str(gov):@@@",
"@@@STEP_LOG_LINE@python.inline@ raise Exception('(actual, expected) (%s, %d)'@@@",
- "@@@STEP_LOG_LINE@python.inline@ % (actual_freq, freq))@@@",
+ "@@@STEP_LOG_LINE@python.inline@ % (actual_gov, gov))@@@",
"@@@STEP_LOG_END@python.inline@@@"
]
},
diff --git a/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Android-Clang-Nexus7-CPU-Tegra3-arm-Release-All-Android.json b/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Android-Clang-Nexus7-CPU-Tegra3-arm-Release-All-Android.json
index 6a8f10b99e..a33e739db3 100644
--- a/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Android-Clang-Nexus7-CPU-Tegra3-arm-Release-All-Android.json
+++ b/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Android-Clang-Nexus7-CPU-Tegra3-arm-Release-All-Android.json
@@ -642,10 +642,10 @@
"cmd": [
"python",
"-u",
- "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\nmodel = sys.argv[2]\ntarget_percent = float(sys.argv[3])\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nif model == 'Nexus7':\n # Nexus7 claims to support 1300000, but only really allows 1200000\n available_freqs = [51000, 102000, 204000, 340000, 475000, 640000, 760000,\n 860000, 1000000, 1100000, 1200000]\nelse:\n # Temporary logging to get a sense of what devices have multiple cpus\n try:\n print subprocess.check_output([ADB, 'shell', 'cat ',\n '/sys/devices/system/cpu/cpu?/cpufreq/affected_cpus'])\n print subprocess.check_output([ADB, 'shell', 'cat ',\n '/sys/devices/system/cpu/cpu?/cpufreq/scaling_available_frequencies'])\n except Exception as e:\n print e.output.strip()\n # Most devices give a list of their available frequencies.\n available_freqs = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies'])\n\n # Check for message like '/system/bin/sh: file not found'\n if available_freqs and '/system/bin/sh' not in available_freqs:\n available_freqs = sorted(\n int(i) for i in available_freqs.strip().split())\n else:\n raise Exception('Could not get list of available frequencies: %s' %\n available_freqs)\n\nmaxfreq = available_freqs[-1]\ntarget = int(round(maxfreq * target_percent))\nfreq = maxfreq\nfor f in reversed(available_freqs):\n if f <= target:\n freq = f\n break\n\nprint 'Setting frequency to %d' % freq\n\nsubprocess.check_output([ADB, 'shell', 'echo \"userspace\" > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor'])\n# If scaling_max_freq is lower than our attempted setting, it won't take.\n# We must set min first, because if we try to set max to be less than min\n# (which sometimes happens after certain devices reboot) it returns a\n# perplexing permissions error.\nsubprocess.check_output([ADB, 'shell', 'echo 0 > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq'])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed' % freq])\ntime.sleep(5)\nactual_freq = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq']).strip()\nif actual_freq != str(freq):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_freq, freq))\n",
+ "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ncpu = int(sys.argv[2])\ngov = sys.argv[3]\n\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nsubprocess.check_output([ADB, 'shell', 'echo \"%s\" > '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])\nactual_gov = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()\nif actual_gov != str(gov):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_gov, gov))\n",
"/usr/bin/adb.1.0.35",
- "Nexus7",
- "1.0"
+ "0",
+ "ondemand"
],
"env": {
"BUILDTYPE": "Release",
@@ -654,7 +654,7 @@
"SKIA_OUT": "[START_DIR]/out"
},
"infra_step": true,
- "name": "Scale CPU to 1.000000",
+ "name": "Set CPU 0's governor to ondemand",
"timeout": 30,
"~followup_annotations": [
"@@@STEP_LOG_LINE@python.inline@@@@",
@@ -663,67 +663,22 @@
"@@@STEP_LOG_LINE@python.inline@import sys@@@",
"@@@STEP_LOG_LINE@python.inline@import time@@@",
"@@@STEP_LOG_LINE@python.inline@ADB = sys.argv[1]@@@",
- "@@@STEP_LOG_LINE@python.inline@model = sys.argv[2]@@@",
- "@@@STEP_LOG_LINE@python.inline@target_percent = float(sys.argv[3])@@@",
+ "@@@STEP_LOG_LINE@python.inline@cpu = int(sys.argv[2])@@@",
+ "@@@STEP_LOG_LINE@python.inline@gov = sys.argv[3]@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@log = subprocess.check_output([ADB, 'root'])@@@",
"@@@STEP_LOG_LINE@python.inline@# check for message like 'adbd cannot run as root in production builds'@@@",
"@@@STEP_LOG_LINE@python.inline@print log@@@",
"@@@STEP_LOG_LINE@python.inline@if 'cannot' in log:@@@",
"@@@STEP_LOG_LINE@python.inline@ raise Exception('adb root failed')@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@if model == 'Nexus7':@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Nexus7 claims to support 1300000, but only really allows 1200000@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = [51000, 102000, 204000, 340000, 475000, 640000, 760000,@@@",
- "@@@STEP_LOG_LINE@python.inline@ 860000, 1000000, 1100000, 1200000]@@@",
- "@@@STEP_LOG_LINE@python.inline@else:@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Temporary logging to get a sense of what devices have multiple cpus@@@",
- "@@@STEP_LOG_LINE@python.inline@ try:@@@",
- "@@@STEP_LOG_LINE@python.inline@ print subprocess.check_output([ADB, 'shell', 'cat ',@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu?/cpufreq/affected_cpus'])@@@",
- "@@@STEP_LOG_LINE@python.inline@ print subprocess.check_output([ADB, 'shell', 'cat ',@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu?/cpufreq/scaling_available_frequencies'])@@@",
- "@@@STEP_LOG_LINE@python.inline@ except Exception as e:@@@",
- "@@@STEP_LOG_LINE@python.inline@ print e.output.strip()@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Most devices give a list of their available frequencies.@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = subprocess.check_output([ADB, 'shell', 'cat '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies'])@@@",
- "@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Check for message like '/system/bin/sh: file not found'@@@",
- "@@@STEP_LOG_LINE@python.inline@ if available_freqs and '/system/bin/sh' not in available_freqs:@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = sorted(@@@",
- "@@@STEP_LOG_LINE@python.inline@ int(i) for i in available_freqs.strip().split())@@@",
- "@@@STEP_LOG_LINE@python.inline@ else:@@@",
- "@@@STEP_LOG_LINE@python.inline@ raise Exception('Could not get list of available frequencies: %s' %@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs)@@@",
- "@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@maxfreq = available_freqs[-1]@@@",
- "@@@STEP_LOG_LINE@python.inline@target = int(round(maxfreq * target_percent))@@@",
- "@@@STEP_LOG_LINE@python.inline@freq = maxfreq@@@",
- "@@@STEP_LOG_LINE@python.inline@for f in reversed(available_freqs):@@@",
- "@@@STEP_LOG_LINE@python.inline@ if f <= target:@@@",
- "@@@STEP_LOG_LINE@python.inline@ freq = f@@@",
- "@@@STEP_LOG_LINE@python.inline@ break@@@",
- "@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@print 'Setting frequency to %d' % freq@@@",
- "@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo \"userspace\" > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor'])@@@",
- "@@@STEP_LOG_LINE@python.inline@# If scaling_max_freq is lower than our attempted setting, it won't take.@@@",
- "@@@STEP_LOG_LINE@python.inline@# We must set min first, because if we try to set max to be less than min@@@",
- "@@@STEP_LOG_LINE@python.inline@# (which sometimes happens after certain devices reboot) it returns a@@@",
- "@@@STEP_LOG_LINE@python.inline@# perplexing permissions error.@@@",
- "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo 0 > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq'])@@@",
- "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo %d > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])@@@",
- "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo %d > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed' % freq])@@@",
- "@@@STEP_LOG_LINE@python.inline@time.sleep(5)@@@",
- "@@@STEP_LOG_LINE@python.inline@actual_freq = subprocess.check_output([ADB, 'shell', 'cat '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq']).strip()@@@",
- "@@@STEP_LOG_LINE@python.inline@if actual_freq != str(freq):@@@",
+ "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo \"%s\" > '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])@@@",
+ "@@@STEP_LOG_LINE@python.inline@actual_gov = subprocess.check_output([ADB, 'shell', 'cat '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()@@@",
+ "@@@STEP_LOG_LINE@python.inline@if actual_gov != str(gov):@@@",
"@@@STEP_LOG_LINE@python.inline@ raise Exception('(actual, expected) (%s, %d)'@@@",
- "@@@STEP_LOG_LINE@python.inline@ % (actual_freq, freq))@@@",
+ "@@@STEP_LOG_LINE@python.inline@ % (actual_gov, gov))@@@",
"@@@STEP_LOG_END@python.inline@@@"
]
},
diff --git a/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Android-Clang-Pixel-GPU-Adreno530-arm64-Debug-All-Android.json b/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Android-Clang-Pixel-GPU-Adreno530-arm64-Debug-All-Android.json
index f9480621d6..03f7ec279b 100644
--- a/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Android-Clang-Pixel-GPU-Adreno530-arm64-Debug-All-Android.json
+++ b/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Android-Clang-Pixel-GPU-Adreno530-arm64-Debug-All-Android.json
@@ -642,10 +642,10 @@
"cmd": [
"python",
"-u",
- "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\nmodel = sys.argv[2]\ntarget_percent = float(sys.argv[3])\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nif model == 'Nexus7':\n # Nexus7 claims to support 1300000, but only really allows 1200000\n available_freqs = [51000, 102000, 204000, 340000, 475000, 640000, 760000,\n 860000, 1000000, 1100000, 1200000]\nelse:\n # Temporary logging to get a sense of what devices have multiple cpus\n try:\n print subprocess.check_output([ADB, 'shell', 'cat ',\n '/sys/devices/system/cpu/cpu?/cpufreq/affected_cpus'])\n print subprocess.check_output([ADB, 'shell', 'cat ',\n '/sys/devices/system/cpu/cpu?/cpufreq/scaling_available_frequencies'])\n except Exception as e:\n print e.output.strip()\n # Most devices give a list of their available frequencies.\n available_freqs = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies'])\n\n # Check for message like '/system/bin/sh: file not found'\n if available_freqs and '/system/bin/sh' not in available_freqs:\n available_freqs = sorted(\n int(i) for i in available_freqs.strip().split())\n else:\n raise Exception('Could not get list of available frequencies: %s' %\n available_freqs)\n\nmaxfreq = available_freqs[-1]\ntarget = int(round(maxfreq * target_percent))\nfreq = maxfreq\nfor f in reversed(available_freqs):\n if f <= target:\n freq = f\n break\n\nprint 'Setting frequency to %d' % freq\n\nsubprocess.check_output([ADB, 'shell', 'echo \"userspace\" > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor'])\n# If scaling_max_freq is lower than our attempted setting, it won't take.\n# We must set min first, because if we try to set max to be less than min\n# (which sometimes happens after certain devices reboot) it returns a\n# perplexing permissions error.\nsubprocess.check_output([ADB, 'shell', 'echo 0 > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq'])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed' % freq])\ntime.sleep(5)\nactual_freq = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq']).strip()\nif actual_freq != str(freq):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_freq, freq))\n",
+ "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ncpu = int(sys.argv[2])\ngov = sys.argv[3]\n\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nsubprocess.check_output([ADB, 'shell', 'echo \"%s\" > '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])\nactual_gov = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()\nif actual_gov != str(gov):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_gov, gov))\n",
"/usr/bin/adb.1.0.35",
- "Pixel",
- "1.0"
+ "2",
+ "ondemand"
],
"env": {
"BUILDTYPE": "Debug",
@@ -654,7 +654,7 @@
"SKIA_OUT": "[START_DIR]/out"
},
"infra_step": true,
- "name": "Scale CPU to 1.000000",
+ "name": "Set CPU 2's governor to ondemand",
"timeout": 30,
"~followup_annotations": [
"@@@STEP_LOG_LINE@python.inline@@@@",
@@ -663,67 +663,66 @@
"@@@STEP_LOG_LINE@python.inline@import sys@@@",
"@@@STEP_LOG_LINE@python.inline@import time@@@",
"@@@STEP_LOG_LINE@python.inline@ADB = sys.argv[1]@@@",
- "@@@STEP_LOG_LINE@python.inline@model = sys.argv[2]@@@",
- "@@@STEP_LOG_LINE@python.inline@target_percent = float(sys.argv[3])@@@",
+ "@@@STEP_LOG_LINE@python.inline@cpu = int(sys.argv[2])@@@",
+ "@@@STEP_LOG_LINE@python.inline@gov = sys.argv[3]@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@log = subprocess.check_output([ADB, 'root'])@@@",
"@@@STEP_LOG_LINE@python.inline@# check for message like 'adbd cannot run as root in production builds'@@@",
"@@@STEP_LOG_LINE@python.inline@print log@@@",
"@@@STEP_LOG_LINE@python.inline@if 'cannot' in log:@@@",
"@@@STEP_LOG_LINE@python.inline@ raise Exception('adb root failed')@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@if model == 'Nexus7':@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Nexus7 claims to support 1300000, but only really allows 1200000@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = [51000, 102000, 204000, 340000, 475000, 640000, 760000,@@@",
- "@@@STEP_LOG_LINE@python.inline@ 860000, 1000000, 1100000, 1200000]@@@",
- "@@@STEP_LOG_LINE@python.inline@else:@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Temporary logging to get a sense of what devices have multiple cpus@@@",
- "@@@STEP_LOG_LINE@python.inline@ try:@@@",
- "@@@STEP_LOG_LINE@python.inline@ print subprocess.check_output([ADB, 'shell', 'cat ',@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu?/cpufreq/affected_cpus'])@@@",
- "@@@STEP_LOG_LINE@python.inline@ print subprocess.check_output([ADB, 'shell', 'cat ',@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu?/cpufreq/scaling_available_frequencies'])@@@",
- "@@@STEP_LOG_LINE@python.inline@ except Exception as e:@@@",
- "@@@STEP_LOG_LINE@python.inline@ print e.output.strip()@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Most devices give a list of their available frequencies.@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = subprocess.check_output([ADB, 'shell', 'cat '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies'])@@@",
- "@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Check for message like '/system/bin/sh: file not found'@@@",
- "@@@STEP_LOG_LINE@python.inline@ if available_freqs and '/system/bin/sh' not in available_freqs:@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = sorted(@@@",
- "@@@STEP_LOG_LINE@python.inline@ int(i) for i in available_freqs.strip().split())@@@",
- "@@@STEP_LOG_LINE@python.inline@ else:@@@",
- "@@@STEP_LOG_LINE@python.inline@ raise Exception('Could not get list of available frequencies: %s' %@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs)@@@",
+ "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo \"%s\" > '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])@@@",
+ "@@@STEP_LOG_LINE@python.inline@actual_gov = subprocess.check_output([ADB, 'shell', 'cat '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()@@@",
+ "@@@STEP_LOG_LINE@python.inline@if actual_gov != str(gov):@@@",
+ "@@@STEP_LOG_LINE@python.inline@ raise Exception('(actual, expected) (%s, %d)'@@@",
+ "@@@STEP_LOG_LINE@python.inline@ % (actual_gov, gov))@@@",
+ "@@@STEP_LOG_END@python.inline@@@"
+ ]
+ },
+ {
+ "cmd": [
+ "python",
+ "-u",
+ "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ncpu = int(sys.argv[2])\ngov = sys.argv[3]\n\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nsubprocess.check_output([ADB, 'shell', 'echo \"%s\" > '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])\nactual_gov = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()\nif actual_gov != str(gov):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_gov, gov))\n",
+ "/usr/bin/adb.1.0.35",
+ "0",
+ "ondemand"
+ ],
+ "env": {
+ "BUILDTYPE": "Debug",
+ "CHROME_HEADLESS": "1",
+ "PATH": "<PATH>:RECIPE_PACKAGE_REPO[depot_tools]",
+ "SKIA_OUT": "[START_DIR]/out"
+ },
+ "infra_step": true,
+ "name": "Set CPU 0's governor to ondemand",
+ "timeout": 30,
+ "~followup_annotations": [
"@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@maxfreq = available_freqs[-1]@@@",
- "@@@STEP_LOG_LINE@python.inline@target = int(round(maxfreq * target_percent))@@@",
- "@@@STEP_LOG_LINE@python.inline@freq = maxfreq@@@",
- "@@@STEP_LOG_LINE@python.inline@for f in reversed(available_freqs):@@@",
- "@@@STEP_LOG_LINE@python.inline@ if f <= target:@@@",
- "@@@STEP_LOG_LINE@python.inline@ freq = f@@@",
- "@@@STEP_LOG_LINE@python.inline@ break@@@",
+ "@@@STEP_LOG_LINE@python.inline@import os@@@",
+ "@@@STEP_LOG_LINE@python.inline@import subprocess@@@",
+ "@@@STEP_LOG_LINE@python.inline@import sys@@@",
+ "@@@STEP_LOG_LINE@python.inline@import time@@@",
+ "@@@STEP_LOG_LINE@python.inline@ADB = sys.argv[1]@@@",
+ "@@@STEP_LOG_LINE@python.inline@cpu = int(sys.argv[2])@@@",
+ "@@@STEP_LOG_LINE@python.inline@gov = sys.argv[3]@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@print 'Setting frequency to %d' % freq@@@",
+ "@@@STEP_LOG_LINE@python.inline@log = subprocess.check_output([ADB, 'root'])@@@",
+ "@@@STEP_LOG_LINE@python.inline@# check for message like 'adbd cannot run as root in production builds'@@@",
+ "@@@STEP_LOG_LINE@python.inline@print log@@@",
+ "@@@STEP_LOG_LINE@python.inline@if 'cannot' in log:@@@",
+ "@@@STEP_LOG_LINE@python.inline@ raise Exception('adb root failed')@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo \"userspace\" > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor'])@@@",
- "@@@STEP_LOG_LINE@python.inline@# If scaling_max_freq is lower than our attempted setting, it won't take.@@@",
- "@@@STEP_LOG_LINE@python.inline@# We must set min first, because if we try to set max to be less than min@@@",
- "@@@STEP_LOG_LINE@python.inline@# (which sometimes happens after certain devices reboot) it returns a@@@",
- "@@@STEP_LOG_LINE@python.inline@# perplexing permissions error.@@@",
- "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo 0 > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq'])@@@",
- "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo %d > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])@@@",
- "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo %d > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed' % freq])@@@",
- "@@@STEP_LOG_LINE@python.inline@time.sleep(5)@@@",
- "@@@STEP_LOG_LINE@python.inline@actual_freq = subprocess.check_output([ADB, 'shell', 'cat '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq']).strip()@@@",
- "@@@STEP_LOG_LINE@python.inline@if actual_freq != str(freq):@@@",
+ "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo \"%s\" > '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])@@@",
+ "@@@STEP_LOG_LINE@python.inline@actual_gov = subprocess.check_output([ADB, 'shell', 'cat '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()@@@",
+ "@@@STEP_LOG_LINE@python.inline@if actual_gov != str(gov):@@@",
"@@@STEP_LOG_LINE@python.inline@ raise Exception('(actual, expected) (%s, %d)'@@@",
- "@@@STEP_LOG_LINE@python.inline@ % (actual_freq, freq))@@@",
+ "@@@STEP_LOG_LINE@python.inline@ % (actual_gov, gov))@@@",
"@@@STEP_LOG_END@python.inline@@@"
]
},
diff --git a/infra/bots/recipe_modules/flavor/examples/full.expected/cpu_scale_failed.json b/infra/bots/recipe_modules/flavor/examples/full.expected/cpu_scale_failed.json
index 9a582b8268..28b602e1a1 100644
--- a/infra/bots/recipe_modules/flavor/examples/full.expected/cpu_scale_failed.json
+++ b/infra/bots/recipe_modules/flavor/examples/full.expected/cpu_scale_failed.json
@@ -642,10 +642,54 @@
"cmd": [
"python",
"-u",
- "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\nmodel = sys.argv[2]\ntarget_percent = float(sys.argv[3])\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nif model == 'Nexus7':\n # Nexus7 claims to support 1300000, but only really allows 1200000\n available_freqs = [51000, 102000, 204000, 340000, 475000, 640000, 760000,\n 860000, 1000000, 1100000, 1200000]\nelse:\n # Temporary logging to get a sense of what devices have multiple cpus\n try:\n print subprocess.check_output([ADB, 'shell', 'cat ',\n '/sys/devices/system/cpu/cpu?/cpufreq/affected_cpus'])\n print subprocess.check_output([ADB, 'shell', 'cat ',\n '/sys/devices/system/cpu/cpu?/cpufreq/scaling_available_frequencies'])\n except Exception as e:\n print e.output.strip()\n # Most devices give a list of their available frequencies.\n available_freqs = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies'])\n\n # Check for message like '/system/bin/sh: file not found'\n if available_freqs and '/system/bin/sh' not in available_freqs:\n available_freqs = sorted(\n int(i) for i in available_freqs.strip().split())\n else:\n raise Exception('Could not get list of available frequencies: %s' %\n available_freqs)\n\nmaxfreq = available_freqs[-1]\ntarget = int(round(maxfreq * target_percent))\nfreq = maxfreq\nfor f in reversed(available_freqs):\n if f <= target:\n freq = f\n break\n\nprint 'Setting frequency to %d' % freq\n\nsubprocess.check_output([ADB, 'shell', 'echo \"userspace\" > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor'])\n# If scaling_max_freq is lower than our attempted setting, it won't take.\n# We must set min first, because if we try to set max to be less than min\n# (which sometimes happens after certain devices reboot) it returns a\n# perplexing permissions error.\nsubprocess.check_output([ADB, 'shell', 'echo 0 > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq'])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed' % freq])\ntime.sleep(5)\nactual_freq = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq']).strip()\nif actual_freq != str(freq):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_freq, freq))\n",
+ "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ncpu = int(sys.argv[2])\ngov = sys.argv[3]\n\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nsubprocess.check_output([ADB, 'shell', 'echo \"%s\" > '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])\nactual_gov = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()\nif actual_gov != str(gov):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_gov, gov))\n",
"/usr/bin/adb.1.0.35",
- "NexusPlayer",
- "0.6"
+ "0",
+ "powersave"
+ ],
+ "env": {
+ "BUILDTYPE": "Debug",
+ "CHROME_HEADLESS": "1",
+ "PATH": "<PATH>:RECIPE_PACKAGE_REPO[depot_tools]",
+ "SKIA_OUT": "[START_DIR]/out"
+ },
+ "infra_step": true,
+ "name": "Set CPU 0's governor to powersave",
+ "timeout": 30,
+ "~followup_annotations": [
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@import os@@@",
+ "@@@STEP_LOG_LINE@python.inline@import subprocess@@@",
+ "@@@STEP_LOG_LINE@python.inline@import sys@@@",
+ "@@@STEP_LOG_LINE@python.inline@import time@@@",
+ "@@@STEP_LOG_LINE@python.inline@ADB = sys.argv[1]@@@",
+ "@@@STEP_LOG_LINE@python.inline@cpu = int(sys.argv[2])@@@",
+ "@@@STEP_LOG_LINE@python.inline@gov = sys.argv[3]@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@log = subprocess.check_output([ADB, 'root'])@@@",
+ "@@@STEP_LOG_LINE@python.inline@# check for message like 'adbd cannot run as root in production builds'@@@",
+ "@@@STEP_LOG_LINE@python.inline@print log@@@",
+ "@@@STEP_LOG_LINE@python.inline@if 'cannot' in log:@@@",
+ "@@@STEP_LOG_LINE@python.inline@ raise Exception('adb root failed')@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo \"%s\" > '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])@@@",
+ "@@@STEP_LOG_LINE@python.inline@actual_gov = subprocess.check_output([ADB, 'shell', 'cat '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()@@@",
+ "@@@STEP_LOG_LINE@python.inline@if actual_gov != str(gov):@@@",
+ "@@@STEP_LOG_LINE@python.inline@ raise Exception('(actual, expected) (%s, %d)'@@@",
+ "@@@STEP_LOG_LINE@python.inline@ % (actual_gov, gov))@@@",
+ "@@@STEP_LOG_END@python.inline@@@"
+ ]
+ },
+ {
+ "cmd": [
+ "python",
+ "-u",
+ "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ncpu = int(sys.argv[2])\ngov = sys.argv[3]\n\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nsubprocess.check_output([ADB, 'shell', 'echo \"%s\" > '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])\nactual_gov = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()\nif actual_gov != str(gov):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_gov, gov))\n",
+ "/usr/bin/adb.1.0.35",
+ "2",
+ "userspace"
],
"env": {
"BUILDTYPE": "Debug",
@@ -654,7 +698,51 @@
"SKIA_OUT": "[START_DIR]/out"
},
"infra_step": true,
- "name": "Scale CPU to 0.600000",
+ "name": "Set CPU 2's governor to userspace",
+ "timeout": 30,
+ "~followup_annotations": [
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@import os@@@",
+ "@@@STEP_LOG_LINE@python.inline@import subprocess@@@",
+ "@@@STEP_LOG_LINE@python.inline@import sys@@@",
+ "@@@STEP_LOG_LINE@python.inline@import time@@@",
+ "@@@STEP_LOG_LINE@python.inline@ADB = sys.argv[1]@@@",
+ "@@@STEP_LOG_LINE@python.inline@cpu = int(sys.argv[2])@@@",
+ "@@@STEP_LOG_LINE@python.inline@gov = sys.argv[3]@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@log = subprocess.check_output([ADB, 'root'])@@@",
+ "@@@STEP_LOG_LINE@python.inline@# check for message like 'adbd cannot run as root in production builds'@@@",
+ "@@@STEP_LOG_LINE@python.inline@print log@@@",
+ "@@@STEP_LOG_LINE@python.inline@if 'cannot' in log:@@@",
+ "@@@STEP_LOG_LINE@python.inline@ raise Exception('adb root failed')@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo \"%s\" > '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])@@@",
+ "@@@STEP_LOG_LINE@python.inline@actual_gov = subprocess.check_output([ADB, 'shell', 'cat '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()@@@",
+ "@@@STEP_LOG_LINE@python.inline@if actual_gov != str(gov):@@@",
+ "@@@STEP_LOG_LINE@python.inline@ raise Exception('(actual, expected) (%s, %d)'@@@",
+ "@@@STEP_LOG_LINE@python.inline@ % (actual_gov, gov))@@@",
+ "@@@STEP_LOG_END@python.inline@@@"
+ ]
+ },
+ {
+ "cmd": [
+ "python",
+ "-u",
+ "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ntarget_percent = float(sys.argv[2])\ncpu = int(sys.argv[3])\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nroot = '/sys/devices/system/cpu/cpu%d/cpufreq' %cpu\n\n# All devices we test on give a list of their available frequencies.\navailable_freqs = subprocess.check_output([ADB, 'shell',\n 'cat %s/scaling_available_frequencies' % root])\n\n# Check for message like '/system/bin/sh: file not found'\nif available_freqs and '/system/bin/sh' not in available_freqs:\n available_freqs = sorted(\n int(i) for i in available_freqs.strip().split())\nelse:\n raise Exception('Could not get list of available frequencies: %s' %\n available_freqs)\n\nmaxfreq = available_freqs[-1]\ntarget = int(round(maxfreq * target_percent))\nfreq = maxfreq\nfor f in reversed(available_freqs):\n if f <= target:\n freq = f\n break\n\nprint 'Setting frequency to %d' % freq\n\n# If scaling_max_freq is lower than our attempted setting, it won't take.\n# We must set min first, because if we try to set max to be less than min\n# (which sometimes happens after certain devices reboot) it returns a\n# perplexing permissions error.\nsubprocess.check_output([ADB, 'shell', 'echo 0 > '\n '%s/scaling_min_freq' % root])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '%s/scaling_max_freq' % (freq, root)])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '%s/scaling_setspeed' % (freq, root)])\ntime.sleep(5)\nactual_freq = subprocess.check_output([ADB, 'shell', 'cat '\n '%s/scaling_cur_freq' % root]).strip()\nif actual_freq != str(freq):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_freq, freq))\n",
+ "/usr/bin/adb.1.0.35",
+ "0.6",
+ "2"
+ ],
+ "env": {
+ "BUILDTYPE": "Debug",
+ "CHROME_HEADLESS": "1",
+ "PATH": "<PATH>:RECIPE_PACKAGE_REPO[depot_tools]",
+ "SKIA_OUT": "[START_DIR]/out"
+ },
+ "infra_step": true,
+ "name": "Scale CPU 2 to 0.600000",
"timeout": 30,
"~followup_annotations": [
"step returned non-zero exit code: 1",
@@ -664,38 +752,27 @@
"@@@STEP_LOG_LINE@python.inline@import sys@@@",
"@@@STEP_LOG_LINE@python.inline@import time@@@",
"@@@STEP_LOG_LINE@python.inline@ADB = sys.argv[1]@@@",
- "@@@STEP_LOG_LINE@python.inline@model = sys.argv[2]@@@",
- "@@@STEP_LOG_LINE@python.inline@target_percent = float(sys.argv[3])@@@",
+ "@@@STEP_LOG_LINE@python.inline@target_percent = float(sys.argv[2])@@@",
+ "@@@STEP_LOG_LINE@python.inline@cpu = int(sys.argv[3])@@@",
"@@@STEP_LOG_LINE@python.inline@log = subprocess.check_output([ADB, 'root'])@@@",
"@@@STEP_LOG_LINE@python.inline@# check for message like 'adbd cannot run as root in production builds'@@@",
"@@@STEP_LOG_LINE@python.inline@print log@@@",
"@@@STEP_LOG_LINE@python.inline@if 'cannot' in log:@@@",
"@@@STEP_LOG_LINE@python.inline@ raise Exception('adb root failed')@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@if model == 'Nexus7':@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Nexus7 claims to support 1300000, but only really allows 1200000@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = [51000, 102000, 204000, 340000, 475000, 640000, 760000,@@@",
- "@@@STEP_LOG_LINE@python.inline@ 860000, 1000000, 1100000, 1200000]@@@",
- "@@@STEP_LOG_LINE@python.inline@else:@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Temporary logging to get a sense of what devices have multiple cpus@@@",
- "@@@STEP_LOG_LINE@python.inline@ try:@@@",
- "@@@STEP_LOG_LINE@python.inline@ print subprocess.check_output([ADB, 'shell', 'cat ',@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu?/cpufreq/affected_cpus'])@@@",
- "@@@STEP_LOG_LINE@python.inline@ print subprocess.check_output([ADB, 'shell', 'cat ',@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu?/cpufreq/scaling_available_frequencies'])@@@",
- "@@@STEP_LOG_LINE@python.inline@ except Exception as e:@@@",
- "@@@STEP_LOG_LINE@python.inline@ print e.output.strip()@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Most devices give a list of their available frequencies.@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = subprocess.check_output([ADB, 'shell', 'cat '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies'])@@@",
+ "@@@STEP_LOG_LINE@python.inline@root = '/sys/devices/system/cpu/cpu%d/cpufreq' %cpu@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@# All devices we test on give a list of their available frequencies.@@@",
+ "@@@STEP_LOG_LINE@python.inline@available_freqs = subprocess.check_output([ADB, 'shell',@@@",
+ "@@@STEP_LOG_LINE@python.inline@ 'cat %s/scaling_available_frequencies' % root])@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Check for message like '/system/bin/sh: file not found'@@@",
- "@@@STEP_LOG_LINE@python.inline@ if available_freqs and '/system/bin/sh' not in available_freqs:@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = sorted(@@@",
- "@@@STEP_LOG_LINE@python.inline@ int(i) for i in available_freqs.strip().split())@@@",
- "@@@STEP_LOG_LINE@python.inline@ else:@@@",
- "@@@STEP_LOG_LINE@python.inline@ raise Exception('Could not get list of available frequencies: %s' %@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs)@@@",
+ "@@@STEP_LOG_LINE@python.inline@# Check for message like '/system/bin/sh: file not found'@@@",
+ "@@@STEP_LOG_LINE@python.inline@if available_freqs and '/system/bin/sh' not in available_freqs:@@@",
+ "@@@STEP_LOG_LINE@python.inline@ available_freqs = sorted(@@@",
+ "@@@STEP_LOG_LINE@python.inline@ int(i) for i in available_freqs.strip().split())@@@",
+ "@@@STEP_LOG_LINE@python.inline@else:@@@",
+ "@@@STEP_LOG_LINE@python.inline@ raise Exception('Could not get list of available frequencies: %s' %@@@",
+ "@@@STEP_LOG_LINE@python.inline@ available_freqs)@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@maxfreq = available_freqs[-1]@@@",
"@@@STEP_LOG_LINE@python.inline@target = int(round(maxfreq * target_percent))@@@",
@@ -707,21 +784,19 @@
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@print 'Setting frequency to %d' % freq@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo \"userspace\" > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor'])@@@",
"@@@STEP_LOG_LINE@python.inline@# If scaling_max_freq is lower than our attempted setting, it won't take.@@@",
"@@@STEP_LOG_LINE@python.inline@# We must set min first, because if we try to set max to be less than min@@@",
"@@@STEP_LOG_LINE@python.inline@# (which sometimes happens after certain devices reboot) it returns a@@@",
"@@@STEP_LOG_LINE@python.inline@# perplexing permissions error.@@@",
"@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo 0 > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq'])@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '%s/scaling_min_freq' % root])@@@",
"@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo %d > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '%s/scaling_max_freq' % (freq, root)])@@@",
"@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo %d > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed' % freq])@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '%s/scaling_setspeed' % (freq, root)])@@@",
"@@@STEP_LOG_LINE@python.inline@time.sleep(5)@@@",
"@@@STEP_LOG_LINE@python.inline@actual_freq = subprocess.check_output([ADB, 'shell', 'cat '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq']).strip()@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '%s/scaling_cur_freq' % root]).strip()@@@",
"@@@STEP_LOG_LINE@python.inline@if actual_freq != str(freq):@@@",
"@@@STEP_LOG_LINE@python.inline@ raise Exception('(actual, expected) (%s, %d)'@@@",
"@@@STEP_LOG_LINE@python.inline@ % (actual_freq, freq))@@@",
@@ -733,10 +808,10 @@
"cmd": [
"python",
"-u",
- "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\nmodel = sys.argv[2]\ntarget_percent = float(sys.argv[3])\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nif model == 'Nexus7':\n # Nexus7 claims to support 1300000, but only really allows 1200000\n available_freqs = [51000, 102000, 204000, 340000, 475000, 640000, 760000,\n 860000, 1000000, 1100000, 1200000]\nelse:\n # Temporary logging to get a sense of what devices have multiple cpus\n try:\n print subprocess.check_output([ADB, 'shell', 'cat ',\n '/sys/devices/system/cpu/cpu?/cpufreq/affected_cpus'])\n print subprocess.check_output([ADB, 'shell', 'cat ',\n '/sys/devices/system/cpu/cpu?/cpufreq/scaling_available_frequencies'])\n except Exception as e:\n print e.output.strip()\n # Most devices give a list of their available frequencies.\n available_freqs = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies'])\n\n # Check for message like '/system/bin/sh: file not found'\n if available_freqs and '/system/bin/sh' not in available_freqs:\n available_freqs = sorted(\n int(i) for i in available_freqs.strip().split())\n else:\n raise Exception('Could not get list of available frequencies: %s' %\n available_freqs)\n\nmaxfreq = available_freqs[-1]\ntarget = int(round(maxfreq * target_percent))\nfreq = maxfreq\nfor f in reversed(available_freqs):\n if f <= target:\n freq = f\n break\n\nprint 'Setting frequency to %d' % freq\n\nsubprocess.check_output([ADB, 'shell', 'echo \"userspace\" > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor'])\n# If scaling_max_freq is lower than our attempted setting, it won't take.\n# We must set min first, because if we try to set max to be less than min\n# (which sometimes happens after certain devices reboot) it returns a\n# perplexing permissions error.\nsubprocess.check_output([ADB, 'shell', 'echo 0 > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq'])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed' % freq])\ntime.sleep(5)\nactual_freq = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq']).strip()\nif actual_freq != str(freq):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_freq, freq))\n",
+ "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ntarget_percent = float(sys.argv[2])\ncpu = int(sys.argv[3])\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nroot = '/sys/devices/system/cpu/cpu%d/cpufreq' %cpu\n\n# All devices we test on give a list of their available frequencies.\navailable_freqs = subprocess.check_output([ADB, 'shell',\n 'cat %s/scaling_available_frequencies' % root])\n\n# Check for message like '/system/bin/sh: file not found'\nif available_freqs and '/system/bin/sh' not in available_freqs:\n available_freqs = sorted(\n int(i) for i in available_freqs.strip().split())\nelse:\n raise Exception('Could not get list of available frequencies: %s' %\n available_freqs)\n\nmaxfreq = available_freqs[-1]\ntarget = int(round(maxfreq * target_percent))\nfreq = maxfreq\nfor f in reversed(available_freqs):\n if f <= target:\n freq = f\n break\n\nprint 'Setting frequency to %d' % freq\n\n# If scaling_max_freq is lower than our attempted setting, it won't take.\n# We must set min first, because if we try to set max to be less than min\n# (which sometimes happens after certain devices reboot) it returns a\n# perplexing permissions error.\nsubprocess.check_output([ADB, 'shell', 'echo 0 > '\n '%s/scaling_min_freq' % root])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '%s/scaling_max_freq' % (freq, root)])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '%s/scaling_setspeed' % (freq, root)])\ntime.sleep(5)\nactual_freq = subprocess.check_output([ADB, 'shell', 'cat '\n '%s/scaling_cur_freq' % root]).strip()\nif actual_freq != str(freq):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_freq, freq))\n",
"/usr/bin/adb.1.0.35",
- "NexusPlayer",
- "0.6"
+ "0.6",
+ "2"
],
"env": {
"BUILDTYPE": "Debug",
@@ -745,7 +820,7 @@
"SKIA_OUT": "[START_DIR]/out"
},
"infra_step": true,
- "name": "Scale CPU to 0.600000 (attempt 2)",
+ "name": "Scale CPU 2 to 0.600000 (attempt 2)",
"timeout": 30,
"~followup_annotations": [
"@@@STEP_LOG_LINE@python.inline@@@@",
@@ -754,38 +829,27 @@
"@@@STEP_LOG_LINE@python.inline@import sys@@@",
"@@@STEP_LOG_LINE@python.inline@import time@@@",
"@@@STEP_LOG_LINE@python.inline@ADB = sys.argv[1]@@@",
- "@@@STEP_LOG_LINE@python.inline@model = sys.argv[2]@@@",
- "@@@STEP_LOG_LINE@python.inline@target_percent = float(sys.argv[3])@@@",
+ "@@@STEP_LOG_LINE@python.inline@target_percent = float(sys.argv[2])@@@",
+ "@@@STEP_LOG_LINE@python.inline@cpu = int(sys.argv[3])@@@",
"@@@STEP_LOG_LINE@python.inline@log = subprocess.check_output([ADB, 'root'])@@@",
"@@@STEP_LOG_LINE@python.inline@# check for message like 'adbd cannot run as root in production builds'@@@",
"@@@STEP_LOG_LINE@python.inline@print log@@@",
"@@@STEP_LOG_LINE@python.inline@if 'cannot' in log:@@@",
"@@@STEP_LOG_LINE@python.inline@ raise Exception('adb root failed')@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@if model == 'Nexus7':@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Nexus7 claims to support 1300000, but only really allows 1200000@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = [51000, 102000, 204000, 340000, 475000, 640000, 760000,@@@",
- "@@@STEP_LOG_LINE@python.inline@ 860000, 1000000, 1100000, 1200000]@@@",
- "@@@STEP_LOG_LINE@python.inline@else:@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Temporary logging to get a sense of what devices have multiple cpus@@@",
- "@@@STEP_LOG_LINE@python.inline@ try:@@@",
- "@@@STEP_LOG_LINE@python.inline@ print subprocess.check_output([ADB, 'shell', 'cat ',@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu?/cpufreq/affected_cpus'])@@@",
- "@@@STEP_LOG_LINE@python.inline@ print subprocess.check_output([ADB, 'shell', 'cat ',@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu?/cpufreq/scaling_available_frequencies'])@@@",
- "@@@STEP_LOG_LINE@python.inline@ except Exception as e:@@@",
- "@@@STEP_LOG_LINE@python.inline@ print e.output.strip()@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Most devices give a list of their available frequencies.@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = subprocess.check_output([ADB, 'shell', 'cat '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies'])@@@",
+ "@@@STEP_LOG_LINE@python.inline@root = '/sys/devices/system/cpu/cpu%d/cpufreq' %cpu@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Check for message like '/system/bin/sh: file not found'@@@",
- "@@@STEP_LOG_LINE@python.inline@ if available_freqs and '/system/bin/sh' not in available_freqs:@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = sorted(@@@",
- "@@@STEP_LOG_LINE@python.inline@ int(i) for i in available_freqs.strip().split())@@@",
- "@@@STEP_LOG_LINE@python.inline@ else:@@@",
- "@@@STEP_LOG_LINE@python.inline@ raise Exception('Could not get list of available frequencies: %s' %@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs)@@@",
+ "@@@STEP_LOG_LINE@python.inline@# All devices we test on give a list of their available frequencies.@@@",
+ "@@@STEP_LOG_LINE@python.inline@available_freqs = subprocess.check_output([ADB, 'shell',@@@",
+ "@@@STEP_LOG_LINE@python.inline@ 'cat %s/scaling_available_frequencies' % root])@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@# Check for message like '/system/bin/sh: file not found'@@@",
+ "@@@STEP_LOG_LINE@python.inline@if available_freqs and '/system/bin/sh' not in available_freqs:@@@",
+ "@@@STEP_LOG_LINE@python.inline@ available_freqs = sorted(@@@",
+ "@@@STEP_LOG_LINE@python.inline@ int(i) for i in available_freqs.strip().split())@@@",
+ "@@@STEP_LOG_LINE@python.inline@else:@@@",
+ "@@@STEP_LOG_LINE@python.inline@ raise Exception('Could not get list of available frequencies: %s' %@@@",
+ "@@@STEP_LOG_LINE@python.inline@ available_freqs)@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@maxfreq = available_freqs[-1]@@@",
"@@@STEP_LOG_LINE@python.inline@target = int(round(maxfreq * target_percent))@@@",
@@ -797,21 +861,19 @@
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@print 'Setting frequency to %d' % freq@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo \"userspace\" > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor'])@@@",
"@@@STEP_LOG_LINE@python.inline@# If scaling_max_freq is lower than our attempted setting, it won't take.@@@",
"@@@STEP_LOG_LINE@python.inline@# We must set min first, because if we try to set max to be less than min@@@",
"@@@STEP_LOG_LINE@python.inline@# (which sometimes happens after certain devices reboot) it returns a@@@",
"@@@STEP_LOG_LINE@python.inline@# perplexing permissions error.@@@",
"@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo 0 > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq'])@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '%s/scaling_min_freq' % root])@@@",
"@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo %d > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '%s/scaling_max_freq' % (freq, root)])@@@",
"@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo %d > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed' % freq])@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '%s/scaling_setspeed' % (freq, root)])@@@",
"@@@STEP_LOG_LINE@python.inline@time.sleep(5)@@@",
"@@@STEP_LOG_LINE@python.inline@actual_freq = subprocess.check_output([ADB, 'shell', 'cat '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq']).strip()@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '%s/scaling_cur_freq' % root]).strip()@@@",
"@@@STEP_LOG_LINE@python.inline@if actual_freq != str(freq):@@@",
"@@@STEP_LOG_LINE@python.inline@ raise Exception('(actual, expected) (%s, %d)'@@@",
"@@@STEP_LOG_LINE@python.inline@ % (actual_freq, freq))@@@",
diff --git a/infra/bots/recipe_modules/flavor/examples/full.expected/failed_infra_step.json b/infra/bots/recipe_modules/flavor/examples/full.expected/failed_infra_step.json
index 68ef7e08a7..4a13b47df7 100644
--- a/infra/bots/recipe_modules/flavor/examples/full.expected/failed_infra_step.json
+++ b/infra/bots/recipe_modules/flavor/examples/full.expected/failed_infra_step.json
@@ -642,10 +642,10 @@
"cmd": [
"python",
"-u",
- "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\nmodel = sys.argv[2]\ntarget_percent = float(sys.argv[3])\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nif model == 'Nexus7':\n # Nexus7 claims to support 1300000, but only really allows 1200000\n available_freqs = [51000, 102000, 204000, 340000, 475000, 640000, 760000,\n 860000, 1000000, 1100000, 1200000]\nelse:\n # Temporary logging to get a sense of what devices have multiple cpus\n try:\n print subprocess.check_output([ADB, 'shell', 'cat ',\n '/sys/devices/system/cpu/cpu?/cpufreq/affected_cpus'])\n print subprocess.check_output([ADB, 'shell', 'cat ',\n '/sys/devices/system/cpu/cpu?/cpufreq/scaling_available_frequencies'])\n except Exception as e:\n print e.output.strip()\n # Most devices give a list of their available frequencies.\n available_freqs = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies'])\n\n # Check for message like '/system/bin/sh: file not found'\n if available_freqs and '/system/bin/sh' not in available_freqs:\n available_freqs = sorted(\n int(i) for i in available_freqs.strip().split())\n else:\n raise Exception('Could not get list of available frequencies: %s' %\n available_freqs)\n\nmaxfreq = available_freqs[-1]\ntarget = int(round(maxfreq * target_percent))\nfreq = maxfreq\nfor f in reversed(available_freqs):\n if f <= target:\n freq = f\n break\n\nprint 'Setting frequency to %d' % freq\n\nsubprocess.check_output([ADB, 'shell', 'echo \"userspace\" > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor'])\n# If scaling_max_freq is lower than our attempted setting, it won't take.\n# We must set min first, because if we try to set max to be less than min\n# (which sometimes happens after certain devices reboot) it returns a\n# perplexing permissions error.\nsubprocess.check_output([ADB, 'shell', 'echo 0 > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq'])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed' % freq])\ntime.sleep(5)\nactual_freq = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq']).strip()\nif actual_freq != str(freq):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_freq, freq))\n",
+ "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ncpu = int(sys.argv[2])\ngov = sys.argv[3]\n\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nsubprocess.check_output([ADB, 'shell', 'echo \"%s\" > '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])\nactual_gov = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()\nif actual_gov != str(gov):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_gov, gov))\n",
"/usr/bin/adb.1.0.35",
- "NexusPlayer",
- "0.6"
+ "0",
+ "powersave"
],
"env": {
"BUILDTYPE": "Debug",
@@ -654,7 +654,7 @@
"SKIA_OUT": "[START_DIR]/out"
},
"infra_step": true,
- "name": "Scale CPU to 0.600000",
+ "name": "Set CPU 0's governor to powersave",
"timeout": 30,
"~followup_annotations": [
"@@@STEP_LOG_LINE@python.inline@@@@",
@@ -663,38 +663,115 @@
"@@@STEP_LOG_LINE@python.inline@import sys@@@",
"@@@STEP_LOG_LINE@python.inline@import time@@@",
"@@@STEP_LOG_LINE@python.inline@ADB = sys.argv[1]@@@",
- "@@@STEP_LOG_LINE@python.inline@model = sys.argv[2]@@@",
- "@@@STEP_LOG_LINE@python.inline@target_percent = float(sys.argv[3])@@@",
+ "@@@STEP_LOG_LINE@python.inline@cpu = int(sys.argv[2])@@@",
+ "@@@STEP_LOG_LINE@python.inline@gov = sys.argv[3]@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@log = subprocess.check_output([ADB, 'root'])@@@",
"@@@STEP_LOG_LINE@python.inline@# check for message like 'adbd cannot run as root in production builds'@@@",
"@@@STEP_LOG_LINE@python.inline@print log@@@",
"@@@STEP_LOG_LINE@python.inline@if 'cannot' in log:@@@",
"@@@STEP_LOG_LINE@python.inline@ raise Exception('adb root failed')@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@if model == 'Nexus7':@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Nexus7 claims to support 1300000, but only really allows 1200000@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = [51000, 102000, 204000, 340000, 475000, 640000, 760000,@@@",
- "@@@STEP_LOG_LINE@python.inline@ 860000, 1000000, 1100000, 1200000]@@@",
- "@@@STEP_LOG_LINE@python.inline@else:@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Temporary logging to get a sense of what devices have multiple cpus@@@",
- "@@@STEP_LOG_LINE@python.inline@ try:@@@",
- "@@@STEP_LOG_LINE@python.inline@ print subprocess.check_output([ADB, 'shell', 'cat ',@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu?/cpufreq/affected_cpus'])@@@",
- "@@@STEP_LOG_LINE@python.inline@ print subprocess.check_output([ADB, 'shell', 'cat ',@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu?/cpufreq/scaling_available_frequencies'])@@@",
- "@@@STEP_LOG_LINE@python.inline@ except Exception as e:@@@",
- "@@@STEP_LOG_LINE@python.inline@ print e.output.strip()@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Most devices give a list of their available frequencies.@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = subprocess.check_output([ADB, 'shell', 'cat '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies'])@@@",
+ "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo \"%s\" > '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])@@@",
+ "@@@STEP_LOG_LINE@python.inline@actual_gov = subprocess.check_output([ADB, 'shell', 'cat '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()@@@",
+ "@@@STEP_LOG_LINE@python.inline@if actual_gov != str(gov):@@@",
+ "@@@STEP_LOG_LINE@python.inline@ raise Exception('(actual, expected) (%s, %d)'@@@",
+ "@@@STEP_LOG_LINE@python.inline@ % (actual_gov, gov))@@@",
+ "@@@STEP_LOG_END@python.inline@@@"
+ ]
+ },
+ {
+ "cmd": [
+ "python",
+ "-u",
+ "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ncpu = int(sys.argv[2])\ngov = sys.argv[3]\n\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nsubprocess.check_output([ADB, 'shell', 'echo \"%s\" > '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])\nactual_gov = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()\nif actual_gov != str(gov):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_gov, gov))\n",
+ "/usr/bin/adb.1.0.35",
+ "2",
+ "userspace"
+ ],
+ "env": {
+ "BUILDTYPE": "Debug",
+ "CHROME_HEADLESS": "1",
+ "PATH": "<PATH>:RECIPE_PACKAGE_REPO[depot_tools]",
+ "SKIA_OUT": "[START_DIR]/out"
+ },
+ "infra_step": true,
+ "name": "Set CPU 2's governor to userspace",
+ "timeout": 30,
+ "~followup_annotations": [
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@import os@@@",
+ "@@@STEP_LOG_LINE@python.inline@import subprocess@@@",
+ "@@@STEP_LOG_LINE@python.inline@import sys@@@",
+ "@@@STEP_LOG_LINE@python.inline@import time@@@",
+ "@@@STEP_LOG_LINE@python.inline@ADB = sys.argv[1]@@@",
+ "@@@STEP_LOG_LINE@python.inline@cpu = int(sys.argv[2])@@@",
+ "@@@STEP_LOG_LINE@python.inline@gov = sys.argv[3]@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@log = subprocess.check_output([ADB, 'root'])@@@",
+ "@@@STEP_LOG_LINE@python.inline@# check for message like 'adbd cannot run as root in production builds'@@@",
+ "@@@STEP_LOG_LINE@python.inline@print log@@@",
+ "@@@STEP_LOG_LINE@python.inline@if 'cannot' in log:@@@",
+ "@@@STEP_LOG_LINE@python.inline@ raise Exception('adb root failed')@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Check for message like '/system/bin/sh: file not found'@@@",
- "@@@STEP_LOG_LINE@python.inline@ if available_freqs and '/system/bin/sh' not in available_freqs:@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = sorted(@@@",
- "@@@STEP_LOG_LINE@python.inline@ int(i) for i in available_freqs.strip().split())@@@",
- "@@@STEP_LOG_LINE@python.inline@ else:@@@",
- "@@@STEP_LOG_LINE@python.inline@ raise Exception('Could not get list of available frequencies: %s' %@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs)@@@",
+ "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo \"%s\" > '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])@@@",
+ "@@@STEP_LOG_LINE@python.inline@actual_gov = subprocess.check_output([ADB, 'shell', 'cat '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()@@@",
+ "@@@STEP_LOG_LINE@python.inline@if actual_gov != str(gov):@@@",
+ "@@@STEP_LOG_LINE@python.inline@ raise Exception('(actual, expected) (%s, %d)'@@@",
+ "@@@STEP_LOG_LINE@python.inline@ % (actual_gov, gov))@@@",
+ "@@@STEP_LOG_END@python.inline@@@"
+ ]
+ },
+ {
+ "cmd": [
+ "python",
+ "-u",
+ "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ntarget_percent = float(sys.argv[2])\ncpu = int(sys.argv[3])\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nroot = '/sys/devices/system/cpu/cpu%d/cpufreq' %cpu\n\n# All devices we test on give a list of their available frequencies.\navailable_freqs = subprocess.check_output([ADB, 'shell',\n 'cat %s/scaling_available_frequencies' % root])\n\n# Check for message like '/system/bin/sh: file not found'\nif available_freqs and '/system/bin/sh' not in available_freqs:\n available_freqs = sorted(\n int(i) for i in available_freqs.strip().split())\nelse:\n raise Exception('Could not get list of available frequencies: %s' %\n available_freqs)\n\nmaxfreq = available_freqs[-1]\ntarget = int(round(maxfreq * target_percent))\nfreq = maxfreq\nfor f in reversed(available_freqs):\n if f <= target:\n freq = f\n break\n\nprint 'Setting frequency to %d' % freq\n\n# If scaling_max_freq is lower than our attempted setting, it won't take.\n# We must set min first, because if we try to set max to be less than min\n# (which sometimes happens after certain devices reboot) it returns a\n# perplexing permissions error.\nsubprocess.check_output([ADB, 'shell', 'echo 0 > '\n '%s/scaling_min_freq' % root])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '%s/scaling_max_freq' % (freq, root)])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '%s/scaling_setspeed' % (freq, root)])\ntime.sleep(5)\nactual_freq = subprocess.check_output([ADB, 'shell', 'cat '\n '%s/scaling_cur_freq' % root]).strip()\nif actual_freq != str(freq):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_freq, freq))\n",
+ "/usr/bin/adb.1.0.35",
+ "0.6",
+ "2"
+ ],
+ "env": {
+ "BUILDTYPE": "Debug",
+ "CHROME_HEADLESS": "1",
+ "PATH": "<PATH>:RECIPE_PACKAGE_REPO[depot_tools]",
+ "SKIA_OUT": "[START_DIR]/out"
+ },
+ "infra_step": true,
+ "name": "Scale CPU 2 to 0.600000",
+ "timeout": 30,
+ "~followup_annotations": [
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@import os@@@",
+ "@@@STEP_LOG_LINE@python.inline@import subprocess@@@",
+ "@@@STEP_LOG_LINE@python.inline@import sys@@@",
+ "@@@STEP_LOG_LINE@python.inline@import time@@@",
+ "@@@STEP_LOG_LINE@python.inline@ADB = sys.argv[1]@@@",
+ "@@@STEP_LOG_LINE@python.inline@target_percent = float(sys.argv[2])@@@",
+ "@@@STEP_LOG_LINE@python.inline@cpu = int(sys.argv[3])@@@",
+ "@@@STEP_LOG_LINE@python.inline@log = subprocess.check_output([ADB, 'root'])@@@",
+ "@@@STEP_LOG_LINE@python.inline@# check for message like 'adbd cannot run as root in production builds'@@@",
+ "@@@STEP_LOG_LINE@python.inline@print log@@@",
+ "@@@STEP_LOG_LINE@python.inline@if 'cannot' in log:@@@",
+ "@@@STEP_LOG_LINE@python.inline@ raise Exception('adb root failed')@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@root = '/sys/devices/system/cpu/cpu%d/cpufreq' %cpu@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@# All devices we test on give a list of their available frequencies.@@@",
+ "@@@STEP_LOG_LINE@python.inline@available_freqs = subprocess.check_output([ADB, 'shell',@@@",
+ "@@@STEP_LOG_LINE@python.inline@ 'cat %s/scaling_available_frequencies' % root])@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@# Check for message like '/system/bin/sh: file not found'@@@",
+ "@@@STEP_LOG_LINE@python.inline@if available_freqs and '/system/bin/sh' not in available_freqs:@@@",
+ "@@@STEP_LOG_LINE@python.inline@ available_freqs = sorted(@@@",
+ "@@@STEP_LOG_LINE@python.inline@ int(i) for i in available_freqs.strip().split())@@@",
+ "@@@STEP_LOG_LINE@python.inline@else:@@@",
+ "@@@STEP_LOG_LINE@python.inline@ raise Exception('Could not get list of available frequencies: %s' %@@@",
+ "@@@STEP_LOG_LINE@python.inline@ available_freqs)@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@maxfreq = available_freqs[-1]@@@",
"@@@STEP_LOG_LINE@python.inline@target = int(round(maxfreq * target_percent))@@@",
@@ -706,21 +783,19 @@
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@print 'Setting frequency to %d' % freq@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo \"userspace\" > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor'])@@@",
"@@@STEP_LOG_LINE@python.inline@# If scaling_max_freq is lower than our attempted setting, it won't take.@@@",
"@@@STEP_LOG_LINE@python.inline@# We must set min first, because if we try to set max to be less than min@@@",
"@@@STEP_LOG_LINE@python.inline@# (which sometimes happens after certain devices reboot) it returns a@@@",
"@@@STEP_LOG_LINE@python.inline@# perplexing permissions error.@@@",
"@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo 0 > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq'])@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '%s/scaling_min_freq' % root])@@@",
"@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo %d > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '%s/scaling_max_freq' % (freq, root)])@@@",
"@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo %d > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed' % freq])@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '%s/scaling_setspeed' % (freq, root)])@@@",
"@@@STEP_LOG_LINE@python.inline@time.sleep(5)@@@",
"@@@STEP_LOG_LINE@python.inline@actual_freq = subprocess.check_output([ADB, 'shell', 'cat '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq']).strip()@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '%s/scaling_cur_freq' % root]).strip()@@@",
"@@@STEP_LOG_LINE@python.inline@if actual_freq != str(freq):@@@",
"@@@STEP_LOG_LINE@python.inline@ raise Exception('(actual, expected) (%s, %d)'@@@",
"@@@STEP_LOG_LINE@python.inline@ % (actual_freq, freq))@@@",
diff --git a/infra/bots/recipe_modules/flavor/examples/full.expected/failed_read_version.json b/infra/bots/recipe_modules/flavor/examples/full.expected/failed_read_version.json
index e917a9224c..a320f806d5 100644
--- a/infra/bots/recipe_modules/flavor/examples/full.expected/failed_read_version.json
+++ b/infra/bots/recipe_modules/flavor/examples/full.expected/failed_read_version.json
@@ -696,10 +696,10 @@
"cmd": [
"python",
"-u",
- "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\nmodel = sys.argv[2]\ntarget_percent = float(sys.argv[3])\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nif model == 'Nexus7':\n # Nexus7 claims to support 1300000, but only really allows 1200000\n available_freqs = [51000, 102000, 204000, 340000, 475000, 640000, 760000,\n 860000, 1000000, 1100000, 1200000]\nelse:\n # Temporary logging to get a sense of what devices have multiple cpus\n try:\n print subprocess.check_output([ADB, 'shell', 'cat ',\n '/sys/devices/system/cpu/cpu?/cpufreq/affected_cpus'])\n print subprocess.check_output([ADB, 'shell', 'cat ',\n '/sys/devices/system/cpu/cpu?/cpufreq/scaling_available_frequencies'])\n except Exception as e:\n print e.output.strip()\n # Most devices give a list of their available frequencies.\n available_freqs = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies'])\n\n # Check for message like '/system/bin/sh: file not found'\n if available_freqs and '/system/bin/sh' not in available_freqs:\n available_freqs = sorted(\n int(i) for i in available_freqs.strip().split())\n else:\n raise Exception('Could not get list of available frequencies: %s' %\n available_freqs)\n\nmaxfreq = available_freqs[-1]\ntarget = int(round(maxfreq * target_percent))\nfreq = maxfreq\nfor f in reversed(available_freqs):\n if f <= target:\n freq = f\n break\n\nprint 'Setting frequency to %d' % freq\n\nsubprocess.check_output([ADB, 'shell', 'echo \"userspace\" > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor'])\n# If scaling_max_freq is lower than our attempted setting, it won't take.\n# We must set min first, because if we try to set max to be less than min\n# (which sometimes happens after certain devices reboot) it returns a\n# perplexing permissions error.\nsubprocess.check_output([ADB, 'shell', 'echo 0 > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq'])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed' % freq])\ntime.sleep(5)\nactual_freq = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq']).strip()\nif actual_freq != str(freq):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_freq, freq))\n",
+ "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ncpu = int(sys.argv[2])\ngov = sys.argv[3]\n\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nsubprocess.check_output([ADB, 'shell', 'echo \"%s\" > '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])\nactual_gov = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()\nif actual_gov != str(gov):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_gov, gov))\n",
"/usr/bin/adb.1.0.35",
- "NexusPlayer",
- "0.6"
+ "0",
+ "powersave"
],
"env": {
"BUILDTYPE": "Debug",
@@ -708,7 +708,7 @@
"SKIA_OUT": "[START_DIR]/out"
},
"infra_step": true,
- "name": "Scale CPU to 0.600000",
+ "name": "Set CPU 0's governor to powersave",
"timeout": 30,
"~followup_annotations": [
"@@@STEP_LOG_LINE@python.inline@@@@",
@@ -717,38 +717,115 @@
"@@@STEP_LOG_LINE@python.inline@import sys@@@",
"@@@STEP_LOG_LINE@python.inline@import time@@@",
"@@@STEP_LOG_LINE@python.inline@ADB = sys.argv[1]@@@",
- "@@@STEP_LOG_LINE@python.inline@model = sys.argv[2]@@@",
- "@@@STEP_LOG_LINE@python.inline@target_percent = float(sys.argv[3])@@@",
+ "@@@STEP_LOG_LINE@python.inline@cpu = int(sys.argv[2])@@@",
+ "@@@STEP_LOG_LINE@python.inline@gov = sys.argv[3]@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@log = subprocess.check_output([ADB, 'root'])@@@",
"@@@STEP_LOG_LINE@python.inline@# check for message like 'adbd cannot run as root in production builds'@@@",
"@@@STEP_LOG_LINE@python.inline@print log@@@",
"@@@STEP_LOG_LINE@python.inline@if 'cannot' in log:@@@",
"@@@STEP_LOG_LINE@python.inline@ raise Exception('adb root failed')@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@if model == 'Nexus7':@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Nexus7 claims to support 1300000, but only really allows 1200000@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = [51000, 102000, 204000, 340000, 475000, 640000, 760000,@@@",
- "@@@STEP_LOG_LINE@python.inline@ 860000, 1000000, 1100000, 1200000]@@@",
- "@@@STEP_LOG_LINE@python.inline@else:@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Temporary logging to get a sense of what devices have multiple cpus@@@",
- "@@@STEP_LOG_LINE@python.inline@ try:@@@",
- "@@@STEP_LOG_LINE@python.inline@ print subprocess.check_output([ADB, 'shell', 'cat ',@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu?/cpufreq/affected_cpus'])@@@",
- "@@@STEP_LOG_LINE@python.inline@ print subprocess.check_output([ADB, 'shell', 'cat ',@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu?/cpufreq/scaling_available_frequencies'])@@@",
- "@@@STEP_LOG_LINE@python.inline@ except Exception as e:@@@",
- "@@@STEP_LOG_LINE@python.inline@ print e.output.strip()@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Most devices give a list of their available frequencies.@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = subprocess.check_output([ADB, 'shell', 'cat '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies'])@@@",
+ "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo \"%s\" > '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])@@@",
+ "@@@STEP_LOG_LINE@python.inline@actual_gov = subprocess.check_output([ADB, 'shell', 'cat '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()@@@",
+ "@@@STEP_LOG_LINE@python.inline@if actual_gov != str(gov):@@@",
+ "@@@STEP_LOG_LINE@python.inline@ raise Exception('(actual, expected) (%s, %d)'@@@",
+ "@@@STEP_LOG_LINE@python.inline@ % (actual_gov, gov))@@@",
+ "@@@STEP_LOG_END@python.inline@@@"
+ ]
+ },
+ {
+ "cmd": [
+ "python",
+ "-u",
+ "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ncpu = int(sys.argv[2])\ngov = sys.argv[3]\n\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nsubprocess.check_output([ADB, 'shell', 'echo \"%s\" > '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])\nactual_gov = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()\nif actual_gov != str(gov):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_gov, gov))\n",
+ "/usr/bin/adb.1.0.35",
+ "2",
+ "userspace"
+ ],
+ "env": {
+ "BUILDTYPE": "Debug",
+ "CHROME_HEADLESS": "1",
+ "PATH": "<PATH>:RECIPE_PACKAGE_REPO[depot_tools]",
+ "SKIA_OUT": "[START_DIR]/out"
+ },
+ "infra_step": true,
+ "name": "Set CPU 2's governor to userspace",
+ "timeout": 30,
+ "~followup_annotations": [
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@import os@@@",
+ "@@@STEP_LOG_LINE@python.inline@import subprocess@@@",
+ "@@@STEP_LOG_LINE@python.inline@import sys@@@",
+ "@@@STEP_LOG_LINE@python.inline@import time@@@",
+ "@@@STEP_LOG_LINE@python.inline@ADB = sys.argv[1]@@@",
+ "@@@STEP_LOG_LINE@python.inline@cpu = int(sys.argv[2])@@@",
+ "@@@STEP_LOG_LINE@python.inline@gov = sys.argv[3]@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@log = subprocess.check_output([ADB, 'root'])@@@",
+ "@@@STEP_LOG_LINE@python.inline@# check for message like 'adbd cannot run as root in production builds'@@@",
+ "@@@STEP_LOG_LINE@python.inline@print log@@@",
+ "@@@STEP_LOG_LINE@python.inline@if 'cannot' in log:@@@",
+ "@@@STEP_LOG_LINE@python.inline@ raise Exception('adb root failed')@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Check for message like '/system/bin/sh: file not found'@@@",
- "@@@STEP_LOG_LINE@python.inline@ if available_freqs and '/system/bin/sh' not in available_freqs:@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = sorted(@@@",
- "@@@STEP_LOG_LINE@python.inline@ int(i) for i in available_freqs.strip().split())@@@",
- "@@@STEP_LOG_LINE@python.inline@ else:@@@",
- "@@@STEP_LOG_LINE@python.inline@ raise Exception('Could not get list of available frequencies: %s' %@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs)@@@",
+ "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo \"%s\" > '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])@@@",
+ "@@@STEP_LOG_LINE@python.inline@actual_gov = subprocess.check_output([ADB, 'shell', 'cat '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()@@@",
+ "@@@STEP_LOG_LINE@python.inline@if actual_gov != str(gov):@@@",
+ "@@@STEP_LOG_LINE@python.inline@ raise Exception('(actual, expected) (%s, %d)'@@@",
+ "@@@STEP_LOG_LINE@python.inline@ % (actual_gov, gov))@@@",
+ "@@@STEP_LOG_END@python.inline@@@"
+ ]
+ },
+ {
+ "cmd": [
+ "python",
+ "-u",
+ "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ntarget_percent = float(sys.argv[2])\ncpu = int(sys.argv[3])\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nroot = '/sys/devices/system/cpu/cpu%d/cpufreq' %cpu\n\n# All devices we test on give a list of their available frequencies.\navailable_freqs = subprocess.check_output([ADB, 'shell',\n 'cat %s/scaling_available_frequencies' % root])\n\n# Check for message like '/system/bin/sh: file not found'\nif available_freqs and '/system/bin/sh' not in available_freqs:\n available_freqs = sorted(\n int(i) for i in available_freqs.strip().split())\nelse:\n raise Exception('Could not get list of available frequencies: %s' %\n available_freqs)\n\nmaxfreq = available_freqs[-1]\ntarget = int(round(maxfreq * target_percent))\nfreq = maxfreq\nfor f in reversed(available_freqs):\n if f <= target:\n freq = f\n break\n\nprint 'Setting frequency to %d' % freq\n\n# If scaling_max_freq is lower than our attempted setting, it won't take.\n# We must set min first, because if we try to set max to be less than min\n# (which sometimes happens after certain devices reboot) it returns a\n# perplexing permissions error.\nsubprocess.check_output([ADB, 'shell', 'echo 0 > '\n '%s/scaling_min_freq' % root])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '%s/scaling_max_freq' % (freq, root)])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '%s/scaling_setspeed' % (freq, root)])\ntime.sleep(5)\nactual_freq = subprocess.check_output([ADB, 'shell', 'cat '\n '%s/scaling_cur_freq' % root]).strip()\nif actual_freq != str(freq):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_freq, freq))\n",
+ "/usr/bin/adb.1.0.35",
+ "0.6",
+ "2"
+ ],
+ "env": {
+ "BUILDTYPE": "Debug",
+ "CHROME_HEADLESS": "1",
+ "PATH": "<PATH>:RECIPE_PACKAGE_REPO[depot_tools]",
+ "SKIA_OUT": "[START_DIR]/out"
+ },
+ "infra_step": true,
+ "name": "Scale CPU 2 to 0.600000",
+ "timeout": 30,
+ "~followup_annotations": [
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@import os@@@",
+ "@@@STEP_LOG_LINE@python.inline@import subprocess@@@",
+ "@@@STEP_LOG_LINE@python.inline@import sys@@@",
+ "@@@STEP_LOG_LINE@python.inline@import time@@@",
+ "@@@STEP_LOG_LINE@python.inline@ADB = sys.argv[1]@@@",
+ "@@@STEP_LOG_LINE@python.inline@target_percent = float(sys.argv[2])@@@",
+ "@@@STEP_LOG_LINE@python.inline@cpu = int(sys.argv[3])@@@",
+ "@@@STEP_LOG_LINE@python.inline@log = subprocess.check_output([ADB, 'root'])@@@",
+ "@@@STEP_LOG_LINE@python.inline@# check for message like 'adbd cannot run as root in production builds'@@@",
+ "@@@STEP_LOG_LINE@python.inline@print log@@@",
+ "@@@STEP_LOG_LINE@python.inline@if 'cannot' in log:@@@",
+ "@@@STEP_LOG_LINE@python.inline@ raise Exception('adb root failed')@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@root = '/sys/devices/system/cpu/cpu%d/cpufreq' %cpu@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@# All devices we test on give a list of their available frequencies.@@@",
+ "@@@STEP_LOG_LINE@python.inline@available_freqs = subprocess.check_output([ADB, 'shell',@@@",
+ "@@@STEP_LOG_LINE@python.inline@ 'cat %s/scaling_available_frequencies' % root])@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@# Check for message like '/system/bin/sh: file not found'@@@",
+ "@@@STEP_LOG_LINE@python.inline@if available_freqs and '/system/bin/sh' not in available_freqs:@@@",
+ "@@@STEP_LOG_LINE@python.inline@ available_freqs = sorted(@@@",
+ "@@@STEP_LOG_LINE@python.inline@ int(i) for i in available_freqs.strip().split())@@@",
+ "@@@STEP_LOG_LINE@python.inline@else:@@@",
+ "@@@STEP_LOG_LINE@python.inline@ raise Exception('Could not get list of available frequencies: %s' %@@@",
+ "@@@STEP_LOG_LINE@python.inline@ available_freqs)@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@maxfreq = available_freqs[-1]@@@",
"@@@STEP_LOG_LINE@python.inline@target = int(round(maxfreq * target_percent))@@@",
@@ -760,21 +837,19 @@
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@print 'Setting frequency to %d' % freq@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo \"userspace\" > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor'])@@@",
"@@@STEP_LOG_LINE@python.inline@# If scaling_max_freq is lower than our attempted setting, it won't take.@@@",
"@@@STEP_LOG_LINE@python.inline@# We must set min first, because if we try to set max to be less than min@@@",
"@@@STEP_LOG_LINE@python.inline@# (which sometimes happens after certain devices reboot) it returns a@@@",
"@@@STEP_LOG_LINE@python.inline@# perplexing permissions error.@@@",
"@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo 0 > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq'])@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '%s/scaling_min_freq' % root])@@@",
"@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo %d > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '%s/scaling_max_freq' % (freq, root)])@@@",
"@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo %d > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed' % freq])@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '%s/scaling_setspeed' % (freq, root)])@@@",
"@@@STEP_LOG_LINE@python.inline@time.sleep(5)@@@",
"@@@STEP_LOG_LINE@python.inline@actual_freq = subprocess.check_output([ADB, 'shell', 'cat '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq']).strip()@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '%s/scaling_cur_freq' % root]).strip()@@@",
"@@@STEP_LOG_LINE@python.inline@if actual_freq != str(freq):@@@",
"@@@STEP_LOG_LINE@python.inline@ raise Exception('(actual, expected) (%s, %d)'@@@",
"@@@STEP_LOG_LINE@python.inline@ % (actual_freq, freq))@@@",
diff --git a/infra/bots/recipe_modules/flavor/examples/full.expected/retry_adb_command.json b/infra/bots/recipe_modules/flavor/examples/full.expected/retry_adb_command.json
index 1814528b26..d15c2ac0a6 100644
--- a/infra/bots/recipe_modules/flavor/examples/full.expected/retry_adb_command.json
+++ b/infra/bots/recipe_modules/flavor/examples/full.expected/retry_adb_command.json
@@ -696,10 +696,10 @@
"cmd": [
"python",
"-u",
- "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\nmodel = sys.argv[2]\ntarget_percent = float(sys.argv[3])\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nif model == 'Nexus7':\n # Nexus7 claims to support 1300000, but only really allows 1200000\n available_freqs = [51000, 102000, 204000, 340000, 475000, 640000, 760000,\n 860000, 1000000, 1100000, 1200000]\nelse:\n # Temporary logging to get a sense of what devices have multiple cpus\n try:\n print subprocess.check_output([ADB, 'shell', 'cat ',\n '/sys/devices/system/cpu/cpu?/cpufreq/affected_cpus'])\n print subprocess.check_output([ADB, 'shell', 'cat ',\n '/sys/devices/system/cpu/cpu?/cpufreq/scaling_available_frequencies'])\n except Exception as e:\n print e.output.strip()\n # Most devices give a list of their available frequencies.\n available_freqs = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies'])\n\n # Check for message like '/system/bin/sh: file not found'\n if available_freqs and '/system/bin/sh' not in available_freqs:\n available_freqs = sorted(\n int(i) for i in available_freqs.strip().split())\n else:\n raise Exception('Could not get list of available frequencies: %s' %\n available_freqs)\n\nmaxfreq = available_freqs[-1]\ntarget = int(round(maxfreq * target_percent))\nfreq = maxfreq\nfor f in reversed(available_freqs):\n if f <= target:\n freq = f\n break\n\nprint 'Setting frequency to %d' % freq\n\nsubprocess.check_output([ADB, 'shell', 'echo \"userspace\" > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor'])\n# If scaling_max_freq is lower than our attempted setting, it won't take.\n# We must set min first, because if we try to set max to be less than min\n# (which sometimes happens after certain devices reboot) it returns a\n# perplexing permissions error.\nsubprocess.check_output([ADB, 'shell', 'echo 0 > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq'])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed' % freq])\ntime.sleep(5)\nactual_freq = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq']).strip()\nif actual_freq != str(freq):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_freq, freq))\n",
+ "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ncpu = int(sys.argv[2])\ngov = sys.argv[3]\n\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nsubprocess.check_output([ADB, 'shell', 'echo \"%s\" > '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])\nactual_gov = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()\nif actual_gov != str(gov):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_gov, gov))\n",
"/usr/bin/adb.1.0.35",
- "NexusPlayer",
- "0.6"
+ "0",
+ "powersave"
],
"env": {
"BUILDTYPE": "Debug",
@@ -708,7 +708,7 @@
"SKIA_OUT": "[START_DIR]/out"
},
"infra_step": true,
- "name": "Scale CPU to 0.600000",
+ "name": "Set CPU 0's governor to powersave",
"timeout": 30,
"~followup_annotations": [
"@@@STEP_LOG_LINE@python.inline@@@@",
@@ -717,38 +717,115 @@
"@@@STEP_LOG_LINE@python.inline@import sys@@@",
"@@@STEP_LOG_LINE@python.inline@import time@@@",
"@@@STEP_LOG_LINE@python.inline@ADB = sys.argv[1]@@@",
- "@@@STEP_LOG_LINE@python.inline@model = sys.argv[2]@@@",
- "@@@STEP_LOG_LINE@python.inline@target_percent = float(sys.argv[3])@@@",
+ "@@@STEP_LOG_LINE@python.inline@cpu = int(sys.argv[2])@@@",
+ "@@@STEP_LOG_LINE@python.inline@gov = sys.argv[3]@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@log = subprocess.check_output([ADB, 'root'])@@@",
"@@@STEP_LOG_LINE@python.inline@# check for message like 'adbd cannot run as root in production builds'@@@",
"@@@STEP_LOG_LINE@python.inline@print log@@@",
"@@@STEP_LOG_LINE@python.inline@if 'cannot' in log:@@@",
"@@@STEP_LOG_LINE@python.inline@ raise Exception('adb root failed')@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@if model == 'Nexus7':@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Nexus7 claims to support 1300000, but only really allows 1200000@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = [51000, 102000, 204000, 340000, 475000, 640000, 760000,@@@",
- "@@@STEP_LOG_LINE@python.inline@ 860000, 1000000, 1100000, 1200000]@@@",
- "@@@STEP_LOG_LINE@python.inline@else:@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Temporary logging to get a sense of what devices have multiple cpus@@@",
- "@@@STEP_LOG_LINE@python.inline@ try:@@@",
- "@@@STEP_LOG_LINE@python.inline@ print subprocess.check_output([ADB, 'shell', 'cat ',@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu?/cpufreq/affected_cpus'])@@@",
- "@@@STEP_LOG_LINE@python.inline@ print subprocess.check_output([ADB, 'shell', 'cat ',@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu?/cpufreq/scaling_available_frequencies'])@@@",
- "@@@STEP_LOG_LINE@python.inline@ except Exception as e:@@@",
- "@@@STEP_LOG_LINE@python.inline@ print e.output.strip()@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Most devices give a list of their available frequencies.@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = subprocess.check_output([ADB, 'shell', 'cat '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies'])@@@",
+ "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo \"%s\" > '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])@@@",
+ "@@@STEP_LOG_LINE@python.inline@actual_gov = subprocess.check_output([ADB, 'shell', 'cat '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()@@@",
+ "@@@STEP_LOG_LINE@python.inline@if actual_gov != str(gov):@@@",
+ "@@@STEP_LOG_LINE@python.inline@ raise Exception('(actual, expected) (%s, %d)'@@@",
+ "@@@STEP_LOG_LINE@python.inline@ % (actual_gov, gov))@@@",
+ "@@@STEP_LOG_END@python.inline@@@"
+ ]
+ },
+ {
+ "cmd": [
+ "python",
+ "-u",
+ "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ncpu = int(sys.argv[2])\ngov = sys.argv[3]\n\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nsubprocess.check_output([ADB, 'shell', 'echo \"%s\" > '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])\nactual_gov = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()\nif actual_gov != str(gov):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_gov, gov))\n",
+ "/usr/bin/adb.1.0.35",
+ "2",
+ "userspace"
+ ],
+ "env": {
+ "BUILDTYPE": "Debug",
+ "CHROME_HEADLESS": "1",
+ "PATH": "<PATH>:RECIPE_PACKAGE_REPO[depot_tools]",
+ "SKIA_OUT": "[START_DIR]/out"
+ },
+ "infra_step": true,
+ "name": "Set CPU 2's governor to userspace",
+ "timeout": 30,
+ "~followup_annotations": [
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@import os@@@",
+ "@@@STEP_LOG_LINE@python.inline@import subprocess@@@",
+ "@@@STEP_LOG_LINE@python.inline@import sys@@@",
+ "@@@STEP_LOG_LINE@python.inline@import time@@@",
+ "@@@STEP_LOG_LINE@python.inline@ADB = sys.argv[1]@@@",
+ "@@@STEP_LOG_LINE@python.inline@cpu = int(sys.argv[2])@@@",
+ "@@@STEP_LOG_LINE@python.inline@gov = sys.argv[3]@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@log = subprocess.check_output([ADB, 'root'])@@@",
+ "@@@STEP_LOG_LINE@python.inline@# check for message like 'adbd cannot run as root in production builds'@@@",
+ "@@@STEP_LOG_LINE@python.inline@print log@@@",
+ "@@@STEP_LOG_LINE@python.inline@if 'cannot' in log:@@@",
+ "@@@STEP_LOG_LINE@python.inline@ raise Exception('adb root failed')@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Check for message like '/system/bin/sh: file not found'@@@",
- "@@@STEP_LOG_LINE@python.inline@ if available_freqs and '/system/bin/sh' not in available_freqs:@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = sorted(@@@",
- "@@@STEP_LOG_LINE@python.inline@ int(i) for i in available_freqs.strip().split())@@@",
- "@@@STEP_LOG_LINE@python.inline@ else:@@@",
- "@@@STEP_LOG_LINE@python.inline@ raise Exception('Could not get list of available frequencies: %s' %@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs)@@@",
+ "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo \"%s\" > '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])@@@",
+ "@@@STEP_LOG_LINE@python.inline@actual_gov = subprocess.check_output([ADB, 'shell', 'cat '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()@@@",
+ "@@@STEP_LOG_LINE@python.inline@if actual_gov != str(gov):@@@",
+ "@@@STEP_LOG_LINE@python.inline@ raise Exception('(actual, expected) (%s, %d)'@@@",
+ "@@@STEP_LOG_LINE@python.inline@ % (actual_gov, gov))@@@",
+ "@@@STEP_LOG_END@python.inline@@@"
+ ]
+ },
+ {
+ "cmd": [
+ "python",
+ "-u",
+ "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ntarget_percent = float(sys.argv[2])\ncpu = int(sys.argv[3])\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nroot = '/sys/devices/system/cpu/cpu%d/cpufreq' %cpu\n\n# All devices we test on give a list of their available frequencies.\navailable_freqs = subprocess.check_output([ADB, 'shell',\n 'cat %s/scaling_available_frequencies' % root])\n\n# Check for message like '/system/bin/sh: file not found'\nif available_freqs and '/system/bin/sh' not in available_freqs:\n available_freqs = sorted(\n int(i) for i in available_freqs.strip().split())\nelse:\n raise Exception('Could not get list of available frequencies: %s' %\n available_freqs)\n\nmaxfreq = available_freqs[-1]\ntarget = int(round(maxfreq * target_percent))\nfreq = maxfreq\nfor f in reversed(available_freqs):\n if f <= target:\n freq = f\n break\n\nprint 'Setting frequency to %d' % freq\n\n# If scaling_max_freq is lower than our attempted setting, it won't take.\n# We must set min first, because if we try to set max to be less than min\n# (which sometimes happens after certain devices reboot) it returns a\n# perplexing permissions error.\nsubprocess.check_output([ADB, 'shell', 'echo 0 > '\n '%s/scaling_min_freq' % root])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '%s/scaling_max_freq' % (freq, root)])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '%s/scaling_setspeed' % (freq, root)])\ntime.sleep(5)\nactual_freq = subprocess.check_output([ADB, 'shell', 'cat '\n '%s/scaling_cur_freq' % root]).strip()\nif actual_freq != str(freq):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_freq, freq))\n",
+ "/usr/bin/adb.1.0.35",
+ "0.6",
+ "2"
+ ],
+ "env": {
+ "BUILDTYPE": "Debug",
+ "CHROME_HEADLESS": "1",
+ "PATH": "<PATH>:RECIPE_PACKAGE_REPO[depot_tools]",
+ "SKIA_OUT": "[START_DIR]/out"
+ },
+ "infra_step": true,
+ "name": "Scale CPU 2 to 0.600000",
+ "timeout": 30,
+ "~followup_annotations": [
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@import os@@@",
+ "@@@STEP_LOG_LINE@python.inline@import subprocess@@@",
+ "@@@STEP_LOG_LINE@python.inline@import sys@@@",
+ "@@@STEP_LOG_LINE@python.inline@import time@@@",
+ "@@@STEP_LOG_LINE@python.inline@ADB = sys.argv[1]@@@",
+ "@@@STEP_LOG_LINE@python.inline@target_percent = float(sys.argv[2])@@@",
+ "@@@STEP_LOG_LINE@python.inline@cpu = int(sys.argv[3])@@@",
+ "@@@STEP_LOG_LINE@python.inline@log = subprocess.check_output([ADB, 'root'])@@@",
+ "@@@STEP_LOG_LINE@python.inline@# check for message like 'adbd cannot run as root in production builds'@@@",
+ "@@@STEP_LOG_LINE@python.inline@print log@@@",
+ "@@@STEP_LOG_LINE@python.inline@if 'cannot' in log:@@@",
+ "@@@STEP_LOG_LINE@python.inline@ raise Exception('adb root failed')@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@root = '/sys/devices/system/cpu/cpu%d/cpufreq' %cpu@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@# All devices we test on give a list of their available frequencies.@@@",
+ "@@@STEP_LOG_LINE@python.inline@available_freqs = subprocess.check_output([ADB, 'shell',@@@",
+ "@@@STEP_LOG_LINE@python.inline@ 'cat %s/scaling_available_frequencies' % root])@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@# Check for message like '/system/bin/sh: file not found'@@@",
+ "@@@STEP_LOG_LINE@python.inline@if available_freqs and '/system/bin/sh' not in available_freqs:@@@",
+ "@@@STEP_LOG_LINE@python.inline@ available_freqs = sorted(@@@",
+ "@@@STEP_LOG_LINE@python.inline@ int(i) for i in available_freqs.strip().split())@@@",
+ "@@@STEP_LOG_LINE@python.inline@else:@@@",
+ "@@@STEP_LOG_LINE@python.inline@ raise Exception('Could not get list of available frequencies: %s' %@@@",
+ "@@@STEP_LOG_LINE@python.inline@ available_freqs)@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@maxfreq = available_freqs[-1]@@@",
"@@@STEP_LOG_LINE@python.inline@target = int(round(maxfreq * target_percent))@@@",
@@ -760,21 +837,19 @@
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@print 'Setting frequency to %d' % freq@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo \"userspace\" > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor'])@@@",
"@@@STEP_LOG_LINE@python.inline@# If scaling_max_freq is lower than our attempted setting, it won't take.@@@",
"@@@STEP_LOG_LINE@python.inline@# We must set min first, because if we try to set max to be less than min@@@",
"@@@STEP_LOG_LINE@python.inline@# (which sometimes happens after certain devices reboot) it returns a@@@",
"@@@STEP_LOG_LINE@python.inline@# perplexing permissions error.@@@",
"@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo 0 > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq'])@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '%s/scaling_min_freq' % root])@@@",
"@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo %d > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '%s/scaling_max_freq' % (freq, root)])@@@",
"@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo %d > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed' % freq])@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '%s/scaling_setspeed' % (freq, root)])@@@",
"@@@STEP_LOG_LINE@python.inline@time.sleep(5)@@@",
"@@@STEP_LOG_LINE@python.inline@actual_freq = subprocess.check_output([ADB, 'shell', 'cat '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq']).strip()@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '%s/scaling_cur_freq' % root]).strip()@@@",
"@@@STEP_LOG_LINE@python.inline@if actual_freq != str(freq):@@@",
"@@@STEP_LOG_LINE@python.inline@ raise Exception('(actual, expected) (%s, %d)'@@@",
"@@@STEP_LOG_LINE@python.inline@ % (actual_freq, freq))@@@",
diff --git a/infra/bots/recipe_modules/flavor/examples/full.py b/infra/bots/recipe_modules/flavor/examples/full.py
index d1630daba1..d97732fbf5 100644
--- a/infra/bots/recipe_modules/flavor/examples/full.py
+++ b/infra/bots/recipe_modules/flavor/examples/full.py
@@ -83,6 +83,7 @@ TEST_BUILDERS = [
'Build-Win-MSVC-x86-Debug-Exceptions',
'Housekeeper-PerCommit-CheckGeneratedFiles',
'Perf-Android-Clang-NexusPlayer-GPU-PowerVR-x86-Debug-All-Android',
+ 'Perf-Android-Clang-GalaxyS7_G930FD-GPU-MaliT880-arm64-Debug-All-Android',
'Perf-Android-Clang-Pixel-GPU-Adreno530-arm64-Debug-All-Android',
'Perf-ChromeOS-Clang-SamsungChromebookPlus-GPU-MaliT860-arm-Release-All',
'Perf-Chromecast-GCC-Chorizo-CPU-Cortex_A7-arm-Release-All',
@@ -193,5 +194,5 @@ def GenTests(api):
revision='abc123',
path_config='kitchen',
swarm_out_dir='[SWARM_OUT_DIR]') +
- api.step_data('Scale CPU to 0.600000', retcode=1)
+ api.step_data('Scale CPU 2 to 0.600000', retcode=1)
)
diff --git a/infra/bots/recipe_modules/flavor/gn_android_flavor.py b/infra/bots/recipe_modules/flavor/gn_android_flavor.py
index 953a7b31c5..f72326d2b3 100644
--- a/infra/bots/recipe_modules/flavor/gn_android_flavor.py
+++ b/infra/bots/recipe_modules/flavor/gn_android_flavor.py
@@ -73,12 +73,82 @@ class GNAndroidFlavorUtils(default_flavor.DefaultFlavorUtils):
rootable_blacklist = ['GalaxyS6', 'GalaxyS7_G930A', 'GalaxyS7_G930FD',
'MotoG4', 'NVIDIA_Shield']
- def _lock_cpu(self, target_percent):
- if (self.m.vars.builder_cfg.get('model') in self.rootable_blacklist or
+ # Maps device type -> cpu ids that need to be set when scaling, with the
+ # primary CPU being listed first. CPUs are configured together,
+ # for example, the Nexus 5x has cpu0-3 and cpu4-5 linked together, each
+ # group using the same configuration - anything that happens to cpu0,
+ # happens to cpu1-3.
+ # cpus at index 1+ will be clocked down to powersave during nanobench.
+ # TODO(kjlubick): determine this dynamically - should be able to look
+ # at which cores have the highest frequency and affected_cpus.
+ cpus_to_scale = {
+ 'Nexus5x': [4, 0],
+ 'NexusPlayer': [2, 0],
+ 'Pixel': [2, 0],
+ 'Pixel2XL': [4, 0]
+ }
+
+ def _scale_for_dm(self):
+ device = self.m.vars.builder_cfg.get('model')
+ if (device in self.rootable_blacklist or
self.m.vars.internal_hardware_label):
return
+
+ for i in self.cpus_to_scale.get(device, [0]):
+ self._set_governor(i, 'ondemand')
+
+ def _scale_for_nanobench(self):
+ device = self.m.vars.builder_cfg.get('model')
+ if (device in self.rootable_blacklist or
+ self.m.vars.internal_hardware_label):
+ return
+
+ cpus = self.cpus_to_scale.get(device, [0])
+
+ for i in cpus[1:]:
+ self._set_governor(i, 'powersave')
+
+ # Scale just the first (primary) cpu.
+ self._set_governor(cpus[0], 'userspace')
+ self._scale_cpu(cpus[0], 0.6)
+
+ def _set_governor(self, cpu, gov):
+ self._ever_ran_adb = True
+ self.m.run.with_retry(self.m.python.inline,
+ "Set CPU %d's governor to %s" % (cpu, gov),
+ 3, # attempts
+ program="""
+import os
+import subprocess
+import sys
+import time
+ADB = sys.argv[1]
+cpu = int(sys.argv[2])
+gov = sys.argv[3]
+
+log = subprocess.check_output([ADB, 'root'])
+# check for message like 'adbd cannot run as root in production builds'
+print log
+if 'cannot' in log:
+ raise Exception('adb root failed')
+
+subprocess.check_output([ADB, 'shell', 'echo "%s" > '
+ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])
+actual_gov = subprocess.check_output([ADB, 'shell', 'cat '
+ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()
+if actual_gov != str(gov):
+ raise Exception('(actual, expected) (%s, %d)'
+ % (actual_gov, gov))
+""",
+ args = [self.ADB_BINARY, cpu, gov],
+ infra_step=True,
+ timeout=30)
+
+
+ def _scale_cpu(self, cpu, target_percent):
+ self._ever_ran_adb = True
self.m.run.with_retry(self.m.python.inline,
- 'Scale CPU to %f' % target_percent,
+ 'Scale CPU %d to %f' % (cpu, target_percent),
3, # attempts
program="""
import os
@@ -86,38 +156,27 @@ import subprocess
import sys
import time
ADB = sys.argv[1]
-model = sys.argv[2]
-target_percent = float(sys.argv[3])
+target_percent = float(sys.argv[2])
+cpu = int(sys.argv[3])
log = subprocess.check_output([ADB, 'root'])
# check for message like 'adbd cannot run as root in production builds'
print log
if 'cannot' in log:
raise Exception('adb root failed')
-if model == 'Nexus7':
- # Nexus7 claims to support 1300000, but only really allows 1200000
- available_freqs = [51000, 102000, 204000, 340000, 475000, 640000, 760000,
- 860000, 1000000, 1100000, 1200000]
+root = '/sys/devices/system/cpu/cpu%d/cpufreq' %cpu
+
+# All devices we test on give a list of their available frequencies.
+available_freqs = subprocess.check_output([ADB, 'shell',
+ 'cat %s/scaling_available_frequencies' % root])
+
+# Check for message like '/system/bin/sh: file not found'
+if available_freqs and '/system/bin/sh' not in available_freqs:
+ available_freqs = sorted(
+ int(i) for i in available_freqs.strip().split())
else:
- # Temporary logging to get a sense of what devices have multiple cpus
- try:
- print subprocess.check_output([ADB, 'shell', 'cat ',
- '/sys/devices/system/cpu/cpu?/cpufreq/affected_cpus'])
- print subprocess.check_output([ADB, 'shell', 'cat ',
- '/sys/devices/system/cpu/cpu?/cpufreq/scaling_available_frequencies'])
- except Exception as e:
- print e.output.strip()
- # Most devices give a list of their available frequencies.
- available_freqs = subprocess.check_output([ADB, 'shell', 'cat '
- '/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies'])
-
- # Check for message like '/system/bin/sh: file not found'
- if available_freqs and '/system/bin/sh' not in available_freqs:
- available_freqs = sorted(
- int(i) for i in available_freqs.strip().split())
- else:
- raise Exception('Could not get list of available frequencies: %s' %
- available_freqs)
+ raise Exception('Could not get list of available frequencies: %s' %
+ available_freqs)
maxfreq = available_freqs[-1]
target = int(round(maxfreq * target_percent))
@@ -129,27 +188,24 @@ for f in reversed(available_freqs):
print 'Setting frequency to %d' % freq
-subprocess.check_output([ADB, 'shell', 'echo "userspace" > '
- '/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor'])
# If scaling_max_freq is lower than our attempted setting, it won't take.
# We must set min first, because if we try to set max to be less than min
# (which sometimes happens after certain devices reboot) it returns a
# perplexing permissions error.
subprocess.check_output([ADB, 'shell', 'echo 0 > '
- '/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq'])
+ '%s/scaling_min_freq' % root])
subprocess.check_output([ADB, 'shell', 'echo %d > '
- '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])
+ '%s/scaling_max_freq' % (freq, root)])
subprocess.check_output([ADB, 'shell', 'echo %d > '
- '/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed' % freq])
+ '%s/scaling_setspeed' % (freq, root)])
time.sleep(5)
actual_freq = subprocess.check_output([ADB, 'shell', 'cat '
- '/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq']).strip()
+ '%s/scaling_cur_freq' % root]).strip()
if actual_freq != str(freq):
raise Exception('(actual, expected) (%s, %d)'
% (actual_freq, freq))
""",
- args = [self.ADB_BINARY, self.m.vars.builder_cfg.get('model'),
- str(target_percent)],
+ args = [self.ADB_BINARY, str(target_percent), cpu],
infra_step=True,
timeout=30)
@@ -245,9 +301,9 @@ if actual_freq != str(freq):
def step(self, name, cmd, **kwargs):
if (cmd[0] == 'nanobench'):
- self._lock_cpu(0.6)
+ self._scale_for_nanobench()
else:
- self._lock_cpu(1.0)
+ self._scale_for_dm()
app = self.m.vars.skia_out.join(self.m.vars.configuration, cmd[0])
self._adb('push %s' % cmd[0],
'push', app, self.m.vars.android_bin_dir)
diff --git a/infra/bots/recipes/perf.expected/Perf-Android-Clang-Nexus5-GPU-Adreno330-arm-Debug-All-Android.json b/infra/bots/recipes/perf.expected/Perf-Android-Clang-Nexus5-GPU-Adreno330-arm-Debug-All-Android.json
index dcbb214cbb..b692d3e0f6 100644
--- a/infra/bots/recipes/perf.expected/Perf-Android-Clang-Nexus5-GPU-Adreno330-arm-Debug-All-Android.json
+++ b/infra/bots/recipes/perf.expected/Perf-Android-Clang-Nexus5-GPU-Adreno330-arm-Debug-All-Android.json
@@ -540,10 +540,10 @@
"cmd": [
"python",
"-u",
- "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\nmodel = sys.argv[2]\ntarget_percent = float(sys.argv[3])\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nif model == 'Nexus7':\n # Nexus7 claims to support 1300000, but only really allows 1200000\n available_freqs = [51000, 102000, 204000, 340000, 475000, 640000, 760000,\n 860000, 1000000, 1100000, 1200000]\nelse:\n # Temporary logging to get a sense of what devices have multiple cpus\n try:\n print subprocess.check_output([ADB, 'shell', 'cat ',\n '/sys/devices/system/cpu/cpu?/cpufreq/affected_cpus'])\n print subprocess.check_output([ADB, 'shell', 'cat ',\n '/sys/devices/system/cpu/cpu?/cpufreq/scaling_available_frequencies'])\n except Exception as e:\n print e.output.strip()\n # Most devices give a list of their available frequencies.\n available_freqs = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies'])\n\n # Check for message like '/system/bin/sh: file not found'\n if available_freqs and '/system/bin/sh' not in available_freqs:\n available_freqs = sorted(\n int(i) for i in available_freqs.strip().split())\n else:\n raise Exception('Could not get list of available frequencies: %s' %\n available_freqs)\n\nmaxfreq = available_freqs[-1]\ntarget = int(round(maxfreq * target_percent))\nfreq = maxfreq\nfor f in reversed(available_freqs):\n if f <= target:\n freq = f\n break\n\nprint 'Setting frequency to %d' % freq\n\nsubprocess.check_output([ADB, 'shell', 'echo \"userspace\" > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor'])\n# If scaling_max_freq is lower than our attempted setting, it won't take.\n# We must set min first, because if we try to set max to be less than min\n# (which sometimes happens after certain devices reboot) it returns a\n# perplexing permissions error.\nsubprocess.check_output([ADB, 'shell', 'echo 0 > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq'])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed' % freq])\ntime.sleep(5)\nactual_freq = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq']).strip()\nif actual_freq != str(freq):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_freq, freq))\n",
+ "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ncpu = int(sys.argv[2])\ngov = sys.argv[3]\n\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nsubprocess.check_output([ADB, 'shell', 'echo \"%s\" > '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])\nactual_gov = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()\nif actual_gov != str(gov):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_gov, gov))\n",
"/usr/bin/adb.1.0.35",
- "Nexus5",
- "0.6"
+ "0",
+ "userspace"
],
"env": {
"BUILDTYPE": "Debug",
@@ -552,7 +552,7 @@
"SKIA_OUT": "[START_DIR]/out"
},
"infra_step": true,
- "name": "Scale CPU to 0.600000",
+ "name": "Set CPU 0's governor to userspace",
"timeout": 30,
"~followup_annotations": [
"@@@STEP_LOG_LINE@python.inline@@@@",
@@ -561,38 +561,71 @@
"@@@STEP_LOG_LINE@python.inline@import sys@@@",
"@@@STEP_LOG_LINE@python.inline@import time@@@",
"@@@STEP_LOG_LINE@python.inline@ADB = sys.argv[1]@@@",
- "@@@STEP_LOG_LINE@python.inline@model = sys.argv[2]@@@",
- "@@@STEP_LOG_LINE@python.inline@target_percent = float(sys.argv[3])@@@",
+ "@@@STEP_LOG_LINE@python.inline@cpu = int(sys.argv[2])@@@",
+ "@@@STEP_LOG_LINE@python.inline@gov = sys.argv[3]@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@log = subprocess.check_output([ADB, 'root'])@@@",
"@@@STEP_LOG_LINE@python.inline@# check for message like 'adbd cannot run as root in production builds'@@@",
"@@@STEP_LOG_LINE@python.inline@print log@@@",
"@@@STEP_LOG_LINE@python.inline@if 'cannot' in log:@@@",
"@@@STEP_LOG_LINE@python.inline@ raise Exception('adb root failed')@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@if model == 'Nexus7':@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Nexus7 claims to support 1300000, but only really allows 1200000@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = [51000, 102000, 204000, 340000, 475000, 640000, 760000,@@@",
- "@@@STEP_LOG_LINE@python.inline@ 860000, 1000000, 1100000, 1200000]@@@",
- "@@@STEP_LOG_LINE@python.inline@else:@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Temporary logging to get a sense of what devices have multiple cpus@@@",
- "@@@STEP_LOG_LINE@python.inline@ try:@@@",
- "@@@STEP_LOG_LINE@python.inline@ print subprocess.check_output([ADB, 'shell', 'cat ',@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu?/cpufreq/affected_cpus'])@@@",
- "@@@STEP_LOG_LINE@python.inline@ print subprocess.check_output([ADB, 'shell', 'cat ',@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu?/cpufreq/scaling_available_frequencies'])@@@",
- "@@@STEP_LOG_LINE@python.inline@ except Exception as e:@@@",
- "@@@STEP_LOG_LINE@python.inline@ print e.output.strip()@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Most devices give a list of their available frequencies.@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = subprocess.check_output([ADB, 'shell', 'cat '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies'])@@@",
+ "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo \"%s\" > '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])@@@",
+ "@@@STEP_LOG_LINE@python.inline@actual_gov = subprocess.check_output([ADB, 'shell', 'cat '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()@@@",
+ "@@@STEP_LOG_LINE@python.inline@if actual_gov != str(gov):@@@",
+ "@@@STEP_LOG_LINE@python.inline@ raise Exception('(actual, expected) (%s, %d)'@@@",
+ "@@@STEP_LOG_LINE@python.inline@ % (actual_gov, gov))@@@",
+ "@@@STEP_LOG_END@python.inline@@@"
+ ]
+ },
+ {
+ "cmd": [
+ "python",
+ "-u",
+ "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ntarget_percent = float(sys.argv[2])\ncpu = int(sys.argv[3])\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nroot = '/sys/devices/system/cpu/cpu%d/cpufreq' %cpu\n\n# All devices we test on give a list of their available frequencies.\navailable_freqs = subprocess.check_output([ADB, 'shell',\n 'cat %s/scaling_available_frequencies' % root])\n\n# Check for message like '/system/bin/sh: file not found'\nif available_freqs and '/system/bin/sh' not in available_freqs:\n available_freqs = sorted(\n int(i) for i in available_freqs.strip().split())\nelse:\n raise Exception('Could not get list of available frequencies: %s' %\n available_freqs)\n\nmaxfreq = available_freqs[-1]\ntarget = int(round(maxfreq * target_percent))\nfreq = maxfreq\nfor f in reversed(available_freqs):\n if f <= target:\n freq = f\n break\n\nprint 'Setting frequency to %d' % freq\n\n# If scaling_max_freq is lower than our attempted setting, it won't take.\n# We must set min first, because if we try to set max to be less than min\n# (which sometimes happens after certain devices reboot) it returns a\n# perplexing permissions error.\nsubprocess.check_output([ADB, 'shell', 'echo 0 > '\n '%s/scaling_min_freq' % root])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '%s/scaling_max_freq' % (freq, root)])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '%s/scaling_setspeed' % (freq, root)])\ntime.sleep(5)\nactual_freq = subprocess.check_output([ADB, 'shell', 'cat '\n '%s/scaling_cur_freq' % root]).strip()\nif actual_freq != str(freq):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_freq, freq))\n",
+ "/usr/bin/adb.1.0.35",
+ "0.6",
+ "0"
+ ],
+ "env": {
+ "BUILDTYPE": "Debug",
+ "CHROME_HEADLESS": "1",
+ "PATH": "<PATH>:RECIPE_PACKAGE_REPO[depot_tools]",
+ "SKIA_OUT": "[START_DIR]/out"
+ },
+ "infra_step": true,
+ "name": "Scale CPU 0 to 0.600000",
+ "timeout": 30,
+ "~followup_annotations": [
"@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Check for message like '/system/bin/sh: file not found'@@@",
- "@@@STEP_LOG_LINE@python.inline@ if available_freqs and '/system/bin/sh' not in available_freqs:@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = sorted(@@@",
- "@@@STEP_LOG_LINE@python.inline@ int(i) for i in available_freqs.strip().split())@@@",
- "@@@STEP_LOG_LINE@python.inline@ else:@@@",
- "@@@STEP_LOG_LINE@python.inline@ raise Exception('Could not get list of available frequencies: %s' %@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs)@@@",
+ "@@@STEP_LOG_LINE@python.inline@import os@@@",
+ "@@@STEP_LOG_LINE@python.inline@import subprocess@@@",
+ "@@@STEP_LOG_LINE@python.inline@import sys@@@",
+ "@@@STEP_LOG_LINE@python.inline@import time@@@",
+ "@@@STEP_LOG_LINE@python.inline@ADB = sys.argv[1]@@@",
+ "@@@STEP_LOG_LINE@python.inline@target_percent = float(sys.argv[2])@@@",
+ "@@@STEP_LOG_LINE@python.inline@cpu = int(sys.argv[3])@@@",
+ "@@@STEP_LOG_LINE@python.inline@log = subprocess.check_output([ADB, 'root'])@@@",
+ "@@@STEP_LOG_LINE@python.inline@# check for message like 'adbd cannot run as root in production builds'@@@",
+ "@@@STEP_LOG_LINE@python.inline@print log@@@",
+ "@@@STEP_LOG_LINE@python.inline@if 'cannot' in log:@@@",
+ "@@@STEP_LOG_LINE@python.inline@ raise Exception('adb root failed')@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@root = '/sys/devices/system/cpu/cpu%d/cpufreq' %cpu@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@# All devices we test on give a list of their available frequencies.@@@",
+ "@@@STEP_LOG_LINE@python.inline@available_freqs = subprocess.check_output([ADB, 'shell',@@@",
+ "@@@STEP_LOG_LINE@python.inline@ 'cat %s/scaling_available_frequencies' % root])@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@# Check for message like '/system/bin/sh: file not found'@@@",
+ "@@@STEP_LOG_LINE@python.inline@if available_freqs and '/system/bin/sh' not in available_freqs:@@@",
+ "@@@STEP_LOG_LINE@python.inline@ available_freqs = sorted(@@@",
+ "@@@STEP_LOG_LINE@python.inline@ int(i) for i in available_freqs.strip().split())@@@",
+ "@@@STEP_LOG_LINE@python.inline@else:@@@",
+ "@@@STEP_LOG_LINE@python.inline@ raise Exception('Could not get list of available frequencies: %s' %@@@",
+ "@@@STEP_LOG_LINE@python.inline@ available_freqs)@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@maxfreq = available_freqs[-1]@@@",
"@@@STEP_LOG_LINE@python.inline@target = int(round(maxfreq * target_percent))@@@",
@@ -604,21 +637,19 @@
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@print 'Setting frequency to %d' % freq@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo \"userspace\" > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor'])@@@",
"@@@STEP_LOG_LINE@python.inline@# If scaling_max_freq is lower than our attempted setting, it won't take.@@@",
"@@@STEP_LOG_LINE@python.inline@# We must set min first, because if we try to set max to be less than min@@@",
"@@@STEP_LOG_LINE@python.inline@# (which sometimes happens after certain devices reboot) it returns a@@@",
"@@@STEP_LOG_LINE@python.inline@# perplexing permissions error.@@@",
"@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo 0 > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq'])@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '%s/scaling_min_freq' % root])@@@",
"@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo %d > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '%s/scaling_max_freq' % (freq, root)])@@@",
"@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo %d > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed' % freq])@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '%s/scaling_setspeed' % (freq, root)])@@@",
"@@@STEP_LOG_LINE@python.inline@time.sleep(5)@@@",
"@@@STEP_LOG_LINE@python.inline@actual_freq = subprocess.check_output([ADB, 'shell', 'cat '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq']).strip()@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '%s/scaling_cur_freq' % root]).strip()@@@",
"@@@STEP_LOG_LINE@python.inline@if actual_freq != str(freq):@@@",
"@@@STEP_LOG_LINE@python.inline@ raise Exception('(actual, expected) (%s, %d)'@@@",
"@@@STEP_LOG_LINE@python.inline@ % (actual_freq, freq))@@@",
diff --git a/infra/bots/recipes/perf.expected/Perf-Android-Clang-Nexus5x-GPU-Adreno418-arm64-Release-All-Android.json b/infra/bots/recipes/perf.expected/Perf-Android-Clang-Nexus5x-GPU-Adreno418-arm64-Release-All-Android.json
index 7b4d49aa20..8edfc2c3d8 100644
--- a/infra/bots/recipes/perf.expected/Perf-Android-Clang-Nexus5x-GPU-Adreno418-arm64-Release-All-Android.json
+++ b/infra/bots/recipes/perf.expected/Perf-Android-Clang-Nexus5x-GPU-Adreno418-arm64-Release-All-Android.json
@@ -576,10 +576,10 @@
"cmd": [
"python",
"-u",
- "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\nmodel = sys.argv[2]\ntarget_percent = float(sys.argv[3])\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nif model == 'Nexus7':\n # Nexus7 claims to support 1300000, but only really allows 1200000\n available_freqs = [51000, 102000, 204000, 340000, 475000, 640000, 760000,\n 860000, 1000000, 1100000, 1200000]\nelse:\n # Temporary logging to get a sense of what devices have multiple cpus\n try:\n print subprocess.check_output([ADB, 'shell', 'cat ',\n '/sys/devices/system/cpu/cpu?/cpufreq/affected_cpus'])\n print subprocess.check_output([ADB, 'shell', 'cat ',\n '/sys/devices/system/cpu/cpu?/cpufreq/scaling_available_frequencies'])\n except Exception as e:\n print e.output.strip()\n # Most devices give a list of their available frequencies.\n available_freqs = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies'])\n\n # Check for message like '/system/bin/sh: file not found'\n if available_freqs and '/system/bin/sh' not in available_freqs:\n available_freqs = sorted(\n int(i) for i in available_freqs.strip().split())\n else:\n raise Exception('Could not get list of available frequencies: %s' %\n available_freqs)\n\nmaxfreq = available_freqs[-1]\ntarget = int(round(maxfreq * target_percent))\nfreq = maxfreq\nfor f in reversed(available_freqs):\n if f <= target:\n freq = f\n break\n\nprint 'Setting frequency to %d' % freq\n\nsubprocess.check_output([ADB, 'shell', 'echo \"userspace\" > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor'])\n# If scaling_max_freq is lower than our attempted setting, it won't take.\n# We must set min first, because if we try to set max to be less than min\n# (which sometimes happens after certain devices reboot) it returns a\n# perplexing permissions error.\nsubprocess.check_output([ADB, 'shell', 'echo 0 > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq'])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed' % freq])\ntime.sleep(5)\nactual_freq = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq']).strip()\nif actual_freq != str(freq):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_freq, freq))\n",
+ "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ncpu = int(sys.argv[2])\ngov = sys.argv[3]\n\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nsubprocess.check_output([ADB, 'shell', 'echo \"%s\" > '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])\nactual_gov = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()\nif actual_gov != str(gov):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_gov, gov))\n",
"/opt/infra-android/tools/adb",
- "Nexus5x",
- "0.6"
+ "0",
+ "powersave"
],
"env": {
"BUILDTYPE": "Release",
@@ -588,7 +588,7 @@
"SKIA_OUT": "[START_DIR]/out"
},
"infra_step": true,
- "name": "Scale CPU to 0.600000",
+ "name": "Set CPU 0's governor to powersave",
"timeout": 30,
"~followup_annotations": [
"@@@STEP_LOG_LINE@python.inline@@@@",
@@ -597,38 +597,115 @@
"@@@STEP_LOG_LINE@python.inline@import sys@@@",
"@@@STEP_LOG_LINE@python.inline@import time@@@",
"@@@STEP_LOG_LINE@python.inline@ADB = sys.argv[1]@@@",
- "@@@STEP_LOG_LINE@python.inline@model = sys.argv[2]@@@",
- "@@@STEP_LOG_LINE@python.inline@target_percent = float(sys.argv[3])@@@",
+ "@@@STEP_LOG_LINE@python.inline@cpu = int(sys.argv[2])@@@",
+ "@@@STEP_LOG_LINE@python.inline@gov = sys.argv[3]@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@log = subprocess.check_output([ADB, 'root'])@@@",
"@@@STEP_LOG_LINE@python.inline@# check for message like 'adbd cannot run as root in production builds'@@@",
"@@@STEP_LOG_LINE@python.inline@print log@@@",
"@@@STEP_LOG_LINE@python.inline@if 'cannot' in log:@@@",
"@@@STEP_LOG_LINE@python.inline@ raise Exception('adb root failed')@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@if model == 'Nexus7':@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Nexus7 claims to support 1300000, but only really allows 1200000@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = [51000, 102000, 204000, 340000, 475000, 640000, 760000,@@@",
- "@@@STEP_LOG_LINE@python.inline@ 860000, 1000000, 1100000, 1200000]@@@",
- "@@@STEP_LOG_LINE@python.inline@else:@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Temporary logging to get a sense of what devices have multiple cpus@@@",
- "@@@STEP_LOG_LINE@python.inline@ try:@@@",
- "@@@STEP_LOG_LINE@python.inline@ print subprocess.check_output([ADB, 'shell', 'cat ',@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu?/cpufreq/affected_cpus'])@@@",
- "@@@STEP_LOG_LINE@python.inline@ print subprocess.check_output([ADB, 'shell', 'cat ',@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu?/cpufreq/scaling_available_frequencies'])@@@",
- "@@@STEP_LOG_LINE@python.inline@ except Exception as e:@@@",
- "@@@STEP_LOG_LINE@python.inline@ print e.output.strip()@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Most devices give a list of their available frequencies.@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = subprocess.check_output([ADB, 'shell', 'cat '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies'])@@@",
+ "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo \"%s\" > '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])@@@",
+ "@@@STEP_LOG_LINE@python.inline@actual_gov = subprocess.check_output([ADB, 'shell', 'cat '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()@@@",
+ "@@@STEP_LOG_LINE@python.inline@if actual_gov != str(gov):@@@",
+ "@@@STEP_LOG_LINE@python.inline@ raise Exception('(actual, expected) (%s, %d)'@@@",
+ "@@@STEP_LOG_LINE@python.inline@ % (actual_gov, gov))@@@",
+ "@@@STEP_LOG_END@python.inline@@@"
+ ]
+ },
+ {
+ "cmd": [
+ "python",
+ "-u",
+ "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ncpu = int(sys.argv[2])\ngov = sys.argv[3]\n\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nsubprocess.check_output([ADB, 'shell', 'echo \"%s\" > '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])\nactual_gov = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()\nif actual_gov != str(gov):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_gov, gov))\n",
+ "/opt/infra-android/tools/adb",
+ "4",
+ "userspace"
+ ],
+ "env": {
+ "BUILDTYPE": "Release",
+ "CHROME_HEADLESS": "1",
+ "PATH": "<PATH>:RECIPE_PACKAGE_REPO[depot_tools]",
+ "SKIA_OUT": "[START_DIR]/out"
+ },
+ "infra_step": true,
+ "name": "Set CPU 4's governor to userspace",
+ "timeout": 30,
+ "~followup_annotations": [
"@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Check for message like '/system/bin/sh: file not found'@@@",
- "@@@STEP_LOG_LINE@python.inline@ if available_freqs and '/system/bin/sh' not in available_freqs:@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = sorted(@@@",
- "@@@STEP_LOG_LINE@python.inline@ int(i) for i in available_freqs.strip().split())@@@",
- "@@@STEP_LOG_LINE@python.inline@ else:@@@",
- "@@@STEP_LOG_LINE@python.inline@ raise Exception('Could not get list of available frequencies: %s' %@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs)@@@",
+ "@@@STEP_LOG_LINE@python.inline@import os@@@",
+ "@@@STEP_LOG_LINE@python.inline@import subprocess@@@",
+ "@@@STEP_LOG_LINE@python.inline@import sys@@@",
+ "@@@STEP_LOG_LINE@python.inline@import time@@@",
+ "@@@STEP_LOG_LINE@python.inline@ADB = sys.argv[1]@@@",
+ "@@@STEP_LOG_LINE@python.inline@cpu = int(sys.argv[2])@@@",
+ "@@@STEP_LOG_LINE@python.inline@gov = sys.argv[3]@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@log = subprocess.check_output([ADB, 'root'])@@@",
+ "@@@STEP_LOG_LINE@python.inline@# check for message like 'adbd cannot run as root in production builds'@@@",
+ "@@@STEP_LOG_LINE@python.inline@print log@@@",
+ "@@@STEP_LOG_LINE@python.inline@if 'cannot' in log:@@@",
+ "@@@STEP_LOG_LINE@python.inline@ raise Exception('adb root failed')@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo \"%s\" > '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])@@@",
+ "@@@STEP_LOG_LINE@python.inline@actual_gov = subprocess.check_output([ADB, 'shell', 'cat '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()@@@",
+ "@@@STEP_LOG_LINE@python.inline@if actual_gov != str(gov):@@@",
+ "@@@STEP_LOG_LINE@python.inline@ raise Exception('(actual, expected) (%s, %d)'@@@",
+ "@@@STEP_LOG_LINE@python.inline@ % (actual_gov, gov))@@@",
+ "@@@STEP_LOG_END@python.inline@@@"
+ ]
+ },
+ {
+ "cmd": [
+ "python",
+ "-u",
+ "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ntarget_percent = float(sys.argv[2])\ncpu = int(sys.argv[3])\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nroot = '/sys/devices/system/cpu/cpu%d/cpufreq' %cpu\n\n# All devices we test on give a list of their available frequencies.\navailable_freqs = subprocess.check_output([ADB, 'shell',\n 'cat %s/scaling_available_frequencies' % root])\n\n# Check for message like '/system/bin/sh: file not found'\nif available_freqs and '/system/bin/sh' not in available_freqs:\n available_freqs = sorted(\n int(i) for i in available_freqs.strip().split())\nelse:\n raise Exception('Could not get list of available frequencies: %s' %\n available_freqs)\n\nmaxfreq = available_freqs[-1]\ntarget = int(round(maxfreq * target_percent))\nfreq = maxfreq\nfor f in reversed(available_freqs):\n if f <= target:\n freq = f\n break\n\nprint 'Setting frequency to %d' % freq\n\n# If scaling_max_freq is lower than our attempted setting, it won't take.\n# We must set min first, because if we try to set max to be less than min\n# (which sometimes happens after certain devices reboot) it returns a\n# perplexing permissions error.\nsubprocess.check_output([ADB, 'shell', 'echo 0 > '\n '%s/scaling_min_freq' % root])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '%s/scaling_max_freq' % (freq, root)])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '%s/scaling_setspeed' % (freq, root)])\ntime.sleep(5)\nactual_freq = subprocess.check_output([ADB, 'shell', 'cat '\n '%s/scaling_cur_freq' % root]).strip()\nif actual_freq != str(freq):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_freq, freq))\n",
+ "/opt/infra-android/tools/adb",
+ "0.6",
+ "4"
+ ],
+ "env": {
+ "BUILDTYPE": "Release",
+ "CHROME_HEADLESS": "1",
+ "PATH": "<PATH>:RECIPE_PACKAGE_REPO[depot_tools]",
+ "SKIA_OUT": "[START_DIR]/out"
+ },
+ "infra_step": true,
+ "name": "Scale CPU 4 to 0.600000",
+ "timeout": 30,
+ "~followup_annotations": [
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@import os@@@",
+ "@@@STEP_LOG_LINE@python.inline@import subprocess@@@",
+ "@@@STEP_LOG_LINE@python.inline@import sys@@@",
+ "@@@STEP_LOG_LINE@python.inline@import time@@@",
+ "@@@STEP_LOG_LINE@python.inline@ADB = sys.argv[1]@@@",
+ "@@@STEP_LOG_LINE@python.inline@target_percent = float(sys.argv[2])@@@",
+ "@@@STEP_LOG_LINE@python.inline@cpu = int(sys.argv[3])@@@",
+ "@@@STEP_LOG_LINE@python.inline@log = subprocess.check_output([ADB, 'root'])@@@",
+ "@@@STEP_LOG_LINE@python.inline@# check for message like 'adbd cannot run as root in production builds'@@@",
+ "@@@STEP_LOG_LINE@python.inline@print log@@@",
+ "@@@STEP_LOG_LINE@python.inline@if 'cannot' in log:@@@",
+ "@@@STEP_LOG_LINE@python.inline@ raise Exception('adb root failed')@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@root = '/sys/devices/system/cpu/cpu%d/cpufreq' %cpu@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@# All devices we test on give a list of their available frequencies.@@@",
+ "@@@STEP_LOG_LINE@python.inline@available_freqs = subprocess.check_output([ADB, 'shell',@@@",
+ "@@@STEP_LOG_LINE@python.inline@ 'cat %s/scaling_available_frequencies' % root])@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@# Check for message like '/system/bin/sh: file not found'@@@",
+ "@@@STEP_LOG_LINE@python.inline@if available_freqs and '/system/bin/sh' not in available_freqs:@@@",
+ "@@@STEP_LOG_LINE@python.inline@ available_freqs = sorted(@@@",
+ "@@@STEP_LOG_LINE@python.inline@ int(i) for i in available_freqs.strip().split())@@@",
+ "@@@STEP_LOG_LINE@python.inline@else:@@@",
+ "@@@STEP_LOG_LINE@python.inline@ raise Exception('Could not get list of available frequencies: %s' %@@@",
+ "@@@STEP_LOG_LINE@python.inline@ available_freqs)@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@maxfreq = available_freqs[-1]@@@",
"@@@STEP_LOG_LINE@python.inline@target = int(round(maxfreq * target_percent))@@@",
@@ -640,21 +717,19 @@
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@print 'Setting frequency to %d' % freq@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo \"userspace\" > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor'])@@@",
"@@@STEP_LOG_LINE@python.inline@# If scaling_max_freq is lower than our attempted setting, it won't take.@@@",
"@@@STEP_LOG_LINE@python.inline@# We must set min first, because if we try to set max to be less than min@@@",
"@@@STEP_LOG_LINE@python.inline@# (which sometimes happens after certain devices reboot) it returns a@@@",
"@@@STEP_LOG_LINE@python.inline@# perplexing permissions error.@@@",
"@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo 0 > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq'])@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '%s/scaling_min_freq' % root])@@@",
"@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo %d > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '%s/scaling_max_freq' % (freq, root)])@@@",
"@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo %d > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed' % freq])@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '%s/scaling_setspeed' % (freq, root)])@@@",
"@@@STEP_LOG_LINE@python.inline@time.sleep(5)@@@",
"@@@STEP_LOG_LINE@python.inline@actual_freq = subprocess.check_output([ADB, 'shell', 'cat '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq']).strip()@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '%s/scaling_cur_freq' % root]).strip()@@@",
"@@@STEP_LOG_LINE@python.inline@if actual_freq != str(freq):@@@",
"@@@STEP_LOG_LINE@python.inline@ raise Exception('(actual, expected) (%s, %d)'@@@",
"@@@STEP_LOG_LINE@python.inline@ % (actual_freq, freq))@@@",
diff --git a/infra/bots/recipes/perf.expected/Perf-Android-Clang-Nexus7-CPU-Tegra3-arm-Release-All-Android.json b/infra/bots/recipes/perf.expected/Perf-Android-Clang-Nexus7-CPU-Tegra3-arm-Release-All-Android.json
index 63aecd576b..ec96a8de8e 100644
--- a/infra/bots/recipes/perf.expected/Perf-Android-Clang-Nexus7-CPU-Tegra3-arm-Release-All-Android.json
+++ b/infra/bots/recipes/perf.expected/Perf-Android-Clang-Nexus7-CPU-Tegra3-arm-Release-All-Android.json
@@ -576,10 +576,10 @@
"cmd": [
"python",
"-u",
- "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\nmodel = sys.argv[2]\ntarget_percent = float(sys.argv[3])\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nif model == 'Nexus7':\n # Nexus7 claims to support 1300000, but only really allows 1200000\n available_freqs = [51000, 102000, 204000, 340000, 475000, 640000, 760000,\n 860000, 1000000, 1100000, 1200000]\nelse:\n # Temporary logging to get a sense of what devices have multiple cpus\n try:\n print subprocess.check_output([ADB, 'shell', 'cat ',\n '/sys/devices/system/cpu/cpu?/cpufreq/affected_cpus'])\n print subprocess.check_output([ADB, 'shell', 'cat ',\n '/sys/devices/system/cpu/cpu?/cpufreq/scaling_available_frequencies'])\n except Exception as e:\n print e.output.strip()\n # Most devices give a list of their available frequencies.\n available_freqs = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies'])\n\n # Check for message like '/system/bin/sh: file not found'\n if available_freqs and '/system/bin/sh' not in available_freqs:\n available_freqs = sorted(\n int(i) for i in available_freqs.strip().split())\n else:\n raise Exception('Could not get list of available frequencies: %s' %\n available_freqs)\n\nmaxfreq = available_freqs[-1]\ntarget = int(round(maxfreq * target_percent))\nfreq = maxfreq\nfor f in reversed(available_freqs):\n if f <= target:\n freq = f\n break\n\nprint 'Setting frequency to %d' % freq\n\nsubprocess.check_output([ADB, 'shell', 'echo \"userspace\" > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor'])\n# If scaling_max_freq is lower than our attempted setting, it won't take.\n# We must set min first, because if we try to set max to be less than min\n# (which sometimes happens after certain devices reboot) it returns a\n# perplexing permissions error.\nsubprocess.check_output([ADB, 'shell', 'echo 0 > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq'])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed' % freq])\ntime.sleep(5)\nactual_freq = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq']).strip()\nif actual_freq != str(freq):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_freq, freq))\n",
+ "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ncpu = int(sys.argv[2])\ngov = sys.argv[3]\n\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nsubprocess.check_output([ADB, 'shell', 'echo \"%s\" > '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])\nactual_gov = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()\nif actual_gov != str(gov):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_gov, gov))\n",
"/usr/bin/adb.1.0.35",
- "Nexus7",
- "0.6"
+ "0",
+ "userspace"
],
"env": {
"BUILDTYPE": "Release",
@@ -588,7 +588,7 @@
"SKIA_OUT": "[START_DIR]/out"
},
"infra_step": true,
- "name": "Scale CPU to 0.600000",
+ "name": "Set CPU 0's governor to userspace",
"timeout": 30,
"~followup_annotations": [
"@@@STEP_LOG_LINE@python.inline@@@@",
@@ -597,38 +597,71 @@
"@@@STEP_LOG_LINE@python.inline@import sys@@@",
"@@@STEP_LOG_LINE@python.inline@import time@@@",
"@@@STEP_LOG_LINE@python.inline@ADB = sys.argv[1]@@@",
- "@@@STEP_LOG_LINE@python.inline@model = sys.argv[2]@@@",
- "@@@STEP_LOG_LINE@python.inline@target_percent = float(sys.argv[3])@@@",
+ "@@@STEP_LOG_LINE@python.inline@cpu = int(sys.argv[2])@@@",
+ "@@@STEP_LOG_LINE@python.inline@gov = sys.argv[3]@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@log = subprocess.check_output([ADB, 'root'])@@@",
"@@@STEP_LOG_LINE@python.inline@# check for message like 'adbd cannot run as root in production builds'@@@",
"@@@STEP_LOG_LINE@python.inline@print log@@@",
"@@@STEP_LOG_LINE@python.inline@if 'cannot' in log:@@@",
"@@@STEP_LOG_LINE@python.inline@ raise Exception('adb root failed')@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@if model == 'Nexus7':@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Nexus7 claims to support 1300000, but only really allows 1200000@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = [51000, 102000, 204000, 340000, 475000, 640000, 760000,@@@",
- "@@@STEP_LOG_LINE@python.inline@ 860000, 1000000, 1100000, 1200000]@@@",
- "@@@STEP_LOG_LINE@python.inline@else:@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Temporary logging to get a sense of what devices have multiple cpus@@@",
- "@@@STEP_LOG_LINE@python.inline@ try:@@@",
- "@@@STEP_LOG_LINE@python.inline@ print subprocess.check_output([ADB, 'shell', 'cat ',@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu?/cpufreq/affected_cpus'])@@@",
- "@@@STEP_LOG_LINE@python.inline@ print subprocess.check_output([ADB, 'shell', 'cat ',@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu?/cpufreq/scaling_available_frequencies'])@@@",
- "@@@STEP_LOG_LINE@python.inline@ except Exception as e:@@@",
- "@@@STEP_LOG_LINE@python.inline@ print e.output.strip()@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Most devices give a list of their available frequencies.@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = subprocess.check_output([ADB, 'shell', 'cat '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies'])@@@",
+ "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo \"%s\" > '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])@@@",
+ "@@@STEP_LOG_LINE@python.inline@actual_gov = subprocess.check_output([ADB, 'shell', 'cat '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()@@@",
+ "@@@STEP_LOG_LINE@python.inline@if actual_gov != str(gov):@@@",
+ "@@@STEP_LOG_LINE@python.inline@ raise Exception('(actual, expected) (%s, %d)'@@@",
+ "@@@STEP_LOG_LINE@python.inline@ % (actual_gov, gov))@@@",
+ "@@@STEP_LOG_END@python.inline@@@"
+ ]
+ },
+ {
+ "cmd": [
+ "python",
+ "-u",
+ "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ntarget_percent = float(sys.argv[2])\ncpu = int(sys.argv[3])\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nroot = '/sys/devices/system/cpu/cpu%d/cpufreq' %cpu\n\n# All devices we test on give a list of their available frequencies.\navailable_freqs = subprocess.check_output([ADB, 'shell',\n 'cat %s/scaling_available_frequencies' % root])\n\n# Check for message like '/system/bin/sh: file not found'\nif available_freqs and '/system/bin/sh' not in available_freqs:\n available_freqs = sorted(\n int(i) for i in available_freqs.strip().split())\nelse:\n raise Exception('Could not get list of available frequencies: %s' %\n available_freqs)\n\nmaxfreq = available_freqs[-1]\ntarget = int(round(maxfreq * target_percent))\nfreq = maxfreq\nfor f in reversed(available_freqs):\n if f <= target:\n freq = f\n break\n\nprint 'Setting frequency to %d' % freq\n\n# If scaling_max_freq is lower than our attempted setting, it won't take.\n# We must set min first, because if we try to set max to be less than min\n# (which sometimes happens after certain devices reboot) it returns a\n# perplexing permissions error.\nsubprocess.check_output([ADB, 'shell', 'echo 0 > '\n '%s/scaling_min_freq' % root])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '%s/scaling_max_freq' % (freq, root)])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '%s/scaling_setspeed' % (freq, root)])\ntime.sleep(5)\nactual_freq = subprocess.check_output([ADB, 'shell', 'cat '\n '%s/scaling_cur_freq' % root]).strip()\nif actual_freq != str(freq):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_freq, freq))\n",
+ "/usr/bin/adb.1.0.35",
+ "0.6",
+ "0"
+ ],
+ "env": {
+ "BUILDTYPE": "Release",
+ "CHROME_HEADLESS": "1",
+ "PATH": "<PATH>:RECIPE_PACKAGE_REPO[depot_tools]",
+ "SKIA_OUT": "[START_DIR]/out"
+ },
+ "infra_step": true,
+ "name": "Scale CPU 0 to 0.600000",
+ "timeout": 30,
+ "~followup_annotations": [
"@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Check for message like '/system/bin/sh: file not found'@@@",
- "@@@STEP_LOG_LINE@python.inline@ if available_freqs and '/system/bin/sh' not in available_freqs:@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = sorted(@@@",
- "@@@STEP_LOG_LINE@python.inline@ int(i) for i in available_freqs.strip().split())@@@",
- "@@@STEP_LOG_LINE@python.inline@ else:@@@",
- "@@@STEP_LOG_LINE@python.inline@ raise Exception('Could not get list of available frequencies: %s' %@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs)@@@",
+ "@@@STEP_LOG_LINE@python.inline@import os@@@",
+ "@@@STEP_LOG_LINE@python.inline@import subprocess@@@",
+ "@@@STEP_LOG_LINE@python.inline@import sys@@@",
+ "@@@STEP_LOG_LINE@python.inline@import time@@@",
+ "@@@STEP_LOG_LINE@python.inline@ADB = sys.argv[1]@@@",
+ "@@@STEP_LOG_LINE@python.inline@target_percent = float(sys.argv[2])@@@",
+ "@@@STEP_LOG_LINE@python.inline@cpu = int(sys.argv[3])@@@",
+ "@@@STEP_LOG_LINE@python.inline@log = subprocess.check_output([ADB, 'root'])@@@",
+ "@@@STEP_LOG_LINE@python.inline@# check for message like 'adbd cannot run as root in production builds'@@@",
+ "@@@STEP_LOG_LINE@python.inline@print log@@@",
+ "@@@STEP_LOG_LINE@python.inline@if 'cannot' in log:@@@",
+ "@@@STEP_LOG_LINE@python.inline@ raise Exception('adb root failed')@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@root = '/sys/devices/system/cpu/cpu%d/cpufreq' %cpu@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@# All devices we test on give a list of their available frequencies.@@@",
+ "@@@STEP_LOG_LINE@python.inline@available_freqs = subprocess.check_output([ADB, 'shell',@@@",
+ "@@@STEP_LOG_LINE@python.inline@ 'cat %s/scaling_available_frequencies' % root])@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@# Check for message like '/system/bin/sh: file not found'@@@",
+ "@@@STEP_LOG_LINE@python.inline@if available_freqs and '/system/bin/sh' not in available_freqs:@@@",
+ "@@@STEP_LOG_LINE@python.inline@ available_freqs = sorted(@@@",
+ "@@@STEP_LOG_LINE@python.inline@ int(i) for i in available_freqs.strip().split())@@@",
+ "@@@STEP_LOG_LINE@python.inline@else:@@@",
+ "@@@STEP_LOG_LINE@python.inline@ raise Exception('Could not get list of available frequencies: %s' %@@@",
+ "@@@STEP_LOG_LINE@python.inline@ available_freqs)@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@maxfreq = available_freqs[-1]@@@",
"@@@STEP_LOG_LINE@python.inline@target = int(round(maxfreq * target_percent))@@@",
@@ -640,21 +673,19 @@
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@print 'Setting frequency to %d' % freq@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo \"userspace\" > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor'])@@@",
"@@@STEP_LOG_LINE@python.inline@# If scaling_max_freq is lower than our attempted setting, it won't take.@@@",
"@@@STEP_LOG_LINE@python.inline@# We must set min first, because if we try to set max to be less than min@@@",
"@@@STEP_LOG_LINE@python.inline@# (which sometimes happens after certain devices reboot) it returns a@@@",
"@@@STEP_LOG_LINE@python.inline@# perplexing permissions error.@@@",
"@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo 0 > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq'])@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '%s/scaling_min_freq' % root])@@@",
"@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo %d > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '%s/scaling_max_freq' % (freq, root)])@@@",
"@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo %d > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed' % freq])@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '%s/scaling_setspeed' % (freq, root)])@@@",
"@@@STEP_LOG_LINE@python.inline@time.sleep(5)@@@",
"@@@STEP_LOG_LINE@python.inline@actual_freq = subprocess.check_output([ADB, 'shell', 'cat '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq']).strip()@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '%s/scaling_cur_freq' % root]).strip()@@@",
"@@@STEP_LOG_LINE@python.inline@if actual_freq != str(freq):@@@",
"@@@STEP_LOG_LINE@python.inline@ raise Exception('(actual, expected) (%s, %d)'@@@",
"@@@STEP_LOG_LINE@python.inline@ % (actual_freq, freq))@@@",
diff --git a/infra/bots/recipes/perf.expected/Perf-Android-Clang-Nexus7-GPU-Tegra3-arm-Release-All-Android.json b/infra/bots/recipes/perf.expected/Perf-Android-Clang-Nexus7-GPU-Tegra3-arm-Release-All-Android.json
index 54914b7ebc..45083312ef 100644
--- a/infra/bots/recipes/perf.expected/Perf-Android-Clang-Nexus7-GPU-Tegra3-arm-Release-All-Android.json
+++ b/infra/bots/recipes/perf.expected/Perf-Android-Clang-Nexus7-GPU-Tegra3-arm-Release-All-Android.json
@@ -576,10 +576,10 @@
"cmd": [
"python",
"-u",
- "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\nmodel = sys.argv[2]\ntarget_percent = float(sys.argv[3])\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nif model == 'Nexus7':\n # Nexus7 claims to support 1300000, but only really allows 1200000\n available_freqs = [51000, 102000, 204000, 340000, 475000, 640000, 760000,\n 860000, 1000000, 1100000, 1200000]\nelse:\n # Temporary logging to get a sense of what devices have multiple cpus\n try:\n print subprocess.check_output([ADB, 'shell', 'cat ',\n '/sys/devices/system/cpu/cpu?/cpufreq/affected_cpus'])\n print subprocess.check_output([ADB, 'shell', 'cat ',\n '/sys/devices/system/cpu/cpu?/cpufreq/scaling_available_frequencies'])\n except Exception as e:\n print e.output.strip()\n # Most devices give a list of their available frequencies.\n available_freqs = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies'])\n\n # Check for message like '/system/bin/sh: file not found'\n if available_freqs and '/system/bin/sh' not in available_freqs:\n available_freqs = sorted(\n int(i) for i in available_freqs.strip().split())\n else:\n raise Exception('Could not get list of available frequencies: %s' %\n available_freqs)\n\nmaxfreq = available_freqs[-1]\ntarget = int(round(maxfreq * target_percent))\nfreq = maxfreq\nfor f in reversed(available_freqs):\n if f <= target:\n freq = f\n break\n\nprint 'Setting frequency to %d' % freq\n\nsubprocess.check_output([ADB, 'shell', 'echo \"userspace\" > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor'])\n# If scaling_max_freq is lower than our attempted setting, it won't take.\n# We must set min first, because if we try to set max to be less than min\n# (which sometimes happens after certain devices reboot) it returns a\n# perplexing permissions error.\nsubprocess.check_output([ADB, 'shell', 'echo 0 > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq'])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed' % freq])\ntime.sleep(5)\nactual_freq = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq']).strip()\nif actual_freq != str(freq):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_freq, freq))\n",
+ "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ncpu = int(sys.argv[2])\ngov = sys.argv[3]\n\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nsubprocess.check_output([ADB, 'shell', 'echo \"%s\" > '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])\nactual_gov = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()\nif actual_gov != str(gov):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_gov, gov))\n",
"/usr/bin/adb.1.0.35",
- "Nexus7",
- "0.6"
+ "0",
+ "userspace"
],
"env": {
"BUILDTYPE": "Release",
@@ -588,7 +588,7 @@
"SKIA_OUT": "[START_DIR]/out"
},
"infra_step": true,
- "name": "Scale CPU to 0.600000",
+ "name": "Set CPU 0's governor to userspace",
"timeout": 30,
"~followup_annotations": [
"@@@STEP_LOG_LINE@python.inline@@@@",
@@ -597,38 +597,71 @@
"@@@STEP_LOG_LINE@python.inline@import sys@@@",
"@@@STEP_LOG_LINE@python.inline@import time@@@",
"@@@STEP_LOG_LINE@python.inline@ADB = sys.argv[1]@@@",
- "@@@STEP_LOG_LINE@python.inline@model = sys.argv[2]@@@",
- "@@@STEP_LOG_LINE@python.inline@target_percent = float(sys.argv[3])@@@",
+ "@@@STEP_LOG_LINE@python.inline@cpu = int(sys.argv[2])@@@",
+ "@@@STEP_LOG_LINE@python.inline@gov = sys.argv[3]@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@log = subprocess.check_output([ADB, 'root'])@@@",
"@@@STEP_LOG_LINE@python.inline@# check for message like 'adbd cannot run as root in production builds'@@@",
"@@@STEP_LOG_LINE@python.inline@print log@@@",
"@@@STEP_LOG_LINE@python.inline@if 'cannot' in log:@@@",
"@@@STEP_LOG_LINE@python.inline@ raise Exception('adb root failed')@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@if model == 'Nexus7':@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Nexus7 claims to support 1300000, but only really allows 1200000@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = [51000, 102000, 204000, 340000, 475000, 640000, 760000,@@@",
- "@@@STEP_LOG_LINE@python.inline@ 860000, 1000000, 1100000, 1200000]@@@",
- "@@@STEP_LOG_LINE@python.inline@else:@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Temporary logging to get a sense of what devices have multiple cpus@@@",
- "@@@STEP_LOG_LINE@python.inline@ try:@@@",
- "@@@STEP_LOG_LINE@python.inline@ print subprocess.check_output([ADB, 'shell', 'cat ',@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu?/cpufreq/affected_cpus'])@@@",
- "@@@STEP_LOG_LINE@python.inline@ print subprocess.check_output([ADB, 'shell', 'cat ',@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu?/cpufreq/scaling_available_frequencies'])@@@",
- "@@@STEP_LOG_LINE@python.inline@ except Exception as e:@@@",
- "@@@STEP_LOG_LINE@python.inline@ print e.output.strip()@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Most devices give a list of their available frequencies.@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = subprocess.check_output([ADB, 'shell', 'cat '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies'])@@@",
+ "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo \"%s\" > '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])@@@",
+ "@@@STEP_LOG_LINE@python.inline@actual_gov = subprocess.check_output([ADB, 'shell', 'cat '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()@@@",
+ "@@@STEP_LOG_LINE@python.inline@if actual_gov != str(gov):@@@",
+ "@@@STEP_LOG_LINE@python.inline@ raise Exception('(actual, expected) (%s, %d)'@@@",
+ "@@@STEP_LOG_LINE@python.inline@ % (actual_gov, gov))@@@",
+ "@@@STEP_LOG_END@python.inline@@@"
+ ]
+ },
+ {
+ "cmd": [
+ "python",
+ "-u",
+ "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ntarget_percent = float(sys.argv[2])\ncpu = int(sys.argv[3])\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nroot = '/sys/devices/system/cpu/cpu%d/cpufreq' %cpu\n\n# All devices we test on give a list of their available frequencies.\navailable_freqs = subprocess.check_output([ADB, 'shell',\n 'cat %s/scaling_available_frequencies' % root])\n\n# Check for message like '/system/bin/sh: file not found'\nif available_freqs and '/system/bin/sh' not in available_freqs:\n available_freqs = sorted(\n int(i) for i in available_freqs.strip().split())\nelse:\n raise Exception('Could not get list of available frequencies: %s' %\n available_freqs)\n\nmaxfreq = available_freqs[-1]\ntarget = int(round(maxfreq * target_percent))\nfreq = maxfreq\nfor f in reversed(available_freqs):\n if f <= target:\n freq = f\n break\n\nprint 'Setting frequency to %d' % freq\n\n# If scaling_max_freq is lower than our attempted setting, it won't take.\n# We must set min first, because if we try to set max to be less than min\n# (which sometimes happens after certain devices reboot) it returns a\n# perplexing permissions error.\nsubprocess.check_output([ADB, 'shell', 'echo 0 > '\n '%s/scaling_min_freq' % root])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '%s/scaling_max_freq' % (freq, root)])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '%s/scaling_setspeed' % (freq, root)])\ntime.sleep(5)\nactual_freq = subprocess.check_output([ADB, 'shell', 'cat '\n '%s/scaling_cur_freq' % root]).strip()\nif actual_freq != str(freq):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_freq, freq))\n",
+ "/usr/bin/adb.1.0.35",
+ "0.6",
+ "0"
+ ],
+ "env": {
+ "BUILDTYPE": "Release",
+ "CHROME_HEADLESS": "1",
+ "PATH": "<PATH>:RECIPE_PACKAGE_REPO[depot_tools]",
+ "SKIA_OUT": "[START_DIR]/out"
+ },
+ "infra_step": true,
+ "name": "Scale CPU 0 to 0.600000",
+ "timeout": 30,
+ "~followup_annotations": [
"@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Check for message like '/system/bin/sh: file not found'@@@",
- "@@@STEP_LOG_LINE@python.inline@ if available_freqs and '/system/bin/sh' not in available_freqs:@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = sorted(@@@",
- "@@@STEP_LOG_LINE@python.inline@ int(i) for i in available_freqs.strip().split())@@@",
- "@@@STEP_LOG_LINE@python.inline@ else:@@@",
- "@@@STEP_LOG_LINE@python.inline@ raise Exception('Could not get list of available frequencies: %s' %@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs)@@@",
+ "@@@STEP_LOG_LINE@python.inline@import os@@@",
+ "@@@STEP_LOG_LINE@python.inline@import subprocess@@@",
+ "@@@STEP_LOG_LINE@python.inline@import sys@@@",
+ "@@@STEP_LOG_LINE@python.inline@import time@@@",
+ "@@@STEP_LOG_LINE@python.inline@ADB = sys.argv[1]@@@",
+ "@@@STEP_LOG_LINE@python.inline@target_percent = float(sys.argv[2])@@@",
+ "@@@STEP_LOG_LINE@python.inline@cpu = int(sys.argv[3])@@@",
+ "@@@STEP_LOG_LINE@python.inline@log = subprocess.check_output([ADB, 'root'])@@@",
+ "@@@STEP_LOG_LINE@python.inline@# check for message like 'adbd cannot run as root in production builds'@@@",
+ "@@@STEP_LOG_LINE@python.inline@print log@@@",
+ "@@@STEP_LOG_LINE@python.inline@if 'cannot' in log:@@@",
+ "@@@STEP_LOG_LINE@python.inline@ raise Exception('adb root failed')@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@root = '/sys/devices/system/cpu/cpu%d/cpufreq' %cpu@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@# All devices we test on give a list of their available frequencies.@@@",
+ "@@@STEP_LOG_LINE@python.inline@available_freqs = subprocess.check_output([ADB, 'shell',@@@",
+ "@@@STEP_LOG_LINE@python.inline@ 'cat %s/scaling_available_frequencies' % root])@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@# Check for message like '/system/bin/sh: file not found'@@@",
+ "@@@STEP_LOG_LINE@python.inline@if available_freqs and '/system/bin/sh' not in available_freqs:@@@",
+ "@@@STEP_LOG_LINE@python.inline@ available_freqs = sorted(@@@",
+ "@@@STEP_LOG_LINE@python.inline@ int(i) for i in available_freqs.strip().split())@@@",
+ "@@@STEP_LOG_LINE@python.inline@else:@@@",
+ "@@@STEP_LOG_LINE@python.inline@ raise Exception('Could not get list of available frequencies: %s' %@@@",
+ "@@@STEP_LOG_LINE@python.inline@ available_freqs)@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@maxfreq = available_freqs[-1]@@@",
"@@@STEP_LOG_LINE@python.inline@target = int(round(maxfreq * target_percent))@@@",
@@ -640,21 +673,19 @@
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@print 'Setting frequency to %d' % freq@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo \"userspace\" > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor'])@@@",
"@@@STEP_LOG_LINE@python.inline@# If scaling_max_freq is lower than our attempted setting, it won't take.@@@",
"@@@STEP_LOG_LINE@python.inline@# We must set min first, because if we try to set max to be less than min@@@",
"@@@STEP_LOG_LINE@python.inline@# (which sometimes happens after certain devices reboot) it returns a@@@",
"@@@STEP_LOG_LINE@python.inline@# perplexing permissions error.@@@",
"@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo 0 > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq'])@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '%s/scaling_min_freq' % root])@@@",
"@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo %d > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '%s/scaling_max_freq' % (freq, root)])@@@",
"@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo %d > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed' % freq])@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '%s/scaling_setspeed' % (freq, root)])@@@",
"@@@STEP_LOG_LINE@python.inline@time.sleep(5)@@@",
"@@@STEP_LOG_LINE@python.inline@actual_freq = subprocess.check_output([ADB, 'shell', 'cat '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq']).strip()@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '%s/scaling_cur_freq' % root]).strip()@@@",
"@@@STEP_LOG_LINE@python.inline@if actual_freq != str(freq):@@@",
"@@@STEP_LOG_LINE@python.inline@ raise Exception('(actual, expected) (%s, %d)'@@@",
"@@@STEP_LOG_LINE@python.inline@ % (actual_freq, freq))@@@",
diff --git a/infra/bots/recipes/perf.expected/Perf-Android-Clang-NexusPlayer-GPU-PowerVR-x86-Release-All-Android.json b/infra/bots/recipes/perf.expected/Perf-Android-Clang-NexusPlayer-GPU-PowerVR-x86-Release-All-Android.json
index d1a3b6e76a..693e700327 100644
--- a/infra/bots/recipes/perf.expected/Perf-Android-Clang-NexusPlayer-GPU-PowerVR-x86-Release-All-Android.json
+++ b/infra/bots/recipes/perf.expected/Perf-Android-Clang-NexusPlayer-GPU-PowerVR-x86-Release-All-Android.json
@@ -576,10 +576,10 @@
"cmd": [
"python",
"-u",
- "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\nmodel = sys.argv[2]\ntarget_percent = float(sys.argv[3])\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nif model == 'Nexus7':\n # Nexus7 claims to support 1300000, but only really allows 1200000\n available_freqs = [51000, 102000, 204000, 340000, 475000, 640000, 760000,\n 860000, 1000000, 1100000, 1200000]\nelse:\n # Temporary logging to get a sense of what devices have multiple cpus\n try:\n print subprocess.check_output([ADB, 'shell', 'cat ',\n '/sys/devices/system/cpu/cpu?/cpufreq/affected_cpus'])\n print subprocess.check_output([ADB, 'shell', 'cat ',\n '/sys/devices/system/cpu/cpu?/cpufreq/scaling_available_frequencies'])\n except Exception as e:\n print e.output.strip()\n # Most devices give a list of their available frequencies.\n available_freqs = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies'])\n\n # Check for message like '/system/bin/sh: file not found'\n if available_freqs and '/system/bin/sh' not in available_freqs:\n available_freqs = sorted(\n int(i) for i in available_freqs.strip().split())\n else:\n raise Exception('Could not get list of available frequencies: %s' %\n available_freqs)\n\nmaxfreq = available_freqs[-1]\ntarget = int(round(maxfreq * target_percent))\nfreq = maxfreq\nfor f in reversed(available_freqs):\n if f <= target:\n freq = f\n break\n\nprint 'Setting frequency to %d' % freq\n\nsubprocess.check_output([ADB, 'shell', 'echo \"userspace\" > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor'])\n# If scaling_max_freq is lower than our attempted setting, it won't take.\n# We must set min first, because if we try to set max to be less than min\n# (which sometimes happens after certain devices reboot) it returns a\n# perplexing permissions error.\nsubprocess.check_output([ADB, 'shell', 'echo 0 > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq'])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed' % freq])\ntime.sleep(5)\nactual_freq = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq']).strip()\nif actual_freq != str(freq):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_freq, freq))\n",
+ "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ncpu = int(sys.argv[2])\ngov = sys.argv[3]\n\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nsubprocess.check_output([ADB, 'shell', 'echo \"%s\" > '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])\nactual_gov = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()\nif actual_gov != str(gov):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_gov, gov))\n",
"/usr/bin/adb.1.0.35",
- "NexusPlayer",
- "0.6"
+ "0",
+ "powersave"
],
"env": {
"BUILDTYPE": "Release",
@@ -588,7 +588,7 @@
"SKIA_OUT": "[START_DIR]/out"
},
"infra_step": true,
- "name": "Scale CPU to 0.600000",
+ "name": "Set CPU 0's governor to powersave",
"timeout": 30,
"~followup_annotations": [
"@@@STEP_LOG_LINE@python.inline@@@@",
@@ -597,38 +597,115 @@
"@@@STEP_LOG_LINE@python.inline@import sys@@@",
"@@@STEP_LOG_LINE@python.inline@import time@@@",
"@@@STEP_LOG_LINE@python.inline@ADB = sys.argv[1]@@@",
- "@@@STEP_LOG_LINE@python.inline@model = sys.argv[2]@@@",
- "@@@STEP_LOG_LINE@python.inline@target_percent = float(sys.argv[3])@@@",
+ "@@@STEP_LOG_LINE@python.inline@cpu = int(sys.argv[2])@@@",
+ "@@@STEP_LOG_LINE@python.inline@gov = sys.argv[3]@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@log = subprocess.check_output([ADB, 'root'])@@@",
"@@@STEP_LOG_LINE@python.inline@# check for message like 'adbd cannot run as root in production builds'@@@",
"@@@STEP_LOG_LINE@python.inline@print log@@@",
"@@@STEP_LOG_LINE@python.inline@if 'cannot' in log:@@@",
"@@@STEP_LOG_LINE@python.inline@ raise Exception('adb root failed')@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@if model == 'Nexus7':@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Nexus7 claims to support 1300000, but only really allows 1200000@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = [51000, 102000, 204000, 340000, 475000, 640000, 760000,@@@",
- "@@@STEP_LOG_LINE@python.inline@ 860000, 1000000, 1100000, 1200000]@@@",
- "@@@STEP_LOG_LINE@python.inline@else:@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Temporary logging to get a sense of what devices have multiple cpus@@@",
- "@@@STEP_LOG_LINE@python.inline@ try:@@@",
- "@@@STEP_LOG_LINE@python.inline@ print subprocess.check_output([ADB, 'shell', 'cat ',@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu?/cpufreq/affected_cpus'])@@@",
- "@@@STEP_LOG_LINE@python.inline@ print subprocess.check_output([ADB, 'shell', 'cat ',@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu?/cpufreq/scaling_available_frequencies'])@@@",
- "@@@STEP_LOG_LINE@python.inline@ except Exception as e:@@@",
- "@@@STEP_LOG_LINE@python.inline@ print e.output.strip()@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Most devices give a list of their available frequencies.@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = subprocess.check_output([ADB, 'shell', 'cat '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies'])@@@",
+ "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo \"%s\" > '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])@@@",
+ "@@@STEP_LOG_LINE@python.inline@actual_gov = subprocess.check_output([ADB, 'shell', 'cat '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()@@@",
+ "@@@STEP_LOG_LINE@python.inline@if actual_gov != str(gov):@@@",
+ "@@@STEP_LOG_LINE@python.inline@ raise Exception('(actual, expected) (%s, %d)'@@@",
+ "@@@STEP_LOG_LINE@python.inline@ % (actual_gov, gov))@@@",
+ "@@@STEP_LOG_END@python.inline@@@"
+ ]
+ },
+ {
+ "cmd": [
+ "python",
+ "-u",
+ "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ncpu = int(sys.argv[2])\ngov = sys.argv[3]\n\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nsubprocess.check_output([ADB, 'shell', 'echo \"%s\" > '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])\nactual_gov = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()\nif actual_gov != str(gov):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_gov, gov))\n",
+ "/usr/bin/adb.1.0.35",
+ "2",
+ "userspace"
+ ],
+ "env": {
+ "BUILDTYPE": "Release",
+ "CHROME_HEADLESS": "1",
+ "PATH": "<PATH>:RECIPE_PACKAGE_REPO[depot_tools]",
+ "SKIA_OUT": "[START_DIR]/out"
+ },
+ "infra_step": true,
+ "name": "Set CPU 2's governor to userspace",
+ "timeout": 30,
+ "~followup_annotations": [
"@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Check for message like '/system/bin/sh: file not found'@@@",
- "@@@STEP_LOG_LINE@python.inline@ if available_freqs and '/system/bin/sh' not in available_freqs:@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = sorted(@@@",
- "@@@STEP_LOG_LINE@python.inline@ int(i) for i in available_freqs.strip().split())@@@",
- "@@@STEP_LOG_LINE@python.inline@ else:@@@",
- "@@@STEP_LOG_LINE@python.inline@ raise Exception('Could not get list of available frequencies: %s' %@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs)@@@",
+ "@@@STEP_LOG_LINE@python.inline@import os@@@",
+ "@@@STEP_LOG_LINE@python.inline@import subprocess@@@",
+ "@@@STEP_LOG_LINE@python.inline@import sys@@@",
+ "@@@STEP_LOG_LINE@python.inline@import time@@@",
+ "@@@STEP_LOG_LINE@python.inline@ADB = sys.argv[1]@@@",
+ "@@@STEP_LOG_LINE@python.inline@cpu = int(sys.argv[2])@@@",
+ "@@@STEP_LOG_LINE@python.inline@gov = sys.argv[3]@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@log = subprocess.check_output([ADB, 'root'])@@@",
+ "@@@STEP_LOG_LINE@python.inline@# check for message like 'adbd cannot run as root in production builds'@@@",
+ "@@@STEP_LOG_LINE@python.inline@print log@@@",
+ "@@@STEP_LOG_LINE@python.inline@if 'cannot' in log:@@@",
+ "@@@STEP_LOG_LINE@python.inline@ raise Exception('adb root failed')@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo \"%s\" > '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])@@@",
+ "@@@STEP_LOG_LINE@python.inline@actual_gov = subprocess.check_output([ADB, 'shell', 'cat '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()@@@",
+ "@@@STEP_LOG_LINE@python.inline@if actual_gov != str(gov):@@@",
+ "@@@STEP_LOG_LINE@python.inline@ raise Exception('(actual, expected) (%s, %d)'@@@",
+ "@@@STEP_LOG_LINE@python.inline@ % (actual_gov, gov))@@@",
+ "@@@STEP_LOG_END@python.inline@@@"
+ ]
+ },
+ {
+ "cmd": [
+ "python",
+ "-u",
+ "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ntarget_percent = float(sys.argv[2])\ncpu = int(sys.argv[3])\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nroot = '/sys/devices/system/cpu/cpu%d/cpufreq' %cpu\n\n# All devices we test on give a list of their available frequencies.\navailable_freqs = subprocess.check_output([ADB, 'shell',\n 'cat %s/scaling_available_frequencies' % root])\n\n# Check for message like '/system/bin/sh: file not found'\nif available_freqs and '/system/bin/sh' not in available_freqs:\n available_freqs = sorted(\n int(i) for i in available_freqs.strip().split())\nelse:\n raise Exception('Could not get list of available frequencies: %s' %\n available_freqs)\n\nmaxfreq = available_freqs[-1]\ntarget = int(round(maxfreq * target_percent))\nfreq = maxfreq\nfor f in reversed(available_freqs):\n if f <= target:\n freq = f\n break\n\nprint 'Setting frequency to %d' % freq\n\n# If scaling_max_freq is lower than our attempted setting, it won't take.\n# We must set min first, because if we try to set max to be less than min\n# (which sometimes happens after certain devices reboot) it returns a\n# perplexing permissions error.\nsubprocess.check_output([ADB, 'shell', 'echo 0 > '\n '%s/scaling_min_freq' % root])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '%s/scaling_max_freq' % (freq, root)])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '%s/scaling_setspeed' % (freq, root)])\ntime.sleep(5)\nactual_freq = subprocess.check_output([ADB, 'shell', 'cat '\n '%s/scaling_cur_freq' % root]).strip()\nif actual_freq != str(freq):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_freq, freq))\n",
+ "/usr/bin/adb.1.0.35",
+ "0.6",
+ "2"
+ ],
+ "env": {
+ "BUILDTYPE": "Release",
+ "CHROME_HEADLESS": "1",
+ "PATH": "<PATH>:RECIPE_PACKAGE_REPO[depot_tools]",
+ "SKIA_OUT": "[START_DIR]/out"
+ },
+ "infra_step": true,
+ "name": "Scale CPU 2 to 0.600000",
+ "timeout": 30,
+ "~followup_annotations": [
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@import os@@@",
+ "@@@STEP_LOG_LINE@python.inline@import subprocess@@@",
+ "@@@STEP_LOG_LINE@python.inline@import sys@@@",
+ "@@@STEP_LOG_LINE@python.inline@import time@@@",
+ "@@@STEP_LOG_LINE@python.inline@ADB = sys.argv[1]@@@",
+ "@@@STEP_LOG_LINE@python.inline@target_percent = float(sys.argv[2])@@@",
+ "@@@STEP_LOG_LINE@python.inline@cpu = int(sys.argv[3])@@@",
+ "@@@STEP_LOG_LINE@python.inline@log = subprocess.check_output([ADB, 'root'])@@@",
+ "@@@STEP_LOG_LINE@python.inline@# check for message like 'adbd cannot run as root in production builds'@@@",
+ "@@@STEP_LOG_LINE@python.inline@print log@@@",
+ "@@@STEP_LOG_LINE@python.inline@if 'cannot' in log:@@@",
+ "@@@STEP_LOG_LINE@python.inline@ raise Exception('adb root failed')@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@root = '/sys/devices/system/cpu/cpu%d/cpufreq' %cpu@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@# All devices we test on give a list of their available frequencies.@@@",
+ "@@@STEP_LOG_LINE@python.inline@available_freqs = subprocess.check_output([ADB, 'shell',@@@",
+ "@@@STEP_LOG_LINE@python.inline@ 'cat %s/scaling_available_frequencies' % root])@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@# Check for message like '/system/bin/sh: file not found'@@@",
+ "@@@STEP_LOG_LINE@python.inline@if available_freqs and '/system/bin/sh' not in available_freqs:@@@",
+ "@@@STEP_LOG_LINE@python.inline@ available_freqs = sorted(@@@",
+ "@@@STEP_LOG_LINE@python.inline@ int(i) for i in available_freqs.strip().split())@@@",
+ "@@@STEP_LOG_LINE@python.inline@else:@@@",
+ "@@@STEP_LOG_LINE@python.inline@ raise Exception('Could not get list of available frequencies: %s' %@@@",
+ "@@@STEP_LOG_LINE@python.inline@ available_freqs)@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@maxfreq = available_freqs[-1]@@@",
"@@@STEP_LOG_LINE@python.inline@target = int(round(maxfreq * target_percent))@@@",
@@ -640,21 +717,19 @@
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@print 'Setting frequency to %d' % freq@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo \"userspace\" > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor'])@@@",
"@@@STEP_LOG_LINE@python.inline@# If scaling_max_freq is lower than our attempted setting, it won't take.@@@",
"@@@STEP_LOG_LINE@python.inline@# We must set min first, because if we try to set max to be less than min@@@",
"@@@STEP_LOG_LINE@python.inline@# (which sometimes happens after certain devices reboot) it returns a@@@",
"@@@STEP_LOG_LINE@python.inline@# perplexing permissions error.@@@",
"@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo 0 > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq'])@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '%s/scaling_min_freq' % root])@@@",
"@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo %d > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '%s/scaling_max_freq' % (freq, root)])@@@",
"@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo %d > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed' % freq])@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '%s/scaling_setspeed' % (freq, root)])@@@",
"@@@STEP_LOG_LINE@python.inline@time.sleep(5)@@@",
"@@@STEP_LOG_LINE@python.inline@actual_freq = subprocess.check_output([ADB, 'shell', 'cat '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq']).strip()@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '%s/scaling_cur_freq' % root]).strip()@@@",
"@@@STEP_LOG_LINE@python.inline@if actual_freq != str(freq):@@@",
"@@@STEP_LOG_LINE@python.inline@ raise Exception('(actual, expected) (%s, %d)'@@@",
"@@@STEP_LOG_LINE@python.inline@ % (actual_freq, freq))@@@",
diff --git a/infra/bots/recipes/perf.expected/Perf-Android-Clang-NexusPlayer-GPU-PowerVR-x86-Release-All-Android_Vulkan.json b/infra/bots/recipes/perf.expected/Perf-Android-Clang-NexusPlayer-GPU-PowerVR-x86-Release-All-Android_Vulkan.json
index 1f97944810..aa3242666e 100644
--- a/infra/bots/recipes/perf.expected/Perf-Android-Clang-NexusPlayer-GPU-PowerVR-x86-Release-All-Android_Vulkan.json
+++ b/infra/bots/recipes/perf.expected/Perf-Android-Clang-NexusPlayer-GPU-PowerVR-x86-Release-All-Android_Vulkan.json
@@ -576,10 +576,10 @@
"cmd": [
"python",
"-u",
- "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\nmodel = sys.argv[2]\ntarget_percent = float(sys.argv[3])\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nif model == 'Nexus7':\n # Nexus7 claims to support 1300000, but only really allows 1200000\n available_freqs = [51000, 102000, 204000, 340000, 475000, 640000, 760000,\n 860000, 1000000, 1100000, 1200000]\nelse:\n # Temporary logging to get a sense of what devices have multiple cpus\n try:\n print subprocess.check_output([ADB, 'shell', 'cat ',\n '/sys/devices/system/cpu/cpu?/cpufreq/affected_cpus'])\n print subprocess.check_output([ADB, 'shell', 'cat ',\n '/sys/devices/system/cpu/cpu?/cpufreq/scaling_available_frequencies'])\n except Exception as e:\n print e.output.strip()\n # Most devices give a list of their available frequencies.\n available_freqs = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies'])\n\n # Check for message like '/system/bin/sh: file not found'\n if available_freqs and '/system/bin/sh' not in available_freqs:\n available_freqs = sorted(\n int(i) for i in available_freqs.strip().split())\n else:\n raise Exception('Could not get list of available frequencies: %s' %\n available_freqs)\n\nmaxfreq = available_freqs[-1]\ntarget = int(round(maxfreq * target_percent))\nfreq = maxfreq\nfor f in reversed(available_freqs):\n if f <= target:\n freq = f\n break\n\nprint 'Setting frequency to %d' % freq\n\nsubprocess.check_output([ADB, 'shell', 'echo \"userspace\" > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor'])\n# If scaling_max_freq is lower than our attempted setting, it won't take.\n# We must set min first, because if we try to set max to be less than min\n# (which sometimes happens after certain devices reboot) it returns a\n# perplexing permissions error.\nsubprocess.check_output([ADB, 'shell', 'echo 0 > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq'])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed' % freq])\ntime.sleep(5)\nactual_freq = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq']).strip()\nif actual_freq != str(freq):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_freq, freq))\n",
+ "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ncpu = int(sys.argv[2])\ngov = sys.argv[3]\n\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nsubprocess.check_output([ADB, 'shell', 'echo \"%s\" > '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])\nactual_gov = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()\nif actual_gov != str(gov):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_gov, gov))\n",
"/usr/bin/adb.1.0.35",
- "NexusPlayer",
- "0.6"
+ "0",
+ "powersave"
],
"env": {
"BUILDTYPE": "Release",
@@ -588,7 +588,7 @@
"SKIA_OUT": "[START_DIR]/out"
},
"infra_step": true,
- "name": "Scale CPU to 0.600000",
+ "name": "Set CPU 0's governor to powersave",
"timeout": 30,
"~followup_annotations": [
"@@@STEP_LOG_LINE@python.inline@@@@",
@@ -597,38 +597,115 @@
"@@@STEP_LOG_LINE@python.inline@import sys@@@",
"@@@STEP_LOG_LINE@python.inline@import time@@@",
"@@@STEP_LOG_LINE@python.inline@ADB = sys.argv[1]@@@",
- "@@@STEP_LOG_LINE@python.inline@model = sys.argv[2]@@@",
- "@@@STEP_LOG_LINE@python.inline@target_percent = float(sys.argv[3])@@@",
+ "@@@STEP_LOG_LINE@python.inline@cpu = int(sys.argv[2])@@@",
+ "@@@STEP_LOG_LINE@python.inline@gov = sys.argv[3]@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@log = subprocess.check_output([ADB, 'root'])@@@",
"@@@STEP_LOG_LINE@python.inline@# check for message like 'adbd cannot run as root in production builds'@@@",
"@@@STEP_LOG_LINE@python.inline@print log@@@",
"@@@STEP_LOG_LINE@python.inline@if 'cannot' in log:@@@",
"@@@STEP_LOG_LINE@python.inline@ raise Exception('adb root failed')@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@if model == 'Nexus7':@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Nexus7 claims to support 1300000, but only really allows 1200000@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = [51000, 102000, 204000, 340000, 475000, 640000, 760000,@@@",
- "@@@STEP_LOG_LINE@python.inline@ 860000, 1000000, 1100000, 1200000]@@@",
- "@@@STEP_LOG_LINE@python.inline@else:@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Temporary logging to get a sense of what devices have multiple cpus@@@",
- "@@@STEP_LOG_LINE@python.inline@ try:@@@",
- "@@@STEP_LOG_LINE@python.inline@ print subprocess.check_output([ADB, 'shell', 'cat ',@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu?/cpufreq/affected_cpus'])@@@",
- "@@@STEP_LOG_LINE@python.inline@ print subprocess.check_output([ADB, 'shell', 'cat ',@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu?/cpufreq/scaling_available_frequencies'])@@@",
- "@@@STEP_LOG_LINE@python.inline@ except Exception as e:@@@",
- "@@@STEP_LOG_LINE@python.inline@ print e.output.strip()@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Most devices give a list of their available frequencies.@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = subprocess.check_output([ADB, 'shell', 'cat '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies'])@@@",
+ "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo \"%s\" > '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])@@@",
+ "@@@STEP_LOG_LINE@python.inline@actual_gov = subprocess.check_output([ADB, 'shell', 'cat '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()@@@",
+ "@@@STEP_LOG_LINE@python.inline@if actual_gov != str(gov):@@@",
+ "@@@STEP_LOG_LINE@python.inline@ raise Exception('(actual, expected) (%s, %d)'@@@",
+ "@@@STEP_LOG_LINE@python.inline@ % (actual_gov, gov))@@@",
+ "@@@STEP_LOG_END@python.inline@@@"
+ ]
+ },
+ {
+ "cmd": [
+ "python",
+ "-u",
+ "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ncpu = int(sys.argv[2])\ngov = sys.argv[3]\n\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nsubprocess.check_output([ADB, 'shell', 'echo \"%s\" > '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])\nactual_gov = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()\nif actual_gov != str(gov):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_gov, gov))\n",
+ "/usr/bin/adb.1.0.35",
+ "2",
+ "userspace"
+ ],
+ "env": {
+ "BUILDTYPE": "Release",
+ "CHROME_HEADLESS": "1",
+ "PATH": "<PATH>:RECIPE_PACKAGE_REPO[depot_tools]",
+ "SKIA_OUT": "[START_DIR]/out"
+ },
+ "infra_step": true,
+ "name": "Set CPU 2's governor to userspace",
+ "timeout": 30,
+ "~followup_annotations": [
"@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Check for message like '/system/bin/sh: file not found'@@@",
- "@@@STEP_LOG_LINE@python.inline@ if available_freqs and '/system/bin/sh' not in available_freqs:@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = sorted(@@@",
- "@@@STEP_LOG_LINE@python.inline@ int(i) for i in available_freqs.strip().split())@@@",
- "@@@STEP_LOG_LINE@python.inline@ else:@@@",
- "@@@STEP_LOG_LINE@python.inline@ raise Exception('Could not get list of available frequencies: %s' %@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs)@@@",
+ "@@@STEP_LOG_LINE@python.inline@import os@@@",
+ "@@@STEP_LOG_LINE@python.inline@import subprocess@@@",
+ "@@@STEP_LOG_LINE@python.inline@import sys@@@",
+ "@@@STEP_LOG_LINE@python.inline@import time@@@",
+ "@@@STEP_LOG_LINE@python.inline@ADB = sys.argv[1]@@@",
+ "@@@STEP_LOG_LINE@python.inline@cpu = int(sys.argv[2])@@@",
+ "@@@STEP_LOG_LINE@python.inline@gov = sys.argv[3]@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@log = subprocess.check_output([ADB, 'root'])@@@",
+ "@@@STEP_LOG_LINE@python.inline@# check for message like 'adbd cannot run as root in production builds'@@@",
+ "@@@STEP_LOG_LINE@python.inline@print log@@@",
+ "@@@STEP_LOG_LINE@python.inline@if 'cannot' in log:@@@",
+ "@@@STEP_LOG_LINE@python.inline@ raise Exception('adb root failed')@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo \"%s\" > '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])@@@",
+ "@@@STEP_LOG_LINE@python.inline@actual_gov = subprocess.check_output([ADB, 'shell', 'cat '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()@@@",
+ "@@@STEP_LOG_LINE@python.inline@if actual_gov != str(gov):@@@",
+ "@@@STEP_LOG_LINE@python.inline@ raise Exception('(actual, expected) (%s, %d)'@@@",
+ "@@@STEP_LOG_LINE@python.inline@ % (actual_gov, gov))@@@",
+ "@@@STEP_LOG_END@python.inline@@@"
+ ]
+ },
+ {
+ "cmd": [
+ "python",
+ "-u",
+ "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ntarget_percent = float(sys.argv[2])\ncpu = int(sys.argv[3])\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nroot = '/sys/devices/system/cpu/cpu%d/cpufreq' %cpu\n\n# All devices we test on give a list of their available frequencies.\navailable_freqs = subprocess.check_output([ADB, 'shell',\n 'cat %s/scaling_available_frequencies' % root])\n\n# Check for message like '/system/bin/sh: file not found'\nif available_freqs and '/system/bin/sh' not in available_freqs:\n available_freqs = sorted(\n int(i) for i in available_freqs.strip().split())\nelse:\n raise Exception('Could not get list of available frequencies: %s' %\n available_freqs)\n\nmaxfreq = available_freqs[-1]\ntarget = int(round(maxfreq * target_percent))\nfreq = maxfreq\nfor f in reversed(available_freqs):\n if f <= target:\n freq = f\n break\n\nprint 'Setting frequency to %d' % freq\n\n# If scaling_max_freq is lower than our attempted setting, it won't take.\n# We must set min first, because if we try to set max to be less than min\n# (which sometimes happens after certain devices reboot) it returns a\n# perplexing permissions error.\nsubprocess.check_output([ADB, 'shell', 'echo 0 > '\n '%s/scaling_min_freq' % root])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '%s/scaling_max_freq' % (freq, root)])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '%s/scaling_setspeed' % (freq, root)])\ntime.sleep(5)\nactual_freq = subprocess.check_output([ADB, 'shell', 'cat '\n '%s/scaling_cur_freq' % root]).strip()\nif actual_freq != str(freq):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_freq, freq))\n",
+ "/usr/bin/adb.1.0.35",
+ "0.6",
+ "2"
+ ],
+ "env": {
+ "BUILDTYPE": "Release",
+ "CHROME_HEADLESS": "1",
+ "PATH": "<PATH>:RECIPE_PACKAGE_REPO[depot_tools]",
+ "SKIA_OUT": "[START_DIR]/out"
+ },
+ "infra_step": true,
+ "name": "Scale CPU 2 to 0.600000",
+ "timeout": 30,
+ "~followup_annotations": [
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@import os@@@",
+ "@@@STEP_LOG_LINE@python.inline@import subprocess@@@",
+ "@@@STEP_LOG_LINE@python.inline@import sys@@@",
+ "@@@STEP_LOG_LINE@python.inline@import time@@@",
+ "@@@STEP_LOG_LINE@python.inline@ADB = sys.argv[1]@@@",
+ "@@@STEP_LOG_LINE@python.inline@target_percent = float(sys.argv[2])@@@",
+ "@@@STEP_LOG_LINE@python.inline@cpu = int(sys.argv[3])@@@",
+ "@@@STEP_LOG_LINE@python.inline@log = subprocess.check_output([ADB, 'root'])@@@",
+ "@@@STEP_LOG_LINE@python.inline@# check for message like 'adbd cannot run as root in production builds'@@@",
+ "@@@STEP_LOG_LINE@python.inline@print log@@@",
+ "@@@STEP_LOG_LINE@python.inline@if 'cannot' in log:@@@",
+ "@@@STEP_LOG_LINE@python.inline@ raise Exception('adb root failed')@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@root = '/sys/devices/system/cpu/cpu%d/cpufreq' %cpu@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@# All devices we test on give a list of their available frequencies.@@@",
+ "@@@STEP_LOG_LINE@python.inline@available_freqs = subprocess.check_output([ADB, 'shell',@@@",
+ "@@@STEP_LOG_LINE@python.inline@ 'cat %s/scaling_available_frequencies' % root])@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@# Check for message like '/system/bin/sh: file not found'@@@",
+ "@@@STEP_LOG_LINE@python.inline@if available_freqs and '/system/bin/sh' not in available_freqs:@@@",
+ "@@@STEP_LOG_LINE@python.inline@ available_freqs = sorted(@@@",
+ "@@@STEP_LOG_LINE@python.inline@ int(i) for i in available_freqs.strip().split())@@@",
+ "@@@STEP_LOG_LINE@python.inline@else:@@@",
+ "@@@STEP_LOG_LINE@python.inline@ raise Exception('Could not get list of available frequencies: %s' %@@@",
+ "@@@STEP_LOG_LINE@python.inline@ available_freqs)@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@maxfreq = available_freqs[-1]@@@",
"@@@STEP_LOG_LINE@python.inline@target = int(round(maxfreq * target_percent))@@@",
@@ -640,21 +717,19 @@
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@print 'Setting frequency to %d' % freq@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo \"userspace\" > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor'])@@@",
"@@@STEP_LOG_LINE@python.inline@# If scaling_max_freq is lower than our attempted setting, it won't take.@@@",
"@@@STEP_LOG_LINE@python.inline@# We must set min first, because if we try to set max to be less than min@@@",
"@@@STEP_LOG_LINE@python.inline@# (which sometimes happens after certain devices reboot) it returns a@@@",
"@@@STEP_LOG_LINE@python.inline@# perplexing permissions error.@@@",
"@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo 0 > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq'])@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '%s/scaling_min_freq' % root])@@@",
"@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo %d > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '%s/scaling_max_freq' % (freq, root)])@@@",
"@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo %d > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed' % freq])@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '%s/scaling_setspeed' % (freq, root)])@@@",
"@@@STEP_LOG_LINE@python.inline@time.sleep(5)@@@",
"@@@STEP_LOG_LINE@python.inline@actual_freq = subprocess.check_output([ADB, 'shell', 'cat '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq']).strip()@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '%s/scaling_cur_freq' % root]).strip()@@@",
"@@@STEP_LOG_LINE@python.inline@if actual_freq != str(freq):@@@",
"@@@STEP_LOG_LINE@python.inline@ raise Exception('(actual, expected) (%s, %d)'@@@",
"@@@STEP_LOG_LINE@python.inline@ % (actual_freq, freq))@@@",
diff --git a/infra/bots/recipes/perf.expected/Perf-Android-Clang-PixelC-GPU-TegraX1-arm64-Release-All-Android_Skpbench.json b/infra/bots/recipes/perf.expected/Perf-Android-Clang-PixelC-GPU-TegraX1-arm64-Release-All-Android_Skpbench.json
index f0a009865a..b6b72e2aad 100644
--- a/infra/bots/recipes/perf.expected/Perf-Android-Clang-PixelC-GPU-TegraX1-arm64-Release-All-Android_Skpbench.json
+++ b/infra/bots/recipes/perf.expected/Perf-Android-Clang-PixelC-GPU-TegraX1-arm64-Release-All-Android_Skpbench.json
@@ -576,10 +576,10 @@
"cmd": [
"python",
"-u",
- "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\nmodel = sys.argv[2]\ntarget_percent = float(sys.argv[3])\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nif model == 'Nexus7':\n # Nexus7 claims to support 1300000, but only really allows 1200000\n available_freqs = [51000, 102000, 204000, 340000, 475000, 640000, 760000,\n 860000, 1000000, 1100000, 1200000]\nelse:\n # Temporary logging to get a sense of what devices have multiple cpus\n try:\n print subprocess.check_output([ADB, 'shell', 'cat ',\n '/sys/devices/system/cpu/cpu?/cpufreq/affected_cpus'])\n print subprocess.check_output([ADB, 'shell', 'cat ',\n '/sys/devices/system/cpu/cpu?/cpufreq/scaling_available_frequencies'])\n except Exception as e:\n print e.output.strip()\n # Most devices give a list of their available frequencies.\n available_freqs = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies'])\n\n # Check for message like '/system/bin/sh: file not found'\n if available_freqs and '/system/bin/sh' not in available_freqs:\n available_freqs = sorted(\n int(i) for i in available_freqs.strip().split())\n else:\n raise Exception('Could not get list of available frequencies: %s' %\n available_freqs)\n\nmaxfreq = available_freqs[-1]\ntarget = int(round(maxfreq * target_percent))\nfreq = maxfreq\nfor f in reversed(available_freqs):\n if f <= target:\n freq = f\n break\n\nprint 'Setting frequency to %d' % freq\n\nsubprocess.check_output([ADB, 'shell', 'echo \"userspace\" > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor'])\n# If scaling_max_freq is lower than our attempted setting, it won't take.\n# We must set min first, because if we try to set max to be less than min\n# (which sometimes happens after certain devices reboot) it returns a\n# perplexing permissions error.\nsubprocess.check_output([ADB, 'shell', 'echo 0 > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq'])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed' % freq])\ntime.sleep(5)\nactual_freq = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq']).strip()\nif actual_freq != str(freq):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_freq, freq))\n",
+ "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ncpu = int(sys.argv[2])\ngov = sys.argv[3]\n\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nsubprocess.check_output([ADB, 'shell', 'echo \"%s\" > '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])\nactual_gov = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()\nif actual_gov != str(gov):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_gov, gov))\n",
"/usr/bin/adb.1.0.35",
- "PixelC",
- "0.6"
+ "0",
+ "userspace"
],
"env": {
"BUILDTYPE": "Release",
@@ -588,7 +588,7 @@
"SKIA_OUT": "[START_DIR]/out"
},
"infra_step": true,
- "name": "Scale CPU to 0.600000",
+ "name": "Set CPU 0's governor to userspace",
"timeout": 30,
"~followup_annotations": [
"@@@STEP_LOG_LINE@python.inline@@@@",
@@ -597,38 +597,71 @@
"@@@STEP_LOG_LINE@python.inline@import sys@@@",
"@@@STEP_LOG_LINE@python.inline@import time@@@",
"@@@STEP_LOG_LINE@python.inline@ADB = sys.argv[1]@@@",
- "@@@STEP_LOG_LINE@python.inline@model = sys.argv[2]@@@",
- "@@@STEP_LOG_LINE@python.inline@target_percent = float(sys.argv[3])@@@",
+ "@@@STEP_LOG_LINE@python.inline@cpu = int(sys.argv[2])@@@",
+ "@@@STEP_LOG_LINE@python.inline@gov = sys.argv[3]@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@log = subprocess.check_output([ADB, 'root'])@@@",
"@@@STEP_LOG_LINE@python.inline@# check for message like 'adbd cannot run as root in production builds'@@@",
"@@@STEP_LOG_LINE@python.inline@print log@@@",
"@@@STEP_LOG_LINE@python.inline@if 'cannot' in log:@@@",
"@@@STEP_LOG_LINE@python.inline@ raise Exception('adb root failed')@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@if model == 'Nexus7':@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Nexus7 claims to support 1300000, but only really allows 1200000@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = [51000, 102000, 204000, 340000, 475000, 640000, 760000,@@@",
- "@@@STEP_LOG_LINE@python.inline@ 860000, 1000000, 1100000, 1200000]@@@",
- "@@@STEP_LOG_LINE@python.inline@else:@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Temporary logging to get a sense of what devices have multiple cpus@@@",
- "@@@STEP_LOG_LINE@python.inline@ try:@@@",
- "@@@STEP_LOG_LINE@python.inline@ print subprocess.check_output([ADB, 'shell', 'cat ',@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu?/cpufreq/affected_cpus'])@@@",
- "@@@STEP_LOG_LINE@python.inline@ print subprocess.check_output([ADB, 'shell', 'cat ',@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu?/cpufreq/scaling_available_frequencies'])@@@",
- "@@@STEP_LOG_LINE@python.inline@ except Exception as e:@@@",
- "@@@STEP_LOG_LINE@python.inline@ print e.output.strip()@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Most devices give a list of their available frequencies.@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = subprocess.check_output([ADB, 'shell', 'cat '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies'])@@@",
+ "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo \"%s\" > '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])@@@",
+ "@@@STEP_LOG_LINE@python.inline@actual_gov = subprocess.check_output([ADB, 'shell', 'cat '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()@@@",
+ "@@@STEP_LOG_LINE@python.inline@if actual_gov != str(gov):@@@",
+ "@@@STEP_LOG_LINE@python.inline@ raise Exception('(actual, expected) (%s, %d)'@@@",
+ "@@@STEP_LOG_LINE@python.inline@ % (actual_gov, gov))@@@",
+ "@@@STEP_LOG_END@python.inline@@@"
+ ]
+ },
+ {
+ "cmd": [
+ "python",
+ "-u",
+ "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ntarget_percent = float(sys.argv[2])\ncpu = int(sys.argv[3])\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nroot = '/sys/devices/system/cpu/cpu%d/cpufreq' %cpu\n\n# All devices we test on give a list of their available frequencies.\navailable_freqs = subprocess.check_output([ADB, 'shell',\n 'cat %s/scaling_available_frequencies' % root])\n\n# Check for message like '/system/bin/sh: file not found'\nif available_freqs and '/system/bin/sh' not in available_freqs:\n available_freqs = sorted(\n int(i) for i in available_freqs.strip().split())\nelse:\n raise Exception('Could not get list of available frequencies: %s' %\n available_freqs)\n\nmaxfreq = available_freqs[-1]\ntarget = int(round(maxfreq * target_percent))\nfreq = maxfreq\nfor f in reversed(available_freqs):\n if f <= target:\n freq = f\n break\n\nprint 'Setting frequency to %d' % freq\n\n# If scaling_max_freq is lower than our attempted setting, it won't take.\n# We must set min first, because if we try to set max to be less than min\n# (which sometimes happens after certain devices reboot) it returns a\n# perplexing permissions error.\nsubprocess.check_output([ADB, 'shell', 'echo 0 > '\n '%s/scaling_min_freq' % root])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '%s/scaling_max_freq' % (freq, root)])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '%s/scaling_setspeed' % (freq, root)])\ntime.sleep(5)\nactual_freq = subprocess.check_output([ADB, 'shell', 'cat '\n '%s/scaling_cur_freq' % root]).strip()\nif actual_freq != str(freq):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_freq, freq))\n",
+ "/usr/bin/adb.1.0.35",
+ "0.6",
+ "0"
+ ],
+ "env": {
+ "BUILDTYPE": "Release",
+ "CHROME_HEADLESS": "1",
+ "PATH": "<PATH>:RECIPE_PACKAGE_REPO[depot_tools]",
+ "SKIA_OUT": "[START_DIR]/out"
+ },
+ "infra_step": true,
+ "name": "Scale CPU 0 to 0.600000",
+ "timeout": 30,
+ "~followup_annotations": [
"@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Check for message like '/system/bin/sh: file not found'@@@",
- "@@@STEP_LOG_LINE@python.inline@ if available_freqs and '/system/bin/sh' not in available_freqs:@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = sorted(@@@",
- "@@@STEP_LOG_LINE@python.inline@ int(i) for i in available_freqs.strip().split())@@@",
- "@@@STEP_LOG_LINE@python.inline@ else:@@@",
- "@@@STEP_LOG_LINE@python.inline@ raise Exception('Could not get list of available frequencies: %s' %@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs)@@@",
+ "@@@STEP_LOG_LINE@python.inline@import os@@@",
+ "@@@STEP_LOG_LINE@python.inline@import subprocess@@@",
+ "@@@STEP_LOG_LINE@python.inline@import sys@@@",
+ "@@@STEP_LOG_LINE@python.inline@import time@@@",
+ "@@@STEP_LOG_LINE@python.inline@ADB = sys.argv[1]@@@",
+ "@@@STEP_LOG_LINE@python.inline@target_percent = float(sys.argv[2])@@@",
+ "@@@STEP_LOG_LINE@python.inline@cpu = int(sys.argv[3])@@@",
+ "@@@STEP_LOG_LINE@python.inline@log = subprocess.check_output([ADB, 'root'])@@@",
+ "@@@STEP_LOG_LINE@python.inline@# check for message like 'adbd cannot run as root in production builds'@@@",
+ "@@@STEP_LOG_LINE@python.inline@print log@@@",
+ "@@@STEP_LOG_LINE@python.inline@if 'cannot' in log:@@@",
+ "@@@STEP_LOG_LINE@python.inline@ raise Exception('adb root failed')@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@root = '/sys/devices/system/cpu/cpu%d/cpufreq' %cpu@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@# All devices we test on give a list of their available frequencies.@@@",
+ "@@@STEP_LOG_LINE@python.inline@available_freqs = subprocess.check_output([ADB, 'shell',@@@",
+ "@@@STEP_LOG_LINE@python.inline@ 'cat %s/scaling_available_frequencies' % root])@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@# Check for message like '/system/bin/sh: file not found'@@@",
+ "@@@STEP_LOG_LINE@python.inline@if available_freqs and '/system/bin/sh' not in available_freqs:@@@",
+ "@@@STEP_LOG_LINE@python.inline@ available_freqs = sorted(@@@",
+ "@@@STEP_LOG_LINE@python.inline@ int(i) for i in available_freqs.strip().split())@@@",
+ "@@@STEP_LOG_LINE@python.inline@else:@@@",
+ "@@@STEP_LOG_LINE@python.inline@ raise Exception('Could not get list of available frequencies: %s' %@@@",
+ "@@@STEP_LOG_LINE@python.inline@ available_freqs)@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@maxfreq = available_freqs[-1]@@@",
"@@@STEP_LOG_LINE@python.inline@target = int(round(maxfreq * target_percent))@@@",
@@ -640,21 +673,19 @@
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@print 'Setting frequency to %d' % freq@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo \"userspace\" > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor'])@@@",
"@@@STEP_LOG_LINE@python.inline@# If scaling_max_freq is lower than our attempted setting, it won't take.@@@",
"@@@STEP_LOG_LINE@python.inline@# We must set min first, because if we try to set max to be less than min@@@",
"@@@STEP_LOG_LINE@python.inline@# (which sometimes happens after certain devices reboot) it returns a@@@",
"@@@STEP_LOG_LINE@python.inline@# perplexing permissions error.@@@",
"@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo 0 > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq'])@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '%s/scaling_min_freq' % root])@@@",
"@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo %d > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '%s/scaling_max_freq' % (freq, root)])@@@",
"@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo %d > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed' % freq])@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '%s/scaling_setspeed' % (freq, root)])@@@",
"@@@STEP_LOG_LINE@python.inline@time.sleep(5)@@@",
"@@@STEP_LOG_LINE@python.inline@actual_freq = subprocess.check_output([ADB, 'shell', 'cat '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq']).strip()@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '%s/scaling_cur_freq' % root]).strip()@@@",
"@@@STEP_LOG_LINE@python.inline@if actual_freq != str(freq):@@@",
"@@@STEP_LOG_LINE@python.inline@ raise Exception('(actual, expected) (%s, %d)'@@@",
"@@@STEP_LOG_LINE@python.inline@ % (actual_freq, freq))@@@",
diff --git a/infra/bots/recipes/perf.expected/cpu_scale_failed.json b/infra/bots/recipes/perf.expected/cpu_scale_failed.json
index d87e979a07..6d821ae4af 100644
--- a/infra/bots/recipes/perf.expected/cpu_scale_failed.json
+++ b/infra/bots/recipes/perf.expected/cpu_scale_failed.json
@@ -540,10 +540,10 @@
"cmd": [
"python",
"-u",
- "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\nmodel = sys.argv[2]\ntarget_percent = float(sys.argv[3])\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nif model == 'Nexus7':\n # Nexus7 claims to support 1300000, but only really allows 1200000\n available_freqs = [51000, 102000, 204000, 340000, 475000, 640000, 760000,\n 860000, 1000000, 1100000, 1200000]\nelse:\n # Temporary logging to get a sense of what devices have multiple cpus\n try:\n print subprocess.check_output([ADB, 'shell', 'cat ',\n '/sys/devices/system/cpu/cpu?/cpufreq/affected_cpus'])\n print subprocess.check_output([ADB, 'shell', 'cat ',\n '/sys/devices/system/cpu/cpu?/cpufreq/scaling_available_frequencies'])\n except Exception as e:\n print e.output.strip()\n # Most devices give a list of their available frequencies.\n available_freqs = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies'])\n\n # Check for message like '/system/bin/sh: file not found'\n if available_freqs and '/system/bin/sh' not in available_freqs:\n available_freqs = sorted(\n int(i) for i in available_freqs.strip().split())\n else:\n raise Exception('Could not get list of available frequencies: %s' %\n available_freqs)\n\nmaxfreq = available_freqs[-1]\ntarget = int(round(maxfreq * target_percent))\nfreq = maxfreq\nfor f in reversed(available_freqs):\n if f <= target:\n freq = f\n break\n\nprint 'Setting frequency to %d' % freq\n\nsubprocess.check_output([ADB, 'shell', 'echo \"userspace\" > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor'])\n# If scaling_max_freq is lower than our attempted setting, it won't take.\n# We must set min first, because if we try to set max to be less than min\n# (which sometimes happens after certain devices reboot) it returns a\n# perplexing permissions error.\nsubprocess.check_output([ADB, 'shell', 'echo 0 > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq'])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed' % freq])\ntime.sleep(5)\nactual_freq = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq']).strip()\nif actual_freq != str(freq):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_freq, freq))\n",
+ "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ncpu = int(sys.argv[2])\ngov = sys.argv[3]\n\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nsubprocess.check_output([ADB, 'shell', 'echo \"%s\" > '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])\nactual_gov = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()\nif actual_gov != str(gov):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_gov, gov))\n",
"/usr/bin/adb.1.0.35",
- "NexusPlayer",
- "0.6"
+ "0",
+ "powersave"
],
"env": {
"BUILDTYPE": "Debug",
@@ -552,7 +552,95 @@
"SKIA_OUT": "[START_DIR]/out"
},
"infra_step": true,
- "name": "Scale CPU to 0.600000",
+ "name": "Set CPU 0's governor to powersave",
+ "timeout": 30,
+ "~followup_annotations": [
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@import os@@@",
+ "@@@STEP_LOG_LINE@python.inline@import subprocess@@@",
+ "@@@STEP_LOG_LINE@python.inline@import sys@@@",
+ "@@@STEP_LOG_LINE@python.inline@import time@@@",
+ "@@@STEP_LOG_LINE@python.inline@ADB = sys.argv[1]@@@",
+ "@@@STEP_LOG_LINE@python.inline@cpu = int(sys.argv[2])@@@",
+ "@@@STEP_LOG_LINE@python.inline@gov = sys.argv[3]@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@log = subprocess.check_output([ADB, 'root'])@@@",
+ "@@@STEP_LOG_LINE@python.inline@# check for message like 'adbd cannot run as root in production builds'@@@",
+ "@@@STEP_LOG_LINE@python.inline@print log@@@",
+ "@@@STEP_LOG_LINE@python.inline@if 'cannot' in log:@@@",
+ "@@@STEP_LOG_LINE@python.inline@ raise Exception('adb root failed')@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo \"%s\" > '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])@@@",
+ "@@@STEP_LOG_LINE@python.inline@actual_gov = subprocess.check_output([ADB, 'shell', 'cat '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()@@@",
+ "@@@STEP_LOG_LINE@python.inline@if actual_gov != str(gov):@@@",
+ "@@@STEP_LOG_LINE@python.inline@ raise Exception('(actual, expected) (%s, %d)'@@@",
+ "@@@STEP_LOG_LINE@python.inline@ % (actual_gov, gov))@@@",
+ "@@@STEP_LOG_END@python.inline@@@"
+ ]
+ },
+ {
+ "cmd": [
+ "python",
+ "-u",
+ "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ncpu = int(sys.argv[2])\ngov = sys.argv[3]\n\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nsubprocess.check_output([ADB, 'shell', 'echo \"%s\" > '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])\nactual_gov = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()\nif actual_gov != str(gov):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_gov, gov))\n",
+ "/usr/bin/adb.1.0.35",
+ "2",
+ "userspace"
+ ],
+ "env": {
+ "BUILDTYPE": "Debug",
+ "CHROME_HEADLESS": "1",
+ "PATH": "<PATH>:RECIPE_PACKAGE_REPO[depot_tools]",
+ "SKIA_OUT": "[START_DIR]/out"
+ },
+ "infra_step": true,
+ "name": "Set CPU 2's governor to userspace",
+ "timeout": 30,
+ "~followup_annotations": [
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@import os@@@",
+ "@@@STEP_LOG_LINE@python.inline@import subprocess@@@",
+ "@@@STEP_LOG_LINE@python.inline@import sys@@@",
+ "@@@STEP_LOG_LINE@python.inline@import time@@@",
+ "@@@STEP_LOG_LINE@python.inline@ADB = sys.argv[1]@@@",
+ "@@@STEP_LOG_LINE@python.inline@cpu = int(sys.argv[2])@@@",
+ "@@@STEP_LOG_LINE@python.inline@gov = sys.argv[3]@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@log = subprocess.check_output([ADB, 'root'])@@@",
+ "@@@STEP_LOG_LINE@python.inline@# check for message like 'adbd cannot run as root in production builds'@@@",
+ "@@@STEP_LOG_LINE@python.inline@print log@@@",
+ "@@@STEP_LOG_LINE@python.inline@if 'cannot' in log:@@@",
+ "@@@STEP_LOG_LINE@python.inline@ raise Exception('adb root failed')@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo \"%s\" > '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])@@@",
+ "@@@STEP_LOG_LINE@python.inline@actual_gov = subprocess.check_output([ADB, 'shell', 'cat '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()@@@",
+ "@@@STEP_LOG_LINE@python.inline@if actual_gov != str(gov):@@@",
+ "@@@STEP_LOG_LINE@python.inline@ raise Exception('(actual, expected) (%s, %d)'@@@",
+ "@@@STEP_LOG_LINE@python.inline@ % (actual_gov, gov))@@@",
+ "@@@STEP_LOG_END@python.inline@@@"
+ ]
+ },
+ {
+ "cmd": [
+ "python",
+ "-u",
+ "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ntarget_percent = float(sys.argv[2])\ncpu = int(sys.argv[3])\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nroot = '/sys/devices/system/cpu/cpu%d/cpufreq' %cpu\n\n# All devices we test on give a list of their available frequencies.\navailable_freqs = subprocess.check_output([ADB, 'shell',\n 'cat %s/scaling_available_frequencies' % root])\n\n# Check for message like '/system/bin/sh: file not found'\nif available_freqs and '/system/bin/sh' not in available_freqs:\n available_freqs = sorted(\n int(i) for i in available_freqs.strip().split())\nelse:\n raise Exception('Could not get list of available frequencies: %s' %\n available_freqs)\n\nmaxfreq = available_freqs[-1]\ntarget = int(round(maxfreq * target_percent))\nfreq = maxfreq\nfor f in reversed(available_freqs):\n if f <= target:\n freq = f\n break\n\nprint 'Setting frequency to %d' % freq\n\n# If scaling_max_freq is lower than our attempted setting, it won't take.\n# We must set min first, because if we try to set max to be less than min\n# (which sometimes happens after certain devices reboot) it returns a\n# perplexing permissions error.\nsubprocess.check_output([ADB, 'shell', 'echo 0 > '\n '%s/scaling_min_freq' % root])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '%s/scaling_max_freq' % (freq, root)])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '%s/scaling_setspeed' % (freq, root)])\ntime.sleep(5)\nactual_freq = subprocess.check_output([ADB, 'shell', 'cat '\n '%s/scaling_cur_freq' % root]).strip()\nif actual_freq != str(freq):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_freq, freq))\n",
+ "/usr/bin/adb.1.0.35",
+ "0.6",
+ "2"
+ ],
+ "env": {
+ "BUILDTYPE": "Debug",
+ "CHROME_HEADLESS": "1",
+ "PATH": "<PATH>:RECIPE_PACKAGE_REPO[depot_tools]",
+ "SKIA_OUT": "[START_DIR]/out"
+ },
+ "infra_step": true,
+ "name": "Scale CPU 2 to 0.600000",
"timeout": 30,
"~followup_annotations": [
"step returned non-zero exit code: 1",
@@ -562,38 +650,27 @@
"@@@STEP_LOG_LINE@python.inline@import sys@@@",
"@@@STEP_LOG_LINE@python.inline@import time@@@",
"@@@STEP_LOG_LINE@python.inline@ADB = sys.argv[1]@@@",
- "@@@STEP_LOG_LINE@python.inline@model = sys.argv[2]@@@",
- "@@@STEP_LOG_LINE@python.inline@target_percent = float(sys.argv[3])@@@",
+ "@@@STEP_LOG_LINE@python.inline@target_percent = float(sys.argv[2])@@@",
+ "@@@STEP_LOG_LINE@python.inline@cpu = int(sys.argv[3])@@@",
"@@@STEP_LOG_LINE@python.inline@log = subprocess.check_output([ADB, 'root'])@@@",
"@@@STEP_LOG_LINE@python.inline@# check for message like 'adbd cannot run as root in production builds'@@@",
"@@@STEP_LOG_LINE@python.inline@print log@@@",
"@@@STEP_LOG_LINE@python.inline@if 'cannot' in log:@@@",
"@@@STEP_LOG_LINE@python.inline@ raise Exception('adb root failed')@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@if model == 'Nexus7':@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Nexus7 claims to support 1300000, but only really allows 1200000@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = [51000, 102000, 204000, 340000, 475000, 640000, 760000,@@@",
- "@@@STEP_LOG_LINE@python.inline@ 860000, 1000000, 1100000, 1200000]@@@",
+ "@@@STEP_LOG_LINE@python.inline@root = '/sys/devices/system/cpu/cpu%d/cpufreq' %cpu@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@# All devices we test on give a list of their available frequencies.@@@",
+ "@@@STEP_LOG_LINE@python.inline@available_freqs = subprocess.check_output([ADB, 'shell',@@@",
+ "@@@STEP_LOG_LINE@python.inline@ 'cat %s/scaling_available_frequencies' % root])@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@# Check for message like '/system/bin/sh: file not found'@@@",
+ "@@@STEP_LOG_LINE@python.inline@if available_freqs and '/system/bin/sh' not in available_freqs:@@@",
+ "@@@STEP_LOG_LINE@python.inline@ available_freqs = sorted(@@@",
+ "@@@STEP_LOG_LINE@python.inline@ int(i) for i in available_freqs.strip().split())@@@",
"@@@STEP_LOG_LINE@python.inline@else:@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Temporary logging to get a sense of what devices have multiple cpus@@@",
- "@@@STEP_LOG_LINE@python.inline@ try:@@@",
- "@@@STEP_LOG_LINE@python.inline@ print subprocess.check_output([ADB, 'shell', 'cat ',@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu?/cpufreq/affected_cpus'])@@@",
- "@@@STEP_LOG_LINE@python.inline@ print subprocess.check_output([ADB, 'shell', 'cat ',@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu?/cpufreq/scaling_available_frequencies'])@@@",
- "@@@STEP_LOG_LINE@python.inline@ except Exception as e:@@@",
- "@@@STEP_LOG_LINE@python.inline@ print e.output.strip()@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Most devices give a list of their available frequencies.@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = subprocess.check_output([ADB, 'shell', 'cat '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies'])@@@",
- "@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Check for message like '/system/bin/sh: file not found'@@@",
- "@@@STEP_LOG_LINE@python.inline@ if available_freqs and '/system/bin/sh' not in available_freqs:@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = sorted(@@@",
- "@@@STEP_LOG_LINE@python.inline@ int(i) for i in available_freqs.strip().split())@@@",
- "@@@STEP_LOG_LINE@python.inline@ else:@@@",
- "@@@STEP_LOG_LINE@python.inline@ raise Exception('Could not get list of available frequencies: %s' %@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs)@@@",
+ "@@@STEP_LOG_LINE@python.inline@ raise Exception('Could not get list of available frequencies: %s' %@@@",
+ "@@@STEP_LOG_LINE@python.inline@ available_freqs)@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@maxfreq = available_freqs[-1]@@@",
"@@@STEP_LOG_LINE@python.inline@target = int(round(maxfreq * target_percent))@@@",
@@ -605,21 +682,19 @@
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@print 'Setting frequency to %d' % freq@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo \"userspace\" > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor'])@@@",
"@@@STEP_LOG_LINE@python.inline@# If scaling_max_freq is lower than our attempted setting, it won't take.@@@",
"@@@STEP_LOG_LINE@python.inline@# We must set min first, because if we try to set max to be less than min@@@",
"@@@STEP_LOG_LINE@python.inline@# (which sometimes happens after certain devices reboot) it returns a@@@",
"@@@STEP_LOG_LINE@python.inline@# perplexing permissions error.@@@",
"@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo 0 > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq'])@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '%s/scaling_min_freq' % root])@@@",
"@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo %d > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '%s/scaling_max_freq' % (freq, root)])@@@",
"@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo %d > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed' % freq])@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '%s/scaling_setspeed' % (freq, root)])@@@",
"@@@STEP_LOG_LINE@python.inline@time.sleep(5)@@@",
"@@@STEP_LOG_LINE@python.inline@actual_freq = subprocess.check_output([ADB, 'shell', 'cat '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq']).strip()@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '%s/scaling_cur_freq' % root]).strip()@@@",
"@@@STEP_LOG_LINE@python.inline@if actual_freq != str(freq):@@@",
"@@@STEP_LOG_LINE@python.inline@ raise Exception('(actual, expected) (%s, %d)'@@@",
"@@@STEP_LOG_LINE@python.inline@ % (actual_freq, freq))@@@",
@@ -631,10 +706,10 @@
"cmd": [
"python",
"-u",
- "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\nmodel = sys.argv[2]\ntarget_percent = float(sys.argv[3])\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nif model == 'Nexus7':\n # Nexus7 claims to support 1300000, but only really allows 1200000\n available_freqs = [51000, 102000, 204000, 340000, 475000, 640000, 760000,\n 860000, 1000000, 1100000, 1200000]\nelse:\n # Temporary logging to get a sense of what devices have multiple cpus\n try:\n print subprocess.check_output([ADB, 'shell', 'cat ',\n '/sys/devices/system/cpu/cpu?/cpufreq/affected_cpus'])\n print subprocess.check_output([ADB, 'shell', 'cat ',\n '/sys/devices/system/cpu/cpu?/cpufreq/scaling_available_frequencies'])\n except Exception as e:\n print e.output.strip()\n # Most devices give a list of their available frequencies.\n available_freqs = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies'])\n\n # Check for message like '/system/bin/sh: file not found'\n if available_freqs and '/system/bin/sh' not in available_freqs:\n available_freqs = sorted(\n int(i) for i in available_freqs.strip().split())\n else:\n raise Exception('Could not get list of available frequencies: %s' %\n available_freqs)\n\nmaxfreq = available_freqs[-1]\ntarget = int(round(maxfreq * target_percent))\nfreq = maxfreq\nfor f in reversed(available_freqs):\n if f <= target:\n freq = f\n break\n\nprint 'Setting frequency to %d' % freq\n\nsubprocess.check_output([ADB, 'shell', 'echo \"userspace\" > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor'])\n# If scaling_max_freq is lower than our attempted setting, it won't take.\n# We must set min first, because if we try to set max to be less than min\n# (which sometimes happens after certain devices reboot) it returns a\n# perplexing permissions error.\nsubprocess.check_output([ADB, 'shell', 'echo 0 > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq'])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed' % freq])\ntime.sleep(5)\nactual_freq = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq']).strip()\nif actual_freq != str(freq):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_freq, freq))\n",
+ "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ntarget_percent = float(sys.argv[2])\ncpu = int(sys.argv[3])\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nroot = '/sys/devices/system/cpu/cpu%d/cpufreq' %cpu\n\n# All devices we test on give a list of their available frequencies.\navailable_freqs = subprocess.check_output([ADB, 'shell',\n 'cat %s/scaling_available_frequencies' % root])\n\n# Check for message like '/system/bin/sh: file not found'\nif available_freqs and '/system/bin/sh' not in available_freqs:\n available_freqs = sorted(\n int(i) for i in available_freqs.strip().split())\nelse:\n raise Exception('Could not get list of available frequencies: %s' %\n available_freqs)\n\nmaxfreq = available_freqs[-1]\ntarget = int(round(maxfreq * target_percent))\nfreq = maxfreq\nfor f in reversed(available_freqs):\n if f <= target:\n freq = f\n break\n\nprint 'Setting frequency to %d' % freq\n\n# If scaling_max_freq is lower than our attempted setting, it won't take.\n# We must set min first, because if we try to set max to be less than min\n# (which sometimes happens after certain devices reboot) it returns a\n# perplexing permissions error.\nsubprocess.check_output([ADB, 'shell', 'echo 0 > '\n '%s/scaling_min_freq' % root])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '%s/scaling_max_freq' % (freq, root)])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '%s/scaling_setspeed' % (freq, root)])\ntime.sleep(5)\nactual_freq = subprocess.check_output([ADB, 'shell', 'cat '\n '%s/scaling_cur_freq' % root]).strip()\nif actual_freq != str(freq):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_freq, freq))\n",
"/usr/bin/adb.1.0.35",
- "NexusPlayer",
- "0.6"
+ "0.6",
+ "2"
],
"env": {
"BUILDTYPE": "Debug",
@@ -643,7 +718,7 @@
"SKIA_OUT": "[START_DIR]/out"
},
"infra_step": true,
- "name": "Scale CPU to 0.600000 (attempt 2)",
+ "name": "Scale CPU 2 to 0.600000 (attempt 2)",
"timeout": 30,
"~followup_annotations": [
"step returned non-zero exit code: 1",
@@ -653,38 +728,27 @@
"@@@STEP_LOG_LINE@python.inline@import sys@@@",
"@@@STEP_LOG_LINE@python.inline@import time@@@",
"@@@STEP_LOG_LINE@python.inline@ADB = sys.argv[1]@@@",
- "@@@STEP_LOG_LINE@python.inline@model = sys.argv[2]@@@",
- "@@@STEP_LOG_LINE@python.inline@target_percent = float(sys.argv[3])@@@",
+ "@@@STEP_LOG_LINE@python.inline@target_percent = float(sys.argv[2])@@@",
+ "@@@STEP_LOG_LINE@python.inline@cpu = int(sys.argv[3])@@@",
"@@@STEP_LOG_LINE@python.inline@log = subprocess.check_output([ADB, 'root'])@@@",
"@@@STEP_LOG_LINE@python.inline@# check for message like 'adbd cannot run as root in production builds'@@@",
"@@@STEP_LOG_LINE@python.inline@print log@@@",
"@@@STEP_LOG_LINE@python.inline@if 'cannot' in log:@@@",
"@@@STEP_LOG_LINE@python.inline@ raise Exception('adb root failed')@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@if model == 'Nexus7':@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Nexus7 claims to support 1300000, but only really allows 1200000@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = [51000, 102000, 204000, 340000, 475000, 640000, 760000,@@@",
- "@@@STEP_LOG_LINE@python.inline@ 860000, 1000000, 1100000, 1200000]@@@",
+ "@@@STEP_LOG_LINE@python.inline@root = '/sys/devices/system/cpu/cpu%d/cpufreq' %cpu@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@# All devices we test on give a list of their available frequencies.@@@",
+ "@@@STEP_LOG_LINE@python.inline@available_freqs = subprocess.check_output([ADB, 'shell',@@@",
+ "@@@STEP_LOG_LINE@python.inline@ 'cat %s/scaling_available_frequencies' % root])@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@# Check for message like '/system/bin/sh: file not found'@@@",
+ "@@@STEP_LOG_LINE@python.inline@if available_freqs and '/system/bin/sh' not in available_freqs:@@@",
+ "@@@STEP_LOG_LINE@python.inline@ available_freqs = sorted(@@@",
+ "@@@STEP_LOG_LINE@python.inline@ int(i) for i in available_freqs.strip().split())@@@",
"@@@STEP_LOG_LINE@python.inline@else:@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Temporary logging to get a sense of what devices have multiple cpus@@@",
- "@@@STEP_LOG_LINE@python.inline@ try:@@@",
- "@@@STEP_LOG_LINE@python.inline@ print subprocess.check_output([ADB, 'shell', 'cat ',@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu?/cpufreq/affected_cpus'])@@@",
- "@@@STEP_LOG_LINE@python.inline@ print subprocess.check_output([ADB, 'shell', 'cat ',@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu?/cpufreq/scaling_available_frequencies'])@@@",
- "@@@STEP_LOG_LINE@python.inline@ except Exception as e:@@@",
- "@@@STEP_LOG_LINE@python.inline@ print e.output.strip()@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Most devices give a list of their available frequencies.@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = subprocess.check_output([ADB, 'shell', 'cat '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies'])@@@",
- "@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Check for message like '/system/bin/sh: file not found'@@@",
- "@@@STEP_LOG_LINE@python.inline@ if available_freqs and '/system/bin/sh' not in available_freqs:@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = sorted(@@@",
- "@@@STEP_LOG_LINE@python.inline@ int(i) for i in available_freqs.strip().split())@@@",
- "@@@STEP_LOG_LINE@python.inline@ else:@@@",
- "@@@STEP_LOG_LINE@python.inline@ raise Exception('Could not get list of available frequencies: %s' %@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs)@@@",
+ "@@@STEP_LOG_LINE@python.inline@ raise Exception('Could not get list of available frequencies: %s' %@@@",
+ "@@@STEP_LOG_LINE@python.inline@ available_freqs)@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@maxfreq = available_freqs[-1]@@@",
"@@@STEP_LOG_LINE@python.inline@target = int(round(maxfreq * target_percent))@@@",
@@ -696,21 +760,19 @@
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@print 'Setting frequency to %d' % freq@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo \"userspace\" > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor'])@@@",
"@@@STEP_LOG_LINE@python.inline@# If scaling_max_freq is lower than our attempted setting, it won't take.@@@",
"@@@STEP_LOG_LINE@python.inline@# We must set min first, because if we try to set max to be less than min@@@",
"@@@STEP_LOG_LINE@python.inline@# (which sometimes happens after certain devices reboot) it returns a@@@",
"@@@STEP_LOG_LINE@python.inline@# perplexing permissions error.@@@",
"@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo 0 > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq'])@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '%s/scaling_min_freq' % root])@@@",
"@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo %d > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '%s/scaling_max_freq' % (freq, root)])@@@",
"@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo %d > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed' % freq])@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '%s/scaling_setspeed' % (freq, root)])@@@",
"@@@STEP_LOG_LINE@python.inline@time.sleep(5)@@@",
"@@@STEP_LOG_LINE@python.inline@actual_freq = subprocess.check_output([ADB, 'shell', 'cat '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq']).strip()@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '%s/scaling_cur_freq' % root]).strip()@@@",
"@@@STEP_LOG_LINE@python.inline@if actual_freq != str(freq):@@@",
"@@@STEP_LOG_LINE@python.inline@ raise Exception('(actual, expected) (%s, %d)'@@@",
"@@@STEP_LOG_LINE@python.inline@ % (actual_freq, freq))@@@",
@@ -722,10 +784,10 @@
"cmd": [
"python",
"-u",
- "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\nmodel = sys.argv[2]\ntarget_percent = float(sys.argv[3])\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nif model == 'Nexus7':\n # Nexus7 claims to support 1300000, but only really allows 1200000\n available_freqs = [51000, 102000, 204000, 340000, 475000, 640000, 760000,\n 860000, 1000000, 1100000, 1200000]\nelse:\n # Temporary logging to get a sense of what devices have multiple cpus\n try:\n print subprocess.check_output([ADB, 'shell', 'cat ',\n '/sys/devices/system/cpu/cpu?/cpufreq/affected_cpus'])\n print subprocess.check_output([ADB, 'shell', 'cat ',\n '/sys/devices/system/cpu/cpu?/cpufreq/scaling_available_frequencies'])\n except Exception as e:\n print e.output.strip()\n # Most devices give a list of their available frequencies.\n available_freqs = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies'])\n\n # Check for message like '/system/bin/sh: file not found'\n if available_freqs and '/system/bin/sh' not in available_freqs:\n available_freqs = sorted(\n int(i) for i in available_freqs.strip().split())\n else:\n raise Exception('Could not get list of available frequencies: %s' %\n available_freqs)\n\nmaxfreq = available_freqs[-1]\ntarget = int(round(maxfreq * target_percent))\nfreq = maxfreq\nfor f in reversed(available_freqs):\n if f <= target:\n freq = f\n break\n\nprint 'Setting frequency to %d' % freq\n\nsubprocess.check_output([ADB, 'shell', 'echo \"userspace\" > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor'])\n# If scaling_max_freq is lower than our attempted setting, it won't take.\n# We must set min first, because if we try to set max to be less than min\n# (which sometimes happens after certain devices reboot) it returns a\n# perplexing permissions error.\nsubprocess.check_output([ADB, 'shell', 'echo 0 > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq'])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed' % freq])\ntime.sleep(5)\nactual_freq = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq']).strip()\nif actual_freq != str(freq):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_freq, freq))\n",
+ "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ntarget_percent = float(sys.argv[2])\ncpu = int(sys.argv[3])\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nroot = '/sys/devices/system/cpu/cpu%d/cpufreq' %cpu\n\n# All devices we test on give a list of their available frequencies.\navailable_freqs = subprocess.check_output([ADB, 'shell',\n 'cat %s/scaling_available_frequencies' % root])\n\n# Check for message like '/system/bin/sh: file not found'\nif available_freqs and '/system/bin/sh' not in available_freqs:\n available_freqs = sorted(\n int(i) for i in available_freqs.strip().split())\nelse:\n raise Exception('Could not get list of available frequencies: %s' %\n available_freqs)\n\nmaxfreq = available_freqs[-1]\ntarget = int(round(maxfreq * target_percent))\nfreq = maxfreq\nfor f in reversed(available_freqs):\n if f <= target:\n freq = f\n break\n\nprint 'Setting frequency to %d' % freq\n\n# If scaling_max_freq is lower than our attempted setting, it won't take.\n# We must set min first, because if we try to set max to be less than min\n# (which sometimes happens after certain devices reboot) it returns a\n# perplexing permissions error.\nsubprocess.check_output([ADB, 'shell', 'echo 0 > '\n '%s/scaling_min_freq' % root])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '%s/scaling_max_freq' % (freq, root)])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '%s/scaling_setspeed' % (freq, root)])\ntime.sleep(5)\nactual_freq = subprocess.check_output([ADB, 'shell', 'cat '\n '%s/scaling_cur_freq' % root]).strip()\nif actual_freq != str(freq):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_freq, freq))\n",
"/usr/bin/adb.1.0.35",
- "NexusPlayer",
- "0.6"
+ "0.6",
+ "2"
],
"env": {
"BUILDTYPE": "Debug",
@@ -734,7 +796,7 @@
"SKIA_OUT": "[START_DIR]/out"
},
"infra_step": true,
- "name": "Scale CPU to 0.600000 (attempt 3)",
+ "name": "Scale CPU 2 to 0.600000 (attempt 3)",
"timeout": 30,
"~followup_annotations": [
"step returned non-zero exit code: 1",
@@ -744,38 +806,27 @@
"@@@STEP_LOG_LINE@python.inline@import sys@@@",
"@@@STEP_LOG_LINE@python.inline@import time@@@",
"@@@STEP_LOG_LINE@python.inline@ADB = sys.argv[1]@@@",
- "@@@STEP_LOG_LINE@python.inline@model = sys.argv[2]@@@",
- "@@@STEP_LOG_LINE@python.inline@target_percent = float(sys.argv[3])@@@",
+ "@@@STEP_LOG_LINE@python.inline@target_percent = float(sys.argv[2])@@@",
+ "@@@STEP_LOG_LINE@python.inline@cpu = int(sys.argv[3])@@@",
"@@@STEP_LOG_LINE@python.inline@log = subprocess.check_output([ADB, 'root'])@@@",
"@@@STEP_LOG_LINE@python.inline@# check for message like 'adbd cannot run as root in production builds'@@@",
"@@@STEP_LOG_LINE@python.inline@print log@@@",
"@@@STEP_LOG_LINE@python.inline@if 'cannot' in log:@@@",
"@@@STEP_LOG_LINE@python.inline@ raise Exception('adb root failed')@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@if model == 'Nexus7':@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Nexus7 claims to support 1300000, but only really allows 1200000@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = [51000, 102000, 204000, 340000, 475000, 640000, 760000,@@@",
- "@@@STEP_LOG_LINE@python.inline@ 860000, 1000000, 1100000, 1200000]@@@",
+ "@@@STEP_LOG_LINE@python.inline@root = '/sys/devices/system/cpu/cpu%d/cpufreq' %cpu@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@# All devices we test on give a list of their available frequencies.@@@",
+ "@@@STEP_LOG_LINE@python.inline@available_freqs = subprocess.check_output([ADB, 'shell',@@@",
+ "@@@STEP_LOG_LINE@python.inline@ 'cat %s/scaling_available_frequencies' % root])@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@# Check for message like '/system/bin/sh: file not found'@@@",
+ "@@@STEP_LOG_LINE@python.inline@if available_freqs and '/system/bin/sh' not in available_freqs:@@@",
+ "@@@STEP_LOG_LINE@python.inline@ available_freqs = sorted(@@@",
+ "@@@STEP_LOG_LINE@python.inline@ int(i) for i in available_freqs.strip().split())@@@",
"@@@STEP_LOG_LINE@python.inline@else:@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Temporary logging to get a sense of what devices have multiple cpus@@@",
- "@@@STEP_LOG_LINE@python.inline@ try:@@@",
- "@@@STEP_LOG_LINE@python.inline@ print subprocess.check_output([ADB, 'shell', 'cat ',@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu?/cpufreq/affected_cpus'])@@@",
- "@@@STEP_LOG_LINE@python.inline@ print subprocess.check_output([ADB, 'shell', 'cat ',@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu?/cpufreq/scaling_available_frequencies'])@@@",
- "@@@STEP_LOG_LINE@python.inline@ except Exception as e:@@@",
- "@@@STEP_LOG_LINE@python.inline@ print e.output.strip()@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Most devices give a list of their available frequencies.@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = subprocess.check_output([ADB, 'shell', 'cat '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies'])@@@",
- "@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Check for message like '/system/bin/sh: file not found'@@@",
- "@@@STEP_LOG_LINE@python.inline@ if available_freqs and '/system/bin/sh' not in available_freqs:@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = sorted(@@@",
- "@@@STEP_LOG_LINE@python.inline@ int(i) for i in available_freqs.strip().split())@@@",
- "@@@STEP_LOG_LINE@python.inline@ else:@@@",
- "@@@STEP_LOG_LINE@python.inline@ raise Exception('Could not get list of available frequencies: %s' %@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs)@@@",
+ "@@@STEP_LOG_LINE@python.inline@ raise Exception('Could not get list of available frequencies: %s' %@@@",
+ "@@@STEP_LOG_LINE@python.inline@ available_freqs)@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@maxfreq = available_freqs[-1]@@@",
"@@@STEP_LOG_LINE@python.inline@target = int(round(maxfreq * target_percent))@@@",
@@ -787,21 +838,19 @@
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@print 'Setting frequency to %d' % freq@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo \"userspace\" > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor'])@@@",
"@@@STEP_LOG_LINE@python.inline@# If scaling_max_freq is lower than our attempted setting, it won't take.@@@",
"@@@STEP_LOG_LINE@python.inline@# We must set min first, because if we try to set max to be less than min@@@",
"@@@STEP_LOG_LINE@python.inline@# (which sometimes happens after certain devices reboot) it returns a@@@",
"@@@STEP_LOG_LINE@python.inline@# perplexing permissions error.@@@",
"@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo 0 > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq'])@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '%s/scaling_min_freq' % root])@@@",
"@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo %d > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '%s/scaling_max_freq' % (freq, root)])@@@",
"@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo %d > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed' % freq])@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '%s/scaling_setspeed' % (freq, root)])@@@",
"@@@STEP_LOG_LINE@python.inline@time.sleep(5)@@@",
"@@@STEP_LOG_LINE@python.inline@actual_freq = subprocess.check_output([ADB, 'shell', 'cat '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq']).strip()@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '%s/scaling_cur_freq' % root]).strip()@@@",
"@@@STEP_LOG_LINE@python.inline@if actual_freq != str(freq):@@@",
"@@@STEP_LOG_LINE@python.inline@ raise Exception('(actual, expected) (%s, %d)'@@@",
"@@@STEP_LOG_LINE@python.inline@ % (actual_freq, freq))@@@",
@@ -878,7 +927,7 @@
},
{
"name": "$result",
- "reason": "Failed build steps: Scale CPU to 0.600000, Scale CPU to 0.600000 (attempt 2), Scale CPU to 0.600000 (attempt 3), Scale CPU to 0.600000 (attempt 3)",
+ "reason": "Failed build steps: Scale CPU 2 to 0.600000, Scale CPU 2 to 0.600000 (attempt 2), Scale CPU 2 to 0.600000 (attempt 3), Scale CPU 2 to 0.600000 (attempt 3)",
"recipe_result": null,
"status_code": 1
}
diff --git a/infra/bots/recipes/perf.expected/cpu_scale_failed_once.json b/infra/bots/recipes/perf.expected/cpu_scale_failed_once.json
index f5b597e92e..3cb0caacff 100644
--- a/infra/bots/recipes/perf.expected/cpu_scale_failed_once.json
+++ b/infra/bots/recipes/perf.expected/cpu_scale_failed_once.json
@@ -540,10 +540,10 @@
"cmd": [
"python",
"-u",
- "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\nmodel = sys.argv[2]\ntarget_percent = float(sys.argv[3])\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nif model == 'Nexus7':\n # Nexus7 claims to support 1300000, but only really allows 1200000\n available_freqs = [51000, 102000, 204000, 340000, 475000, 640000, 760000,\n 860000, 1000000, 1100000, 1200000]\nelse:\n # Temporary logging to get a sense of what devices have multiple cpus\n try:\n print subprocess.check_output([ADB, 'shell', 'cat ',\n '/sys/devices/system/cpu/cpu?/cpufreq/affected_cpus'])\n print subprocess.check_output([ADB, 'shell', 'cat ',\n '/sys/devices/system/cpu/cpu?/cpufreq/scaling_available_frequencies'])\n except Exception as e:\n print e.output.strip()\n # Most devices give a list of their available frequencies.\n available_freqs = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies'])\n\n # Check for message like '/system/bin/sh: file not found'\n if available_freqs and '/system/bin/sh' not in available_freqs:\n available_freqs = sorted(\n int(i) for i in available_freqs.strip().split())\n else:\n raise Exception('Could not get list of available frequencies: %s' %\n available_freqs)\n\nmaxfreq = available_freqs[-1]\ntarget = int(round(maxfreq * target_percent))\nfreq = maxfreq\nfor f in reversed(available_freqs):\n if f <= target:\n freq = f\n break\n\nprint 'Setting frequency to %d' % freq\n\nsubprocess.check_output([ADB, 'shell', 'echo \"userspace\" > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor'])\n# If scaling_max_freq is lower than our attempted setting, it won't take.\n# We must set min first, because if we try to set max to be less than min\n# (which sometimes happens after certain devices reboot) it returns a\n# perplexing permissions error.\nsubprocess.check_output([ADB, 'shell', 'echo 0 > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq'])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed' % freq])\ntime.sleep(5)\nactual_freq = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq']).strip()\nif actual_freq != str(freq):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_freq, freq))\n",
+ "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ncpu = int(sys.argv[2])\ngov = sys.argv[3]\n\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nsubprocess.check_output([ADB, 'shell', 'echo \"%s\" > '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])\nactual_gov = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()\nif actual_gov != str(gov):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_gov, gov))\n",
"/usr/bin/adb.1.0.35",
- "NexusPlayer",
- "0.6"
+ "0",
+ "powersave"
],
"env": {
"BUILDTYPE": "Debug",
@@ -552,7 +552,95 @@
"SKIA_OUT": "[START_DIR]/out"
},
"infra_step": true,
- "name": "Scale CPU to 0.600000",
+ "name": "Set CPU 0's governor to powersave",
+ "timeout": 30,
+ "~followup_annotations": [
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@import os@@@",
+ "@@@STEP_LOG_LINE@python.inline@import subprocess@@@",
+ "@@@STEP_LOG_LINE@python.inline@import sys@@@",
+ "@@@STEP_LOG_LINE@python.inline@import time@@@",
+ "@@@STEP_LOG_LINE@python.inline@ADB = sys.argv[1]@@@",
+ "@@@STEP_LOG_LINE@python.inline@cpu = int(sys.argv[2])@@@",
+ "@@@STEP_LOG_LINE@python.inline@gov = sys.argv[3]@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@log = subprocess.check_output([ADB, 'root'])@@@",
+ "@@@STEP_LOG_LINE@python.inline@# check for message like 'adbd cannot run as root in production builds'@@@",
+ "@@@STEP_LOG_LINE@python.inline@print log@@@",
+ "@@@STEP_LOG_LINE@python.inline@if 'cannot' in log:@@@",
+ "@@@STEP_LOG_LINE@python.inline@ raise Exception('adb root failed')@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo \"%s\" > '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])@@@",
+ "@@@STEP_LOG_LINE@python.inline@actual_gov = subprocess.check_output([ADB, 'shell', 'cat '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()@@@",
+ "@@@STEP_LOG_LINE@python.inline@if actual_gov != str(gov):@@@",
+ "@@@STEP_LOG_LINE@python.inline@ raise Exception('(actual, expected) (%s, %d)'@@@",
+ "@@@STEP_LOG_LINE@python.inline@ % (actual_gov, gov))@@@",
+ "@@@STEP_LOG_END@python.inline@@@"
+ ]
+ },
+ {
+ "cmd": [
+ "python",
+ "-u",
+ "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ncpu = int(sys.argv[2])\ngov = sys.argv[3]\n\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nsubprocess.check_output([ADB, 'shell', 'echo \"%s\" > '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])\nactual_gov = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()\nif actual_gov != str(gov):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_gov, gov))\n",
+ "/usr/bin/adb.1.0.35",
+ "2",
+ "userspace"
+ ],
+ "env": {
+ "BUILDTYPE": "Debug",
+ "CHROME_HEADLESS": "1",
+ "PATH": "<PATH>:RECIPE_PACKAGE_REPO[depot_tools]",
+ "SKIA_OUT": "[START_DIR]/out"
+ },
+ "infra_step": true,
+ "name": "Set CPU 2's governor to userspace",
+ "timeout": 30,
+ "~followup_annotations": [
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@import os@@@",
+ "@@@STEP_LOG_LINE@python.inline@import subprocess@@@",
+ "@@@STEP_LOG_LINE@python.inline@import sys@@@",
+ "@@@STEP_LOG_LINE@python.inline@import time@@@",
+ "@@@STEP_LOG_LINE@python.inline@ADB = sys.argv[1]@@@",
+ "@@@STEP_LOG_LINE@python.inline@cpu = int(sys.argv[2])@@@",
+ "@@@STEP_LOG_LINE@python.inline@gov = sys.argv[3]@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@log = subprocess.check_output([ADB, 'root'])@@@",
+ "@@@STEP_LOG_LINE@python.inline@# check for message like 'adbd cannot run as root in production builds'@@@",
+ "@@@STEP_LOG_LINE@python.inline@print log@@@",
+ "@@@STEP_LOG_LINE@python.inline@if 'cannot' in log:@@@",
+ "@@@STEP_LOG_LINE@python.inline@ raise Exception('adb root failed')@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo \"%s\" > '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])@@@",
+ "@@@STEP_LOG_LINE@python.inline@actual_gov = subprocess.check_output([ADB, 'shell', 'cat '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()@@@",
+ "@@@STEP_LOG_LINE@python.inline@if actual_gov != str(gov):@@@",
+ "@@@STEP_LOG_LINE@python.inline@ raise Exception('(actual, expected) (%s, %d)'@@@",
+ "@@@STEP_LOG_LINE@python.inline@ % (actual_gov, gov))@@@",
+ "@@@STEP_LOG_END@python.inline@@@"
+ ]
+ },
+ {
+ "cmd": [
+ "python",
+ "-u",
+ "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ntarget_percent = float(sys.argv[2])\ncpu = int(sys.argv[3])\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nroot = '/sys/devices/system/cpu/cpu%d/cpufreq' %cpu\n\n# All devices we test on give a list of their available frequencies.\navailable_freqs = subprocess.check_output([ADB, 'shell',\n 'cat %s/scaling_available_frequencies' % root])\n\n# Check for message like '/system/bin/sh: file not found'\nif available_freqs and '/system/bin/sh' not in available_freqs:\n available_freqs = sorted(\n int(i) for i in available_freqs.strip().split())\nelse:\n raise Exception('Could not get list of available frequencies: %s' %\n available_freqs)\n\nmaxfreq = available_freqs[-1]\ntarget = int(round(maxfreq * target_percent))\nfreq = maxfreq\nfor f in reversed(available_freqs):\n if f <= target:\n freq = f\n break\n\nprint 'Setting frequency to %d' % freq\n\n# If scaling_max_freq is lower than our attempted setting, it won't take.\n# We must set min first, because if we try to set max to be less than min\n# (which sometimes happens after certain devices reboot) it returns a\n# perplexing permissions error.\nsubprocess.check_output([ADB, 'shell', 'echo 0 > '\n '%s/scaling_min_freq' % root])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '%s/scaling_max_freq' % (freq, root)])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '%s/scaling_setspeed' % (freq, root)])\ntime.sleep(5)\nactual_freq = subprocess.check_output([ADB, 'shell', 'cat '\n '%s/scaling_cur_freq' % root]).strip()\nif actual_freq != str(freq):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_freq, freq))\n",
+ "/usr/bin/adb.1.0.35",
+ "0.6",
+ "2"
+ ],
+ "env": {
+ "BUILDTYPE": "Debug",
+ "CHROME_HEADLESS": "1",
+ "PATH": "<PATH>:RECIPE_PACKAGE_REPO[depot_tools]",
+ "SKIA_OUT": "[START_DIR]/out"
+ },
+ "infra_step": true,
+ "name": "Scale CPU 2 to 0.600000",
"timeout": 30,
"~followup_annotations": [
"step returned non-zero exit code: 1",
@@ -562,38 +650,27 @@
"@@@STEP_LOG_LINE@python.inline@import sys@@@",
"@@@STEP_LOG_LINE@python.inline@import time@@@",
"@@@STEP_LOG_LINE@python.inline@ADB = sys.argv[1]@@@",
- "@@@STEP_LOG_LINE@python.inline@model = sys.argv[2]@@@",
- "@@@STEP_LOG_LINE@python.inline@target_percent = float(sys.argv[3])@@@",
+ "@@@STEP_LOG_LINE@python.inline@target_percent = float(sys.argv[2])@@@",
+ "@@@STEP_LOG_LINE@python.inline@cpu = int(sys.argv[3])@@@",
"@@@STEP_LOG_LINE@python.inline@log = subprocess.check_output([ADB, 'root'])@@@",
"@@@STEP_LOG_LINE@python.inline@# check for message like 'adbd cannot run as root in production builds'@@@",
"@@@STEP_LOG_LINE@python.inline@print log@@@",
"@@@STEP_LOG_LINE@python.inline@if 'cannot' in log:@@@",
"@@@STEP_LOG_LINE@python.inline@ raise Exception('adb root failed')@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@if model == 'Nexus7':@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Nexus7 claims to support 1300000, but only really allows 1200000@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = [51000, 102000, 204000, 340000, 475000, 640000, 760000,@@@",
- "@@@STEP_LOG_LINE@python.inline@ 860000, 1000000, 1100000, 1200000]@@@",
- "@@@STEP_LOG_LINE@python.inline@else:@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Temporary logging to get a sense of what devices have multiple cpus@@@",
- "@@@STEP_LOG_LINE@python.inline@ try:@@@",
- "@@@STEP_LOG_LINE@python.inline@ print subprocess.check_output([ADB, 'shell', 'cat ',@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu?/cpufreq/affected_cpus'])@@@",
- "@@@STEP_LOG_LINE@python.inline@ print subprocess.check_output([ADB, 'shell', 'cat ',@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu?/cpufreq/scaling_available_frequencies'])@@@",
- "@@@STEP_LOG_LINE@python.inline@ except Exception as e:@@@",
- "@@@STEP_LOG_LINE@python.inline@ print e.output.strip()@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Most devices give a list of their available frequencies.@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = subprocess.check_output([ADB, 'shell', 'cat '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies'])@@@",
+ "@@@STEP_LOG_LINE@python.inline@root = '/sys/devices/system/cpu/cpu%d/cpufreq' %cpu@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@# All devices we test on give a list of their available frequencies.@@@",
+ "@@@STEP_LOG_LINE@python.inline@available_freqs = subprocess.check_output([ADB, 'shell',@@@",
+ "@@@STEP_LOG_LINE@python.inline@ 'cat %s/scaling_available_frequencies' % root])@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Check for message like '/system/bin/sh: file not found'@@@",
- "@@@STEP_LOG_LINE@python.inline@ if available_freqs and '/system/bin/sh' not in available_freqs:@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = sorted(@@@",
- "@@@STEP_LOG_LINE@python.inline@ int(i) for i in available_freqs.strip().split())@@@",
- "@@@STEP_LOG_LINE@python.inline@ else:@@@",
- "@@@STEP_LOG_LINE@python.inline@ raise Exception('Could not get list of available frequencies: %s' %@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs)@@@",
+ "@@@STEP_LOG_LINE@python.inline@# Check for message like '/system/bin/sh: file not found'@@@",
+ "@@@STEP_LOG_LINE@python.inline@if available_freqs and '/system/bin/sh' not in available_freqs:@@@",
+ "@@@STEP_LOG_LINE@python.inline@ available_freqs = sorted(@@@",
+ "@@@STEP_LOG_LINE@python.inline@ int(i) for i in available_freqs.strip().split())@@@",
+ "@@@STEP_LOG_LINE@python.inline@else:@@@",
+ "@@@STEP_LOG_LINE@python.inline@ raise Exception('Could not get list of available frequencies: %s' %@@@",
+ "@@@STEP_LOG_LINE@python.inline@ available_freqs)@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@maxfreq = available_freqs[-1]@@@",
"@@@STEP_LOG_LINE@python.inline@target = int(round(maxfreq * target_percent))@@@",
@@ -605,21 +682,19 @@
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@print 'Setting frequency to %d' % freq@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo \"userspace\" > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor'])@@@",
"@@@STEP_LOG_LINE@python.inline@# If scaling_max_freq is lower than our attempted setting, it won't take.@@@",
"@@@STEP_LOG_LINE@python.inline@# We must set min first, because if we try to set max to be less than min@@@",
"@@@STEP_LOG_LINE@python.inline@# (which sometimes happens after certain devices reboot) it returns a@@@",
"@@@STEP_LOG_LINE@python.inline@# perplexing permissions error.@@@",
"@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo 0 > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq'])@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '%s/scaling_min_freq' % root])@@@",
"@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo %d > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '%s/scaling_max_freq' % (freq, root)])@@@",
"@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo %d > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed' % freq])@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '%s/scaling_setspeed' % (freq, root)])@@@",
"@@@STEP_LOG_LINE@python.inline@time.sleep(5)@@@",
"@@@STEP_LOG_LINE@python.inline@actual_freq = subprocess.check_output([ADB, 'shell', 'cat '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq']).strip()@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '%s/scaling_cur_freq' % root]).strip()@@@",
"@@@STEP_LOG_LINE@python.inline@if actual_freq != str(freq):@@@",
"@@@STEP_LOG_LINE@python.inline@ raise Exception('(actual, expected) (%s, %d)'@@@",
"@@@STEP_LOG_LINE@python.inline@ % (actual_freq, freq))@@@",
@@ -631,10 +706,10 @@
"cmd": [
"python",
"-u",
- "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\nmodel = sys.argv[2]\ntarget_percent = float(sys.argv[3])\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nif model == 'Nexus7':\n # Nexus7 claims to support 1300000, but only really allows 1200000\n available_freqs = [51000, 102000, 204000, 340000, 475000, 640000, 760000,\n 860000, 1000000, 1100000, 1200000]\nelse:\n # Temporary logging to get a sense of what devices have multiple cpus\n try:\n print subprocess.check_output([ADB, 'shell', 'cat ',\n '/sys/devices/system/cpu/cpu?/cpufreq/affected_cpus'])\n print subprocess.check_output([ADB, 'shell', 'cat ',\n '/sys/devices/system/cpu/cpu?/cpufreq/scaling_available_frequencies'])\n except Exception as e:\n print e.output.strip()\n # Most devices give a list of their available frequencies.\n available_freqs = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies'])\n\n # Check for message like '/system/bin/sh: file not found'\n if available_freqs and '/system/bin/sh' not in available_freqs:\n available_freqs = sorted(\n int(i) for i in available_freqs.strip().split())\n else:\n raise Exception('Could not get list of available frequencies: %s' %\n available_freqs)\n\nmaxfreq = available_freqs[-1]\ntarget = int(round(maxfreq * target_percent))\nfreq = maxfreq\nfor f in reversed(available_freqs):\n if f <= target:\n freq = f\n break\n\nprint 'Setting frequency to %d' % freq\n\nsubprocess.check_output([ADB, 'shell', 'echo \"userspace\" > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor'])\n# If scaling_max_freq is lower than our attempted setting, it won't take.\n# We must set min first, because if we try to set max to be less than min\n# (which sometimes happens after certain devices reboot) it returns a\n# perplexing permissions error.\nsubprocess.check_output([ADB, 'shell', 'echo 0 > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq'])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed' % freq])\ntime.sleep(5)\nactual_freq = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq']).strip()\nif actual_freq != str(freq):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_freq, freq))\n",
+ "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ntarget_percent = float(sys.argv[2])\ncpu = int(sys.argv[3])\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nroot = '/sys/devices/system/cpu/cpu%d/cpufreq' %cpu\n\n# All devices we test on give a list of their available frequencies.\navailable_freqs = subprocess.check_output([ADB, 'shell',\n 'cat %s/scaling_available_frequencies' % root])\n\n# Check for message like '/system/bin/sh: file not found'\nif available_freqs and '/system/bin/sh' not in available_freqs:\n available_freqs = sorted(\n int(i) for i in available_freqs.strip().split())\nelse:\n raise Exception('Could not get list of available frequencies: %s' %\n available_freqs)\n\nmaxfreq = available_freqs[-1]\ntarget = int(round(maxfreq * target_percent))\nfreq = maxfreq\nfor f in reversed(available_freqs):\n if f <= target:\n freq = f\n break\n\nprint 'Setting frequency to %d' % freq\n\n# If scaling_max_freq is lower than our attempted setting, it won't take.\n# We must set min first, because if we try to set max to be less than min\n# (which sometimes happens after certain devices reboot) it returns a\n# perplexing permissions error.\nsubprocess.check_output([ADB, 'shell', 'echo 0 > '\n '%s/scaling_min_freq' % root])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '%s/scaling_max_freq' % (freq, root)])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '%s/scaling_setspeed' % (freq, root)])\ntime.sleep(5)\nactual_freq = subprocess.check_output([ADB, 'shell', 'cat '\n '%s/scaling_cur_freq' % root]).strip()\nif actual_freq != str(freq):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_freq, freq))\n",
"/usr/bin/adb.1.0.35",
- "NexusPlayer",
- "0.6"
+ "0.6",
+ "2"
],
"env": {
"BUILDTYPE": "Debug",
@@ -643,7 +718,7 @@
"SKIA_OUT": "[START_DIR]/out"
},
"infra_step": true,
- "name": "Scale CPU to 0.600000 (attempt 2)",
+ "name": "Scale CPU 2 to 0.600000 (attempt 2)",
"timeout": 30,
"~followup_annotations": [
"@@@STEP_LOG_LINE@python.inline@@@@",
@@ -652,38 +727,27 @@
"@@@STEP_LOG_LINE@python.inline@import sys@@@",
"@@@STEP_LOG_LINE@python.inline@import time@@@",
"@@@STEP_LOG_LINE@python.inline@ADB = sys.argv[1]@@@",
- "@@@STEP_LOG_LINE@python.inline@model = sys.argv[2]@@@",
- "@@@STEP_LOG_LINE@python.inline@target_percent = float(sys.argv[3])@@@",
+ "@@@STEP_LOG_LINE@python.inline@target_percent = float(sys.argv[2])@@@",
+ "@@@STEP_LOG_LINE@python.inline@cpu = int(sys.argv[3])@@@",
"@@@STEP_LOG_LINE@python.inline@log = subprocess.check_output([ADB, 'root'])@@@",
"@@@STEP_LOG_LINE@python.inline@# check for message like 'adbd cannot run as root in production builds'@@@",
"@@@STEP_LOG_LINE@python.inline@print log@@@",
"@@@STEP_LOG_LINE@python.inline@if 'cannot' in log:@@@",
"@@@STEP_LOG_LINE@python.inline@ raise Exception('adb root failed')@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@if model == 'Nexus7':@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Nexus7 claims to support 1300000, but only really allows 1200000@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = [51000, 102000, 204000, 340000, 475000, 640000, 760000,@@@",
- "@@@STEP_LOG_LINE@python.inline@ 860000, 1000000, 1100000, 1200000]@@@",
- "@@@STEP_LOG_LINE@python.inline@else:@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Temporary logging to get a sense of what devices have multiple cpus@@@",
- "@@@STEP_LOG_LINE@python.inline@ try:@@@",
- "@@@STEP_LOG_LINE@python.inline@ print subprocess.check_output([ADB, 'shell', 'cat ',@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu?/cpufreq/affected_cpus'])@@@",
- "@@@STEP_LOG_LINE@python.inline@ print subprocess.check_output([ADB, 'shell', 'cat ',@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu?/cpufreq/scaling_available_frequencies'])@@@",
- "@@@STEP_LOG_LINE@python.inline@ except Exception as e:@@@",
- "@@@STEP_LOG_LINE@python.inline@ print e.output.strip()@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Most devices give a list of their available frequencies.@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = subprocess.check_output([ADB, 'shell', 'cat '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies'])@@@",
+ "@@@STEP_LOG_LINE@python.inline@root = '/sys/devices/system/cpu/cpu%d/cpufreq' %cpu@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Check for message like '/system/bin/sh: file not found'@@@",
- "@@@STEP_LOG_LINE@python.inline@ if available_freqs and '/system/bin/sh' not in available_freqs:@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = sorted(@@@",
- "@@@STEP_LOG_LINE@python.inline@ int(i) for i in available_freqs.strip().split())@@@",
- "@@@STEP_LOG_LINE@python.inline@ else:@@@",
- "@@@STEP_LOG_LINE@python.inline@ raise Exception('Could not get list of available frequencies: %s' %@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs)@@@",
+ "@@@STEP_LOG_LINE@python.inline@# All devices we test on give a list of their available frequencies.@@@",
+ "@@@STEP_LOG_LINE@python.inline@available_freqs = subprocess.check_output([ADB, 'shell',@@@",
+ "@@@STEP_LOG_LINE@python.inline@ 'cat %s/scaling_available_frequencies' % root])@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
+ "@@@STEP_LOG_LINE@python.inline@# Check for message like '/system/bin/sh: file not found'@@@",
+ "@@@STEP_LOG_LINE@python.inline@if available_freqs and '/system/bin/sh' not in available_freqs:@@@",
+ "@@@STEP_LOG_LINE@python.inline@ available_freqs = sorted(@@@",
+ "@@@STEP_LOG_LINE@python.inline@ int(i) for i in available_freqs.strip().split())@@@",
+ "@@@STEP_LOG_LINE@python.inline@else:@@@",
+ "@@@STEP_LOG_LINE@python.inline@ raise Exception('Could not get list of available frequencies: %s' %@@@",
+ "@@@STEP_LOG_LINE@python.inline@ available_freqs)@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@maxfreq = available_freqs[-1]@@@",
"@@@STEP_LOG_LINE@python.inline@target = int(round(maxfreq * target_percent))@@@",
@@ -695,21 +759,19 @@
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@print 'Setting frequency to %d' % freq@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo \"userspace\" > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor'])@@@",
"@@@STEP_LOG_LINE@python.inline@# If scaling_max_freq is lower than our attempted setting, it won't take.@@@",
"@@@STEP_LOG_LINE@python.inline@# We must set min first, because if we try to set max to be less than min@@@",
"@@@STEP_LOG_LINE@python.inline@# (which sometimes happens after certain devices reboot) it returns a@@@",
"@@@STEP_LOG_LINE@python.inline@# perplexing permissions error.@@@",
"@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo 0 > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq'])@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '%s/scaling_min_freq' % root])@@@",
"@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo %d > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '%s/scaling_max_freq' % (freq, root)])@@@",
"@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo %d > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed' % freq])@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '%s/scaling_setspeed' % (freq, root)])@@@",
"@@@STEP_LOG_LINE@python.inline@time.sleep(5)@@@",
"@@@STEP_LOG_LINE@python.inline@actual_freq = subprocess.check_output([ADB, 'shell', 'cat '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq']).strip()@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '%s/scaling_cur_freq' % root]).strip()@@@",
"@@@STEP_LOG_LINE@python.inline@if actual_freq != str(freq):@@@",
"@@@STEP_LOG_LINE@python.inline@ raise Exception('(actual, expected) (%s, %d)'@@@",
"@@@STEP_LOG_LINE@python.inline@ % (actual_freq, freq))@@@",
diff --git a/infra/bots/recipes/perf.py b/infra/bots/recipes/perf.py
index 6737387a0b..17c73557cb 100644
--- a/infra/bots/recipes/perf.py
+++ b/infra/bots/recipes/perf.py
@@ -461,7 +461,7 @@ def GenTests(api):
'svg', 'VERSION'),
api.path['start_dir'].join('tmp', 'uninteresting_hashes.txt')
) +
- api.step_data('Scale CPU to 0.600000', retcode=1)
+ api.step_data('Scale CPU 2 to 0.600000', retcode=1)
)
yield (
@@ -480,7 +480,7 @@ def GenTests(api):
'svg', 'VERSION'),
api.path['start_dir'].join('tmp', 'uninteresting_hashes.txt')
) +
- api.step_data('Scale CPU to 0.600000', retcode=1)+
- api.step_data('Scale CPU to 0.600000 (attempt 2)', retcode=1)+
- api.step_data('Scale CPU to 0.600000 (attempt 3)', retcode=1)
+ api.step_data('Scale CPU 2 to 0.600000', retcode=1)+
+ api.step_data('Scale CPU 2 to 0.600000 (attempt 2)', retcode=1)+
+ api.step_data('Scale CPU 2 to 0.600000 (attempt 3)', retcode=1)
)
diff --git a/infra/bots/recipes/test.expected/Test-Android-Clang-AndroidOne-GPU-Mali400MP2-arm-Release-All-Android.json b/infra/bots/recipes/test.expected/Test-Android-Clang-AndroidOne-GPU-Mali400MP2-arm-Release-All-Android.json
index 0ba281f73a..341f13b555 100644
--- a/infra/bots/recipes/test.expected/Test-Android-Clang-AndroidOne-GPU-Mali400MP2-arm-Release-All-Android.json
+++ b/infra/bots/recipes/test.expected/Test-Android-Clang-AndroidOne-GPU-Mali400MP2-arm-Release-All-Android.json
@@ -657,10 +657,10 @@
"cmd": [
"python",
"-u",
- "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\nmodel = sys.argv[2]\ntarget_percent = float(sys.argv[3])\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nif model == 'Nexus7':\n # Nexus7 claims to support 1300000, but only really allows 1200000\n available_freqs = [51000, 102000, 204000, 340000, 475000, 640000, 760000,\n 860000, 1000000, 1100000, 1200000]\nelse:\n # Temporary logging to get a sense of what devices have multiple cpus\n try:\n print subprocess.check_output([ADB, 'shell', 'cat ',\n '/sys/devices/system/cpu/cpu?/cpufreq/affected_cpus'])\n print subprocess.check_output([ADB, 'shell', 'cat ',\n '/sys/devices/system/cpu/cpu?/cpufreq/scaling_available_frequencies'])\n except Exception as e:\n print e.output.strip()\n # Most devices give a list of their available frequencies.\n available_freqs = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies'])\n\n # Check for message like '/system/bin/sh: file not found'\n if available_freqs and '/system/bin/sh' not in available_freqs:\n available_freqs = sorted(\n int(i) for i in available_freqs.strip().split())\n else:\n raise Exception('Could not get list of available frequencies: %s' %\n available_freqs)\n\nmaxfreq = available_freqs[-1]\ntarget = int(round(maxfreq * target_percent))\nfreq = maxfreq\nfor f in reversed(available_freqs):\n if f <= target:\n freq = f\n break\n\nprint 'Setting frequency to %d' % freq\n\nsubprocess.check_output([ADB, 'shell', 'echo \"userspace\" > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor'])\n# If scaling_max_freq is lower than our attempted setting, it won't take.\n# We must set min first, because if we try to set max to be less than min\n# (which sometimes happens after certain devices reboot) it returns a\n# perplexing permissions error.\nsubprocess.check_output([ADB, 'shell', 'echo 0 > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq'])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed' % freq])\ntime.sleep(5)\nactual_freq = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq']).strip()\nif actual_freq != str(freq):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_freq, freq))\n",
+ "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ncpu = int(sys.argv[2])\ngov = sys.argv[3]\n\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nsubprocess.check_output([ADB, 'shell', 'echo \"%s\" > '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])\nactual_gov = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()\nif actual_gov != str(gov):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_gov, gov))\n",
"/usr/bin/adb.1.0.35",
- "AndroidOne",
- "1.0"
+ "0",
+ "ondemand"
],
"env": {
"BUILDTYPE": "Release",
@@ -669,7 +669,7 @@
"SKIA_OUT": "[START_DIR]/out"
},
"infra_step": true,
- "name": "Scale CPU to 1.000000",
+ "name": "Set CPU 0's governor to ondemand",
"timeout": 30,
"~followup_annotations": [
"@@@STEP_LOG_LINE@python.inline@@@@",
@@ -678,67 +678,22 @@
"@@@STEP_LOG_LINE@python.inline@import sys@@@",
"@@@STEP_LOG_LINE@python.inline@import time@@@",
"@@@STEP_LOG_LINE@python.inline@ADB = sys.argv[1]@@@",
- "@@@STEP_LOG_LINE@python.inline@model = sys.argv[2]@@@",
- "@@@STEP_LOG_LINE@python.inline@target_percent = float(sys.argv[3])@@@",
+ "@@@STEP_LOG_LINE@python.inline@cpu = int(sys.argv[2])@@@",
+ "@@@STEP_LOG_LINE@python.inline@gov = sys.argv[3]@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@log = subprocess.check_output([ADB, 'root'])@@@",
"@@@STEP_LOG_LINE@python.inline@# check for message like 'adbd cannot run as root in production builds'@@@",
"@@@STEP_LOG_LINE@python.inline@print log@@@",
"@@@STEP_LOG_LINE@python.inline@if 'cannot' in log:@@@",
"@@@STEP_LOG_LINE@python.inline@ raise Exception('adb root failed')@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@if model == 'Nexus7':@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Nexus7 claims to support 1300000, but only really allows 1200000@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = [51000, 102000, 204000, 340000, 475000, 640000, 760000,@@@",
- "@@@STEP_LOG_LINE@python.inline@ 860000, 1000000, 1100000, 1200000]@@@",
- "@@@STEP_LOG_LINE@python.inline@else:@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Temporary logging to get a sense of what devices have multiple cpus@@@",
- "@@@STEP_LOG_LINE@python.inline@ try:@@@",
- "@@@STEP_LOG_LINE@python.inline@ print subprocess.check_output([ADB, 'shell', 'cat ',@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu?/cpufreq/affected_cpus'])@@@",
- "@@@STEP_LOG_LINE@python.inline@ print subprocess.check_output([ADB, 'shell', 'cat ',@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu?/cpufreq/scaling_available_frequencies'])@@@",
- "@@@STEP_LOG_LINE@python.inline@ except Exception as e:@@@",
- "@@@STEP_LOG_LINE@python.inline@ print e.output.strip()@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Most devices give a list of their available frequencies.@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = subprocess.check_output([ADB, 'shell', 'cat '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies'])@@@",
- "@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Check for message like '/system/bin/sh: file not found'@@@",
- "@@@STEP_LOG_LINE@python.inline@ if available_freqs and '/system/bin/sh' not in available_freqs:@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = sorted(@@@",
- "@@@STEP_LOG_LINE@python.inline@ int(i) for i in available_freqs.strip().split())@@@",
- "@@@STEP_LOG_LINE@python.inline@ else:@@@",
- "@@@STEP_LOG_LINE@python.inline@ raise Exception('Could not get list of available frequencies: %s' %@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs)@@@",
- "@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@maxfreq = available_freqs[-1]@@@",
- "@@@STEP_LOG_LINE@python.inline@target = int(round(maxfreq * target_percent))@@@",
- "@@@STEP_LOG_LINE@python.inline@freq = maxfreq@@@",
- "@@@STEP_LOG_LINE@python.inline@for f in reversed(available_freqs):@@@",
- "@@@STEP_LOG_LINE@python.inline@ if f <= target:@@@",
- "@@@STEP_LOG_LINE@python.inline@ freq = f@@@",
- "@@@STEP_LOG_LINE@python.inline@ break@@@",
- "@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@print 'Setting frequency to %d' % freq@@@",
- "@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo \"userspace\" > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor'])@@@",
- "@@@STEP_LOG_LINE@python.inline@# If scaling_max_freq is lower than our attempted setting, it won't take.@@@",
- "@@@STEP_LOG_LINE@python.inline@# We must set min first, because if we try to set max to be less than min@@@",
- "@@@STEP_LOG_LINE@python.inline@# (which sometimes happens after certain devices reboot) it returns a@@@",
- "@@@STEP_LOG_LINE@python.inline@# perplexing permissions error.@@@",
- "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo 0 > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq'])@@@",
- "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo %d > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])@@@",
- "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo %d > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed' % freq])@@@",
- "@@@STEP_LOG_LINE@python.inline@time.sleep(5)@@@",
- "@@@STEP_LOG_LINE@python.inline@actual_freq = subprocess.check_output([ADB, 'shell', 'cat '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq']).strip()@@@",
- "@@@STEP_LOG_LINE@python.inline@if actual_freq != str(freq):@@@",
+ "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo \"%s\" > '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])@@@",
+ "@@@STEP_LOG_LINE@python.inline@actual_gov = subprocess.check_output([ADB, 'shell', 'cat '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()@@@",
+ "@@@STEP_LOG_LINE@python.inline@if actual_gov != str(gov):@@@",
"@@@STEP_LOG_LINE@python.inline@ raise Exception('(actual, expected) (%s, %d)'@@@",
- "@@@STEP_LOG_LINE@python.inline@ % (actual_freq, freq))@@@",
+ "@@@STEP_LOG_LINE@python.inline@ % (actual_gov, gov))@@@",
"@@@STEP_LOG_END@python.inline@@@"
]
},
diff --git a/infra/bots/recipes/test.expected/Test-Android-Clang-Nexus5-GPU-Adreno330-arm-Release-All-Android.json b/infra/bots/recipes/test.expected/Test-Android-Clang-Nexus5-GPU-Adreno330-arm-Release-All-Android.json
index 601f3a14af..5d7c05b28f 100644
--- a/infra/bots/recipes/test.expected/Test-Android-Clang-Nexus5-GPU-Adreno330-arm-Release-All-Android.json
+++ b/infra/bots/recipes/test.expected/Test-Android-Clang-Nexus5-GPU-Adreno330-arm-Release-All-Android.json
@@ -657,10 +657,10 @@
"cmd": [
"python",
"-u",
- "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\nmodel = sys.argv[2]\ntarget_percent = float(sys.argv[3])\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nif model == 'Nexus7':\n # Nexus7 claims to support 1300000, but only really allows 1200000\n available_freqs = [51000, 102000, 204000, 340000, 475000, 640000, 760000,\n 860000, 1000000, 1100000, 1200000]\nelse:\n # Temporary logging to get a sense of what devices have multiple cpus\n try:\n print subprocess.check_output([ADB, 'shell', 'cat ',\n '/sys/devices/system/cpu/cpu?/cpufreq/affected_cpus'])\n print subprocess.check_output([ADB, 'shell', 'cat ',\n '/sys/devices/system/cpu/cpu?/cpufreq/scaling_available_frequencies'])\n except Exception as e:\n print e.output.strip()\n # Most devices give a list of their available frequencies.\n available_freqs = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies'])\n\n # Check for message like '/system/bin/sh: file not found'\n if available_freqs and '/system/bin/sh' not in available_freqs:\n available_freqs = sorted(\n int(i) for i in available_freqs.strip().split())\n else:\n raise Exception('Could not get list of available frequencies: %s' %\n available_freqs)\n\nmaxfreq = available_freqs[-1]\ntarget = int(round(maxfreq * target_percent))\nfreq = maxfreq\nfor f in reversed(available_freqs):\n if f <= target:\n freq = f\n break\n\nprint 'Setting frequency to %d' % freq\n\nsubprocess.check_output([ADB, 'shell', 'echo \"userspace\" > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor'])\n# If scaling_max_freq is lower than our attempted setting, it won't take.\n# We must set min first, because if we try to set max to be less than min\n# (which sometimes happens after certain devices reboot) it returns a\n# perplexing permissions error.\nsubprocess.check_output([ADB, 'shell', 'echo 0 > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq'])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed' % freq])\ntime.sleep(5)\nactual_freq = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq']).strip()\nif actual_freq != str(freq):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_freq, freq))\n",
+ "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ncpu = int(sys.argv[2])\ngov = sys.argv[3]\n\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nsubprocess.check_output([ADB, 'shell', 'echo \"%s\" > '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])\nactual_gov = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()\nif actual_gov != str(gov):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_gov, gov))\n",
"/usr/bin/adb.1.0.35",
- "Nexus5",
- "1.0"
+ "0",
+ "ondemand"
],
"env": {
"BUILDTYPE": "Release",
@@ -669,7 +669,7 @@
"SKIA_OUT": "[START_DIR]/out"
},
"infra_step": true,
- "name": "Scale CPU to 1.000000",
+ "name": "Set CPU 0's governor to ondemand",
"timeout": 30,
"~followup_annotations": [
"@@@STEP_LOG_LINE@python.inline@@@@",
@@ -678,67 +678,22 @@
"@@@STEP_LOG_LINE@python.inline@import sys@@@",
"@@@STEP_LOG_LINE@python.inline@import time@@@",
"@@@STEP_LOG_LINE@python.inline@ADB = sys.argv[1]@@@",
- "@@@STEP_LOG_LINE@python.inline@model = sys.argv[2]@@@",
- "@@@STEP_LOG_LINE@python.inline@target_percent = float(sys.argv[3])@@@",
+ "@@@STEP_LOG_LINE@python.inline@cpu = int(sys.argv[2])@@@",
+ "@@@STEP_LOG_LINE@python.inline@gov = sys.argv[3]@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@log = subprocess.check_output([ADB, 'root'])@@@",
"@@@STEP_LOG_LINE@python.inline@# check for message like 'adbd cannot run as root in production builds'@@@",
"@@@STEP_LOG_LINE@python.inline@print log@@@",
"@@@STEP_LOG_LINE@python.inline@if 'cannot' in log:@@@",
"@@@STEP_LOG_LINE@python.inline@ raise Exception('adb root failed')@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@if model == 'Nexus7':@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Nexus7 claims to support 1300000, but only really allows 1200000@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = [51000, 102000, 204000, 340000, 475000, 640000, 760000,@@@",
- "@@@STEP_LOG_LINE@python.inline@ 860000, 1000000, 1100000, 1200000]@@@",
- "@@@STEP_LOG_LINE@python.inline@else:@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Temporary logging to get a sense of what devices have multiple cpus@@@",
- "@@@STEP_LOG_LINE@python.inline@ try:@@@",
- "@@@STEP_LOG_LINE@python.inline@ print subprocess.check_output([ADB, 'shell', 'cat ',@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu?/cpufreq/affected_cpus'])@@@",
- "@@@STEP_LOG_LINE@python.inline@ print subprocess.check_output([ADB, 'shell', 'cat ',@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu?/cpufreq/scaling_available_frequencies'])@@@",
- "@@@STEP_LOG_LINE@python.inline@ except Exception as e:@@@",
- "@@@STEP_LOG_LINE@python.inline@ print e.output.strip()@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Most devices give a list of their available frequencies.@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = subprocess.check_output([ADB, 'shell', 'cat '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies'])@@@",
- "@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Check for message like '/system/bin/sh: file not found'@@@",
- "@@@STEP_LOG_LINE@python.inline@ if available_freqs and '/system/bin/sh' not in available_freqs:@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = sorted(@@@",
- "@@@STEP_LOG_LINE@python.inline@ int(i) for i in available_freqs.strip().split())@@@",
- "@@@STEP_LOG_LINE@python.inline@ else:@@@",
- "@@@STEP_LOG_LINE@python.inline@ raise Exception('Could not get list of available frequencies: %s' %@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs)@@@",
- "@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@maxfreq = available_freqs[-1]@@@",
- "@@@STEP_LOG_LINE@python.inline@target = int(round(maxfreq * target_percent))@@@",
- "@@@STEP_LOG_LINE@python.inline@freq = maxfreq@@@",
- "@@@STEP_LOG_LINE@python.inline@for f in reversed(available_freqs):@@@",
- "@@@STEP_LOG_LINE@python.inline@ if f <= target:@@@",
- "@@@STEP_LOG_LINE@python.inline@ freq = f@@@",
- "@@@STEP_LOG_LINE@python.inline@ break@@@",
- "@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@print 'Setting frequency to %d' % freq@@@",
- "@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo \"userspace\" > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor'])@@@",
- "@@@STEP_LOG_LINE@python.inline@# If scaling_max_freq is lower than our attempted setting, it won't take.@@@",
- "@@@STEP_LOG_LINE@python.inline@# We must set min first, because if we try to set max to be less than min@@@",
- "@@@STEP_LOG_LINE@python.inline@# (which sometimes happens after certain devices reboot) it returns a@@@",
- "@@@STEP_LOG_LINE@python.inline@# perplexing permissions error.@@@",
- "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo 0 > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq'])@@@",
- "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo %d > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])@@@",
- "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo %d > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed' % freq])@@@",
- "@@@STEP_LOG_LINE@python.inline@time.sleep(5)@@@",
- "@@@STEP_LOG_LINE@python.inline@actual_freq = subprocess.check_output([ADB, 'shell', 'cat '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq']).strip()@@@",
- "@@@STEP_LOG_LINE@python.inline@if actual_freq != str(freq):@@@",
+ "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo \"%s\" > '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])@@@",
+ "@@@STEP_LOG_LINE@python.inline@actual_gov = subprocess.check_output([ADB, 'shell', 'cat '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()@@@",
+ "@@@STEP_LOG_LINE@python.inline@if actual_gov != str(gov):@@@",
"@@@STEP_LOG_LINE@python.inline@ raise Exception('(actual, expected) (%s, %d)'@@@",
- "@@@STEP_LOG_LINE@python.inline@ % (actual_freq, freq))@@@",
+ "@@@STEP_LOG_LINE@python.inline@ % (actual_gov, gov))@@@",
"@@@STEP_LOG_END@python.inline@@@"
]
},
diff --git a/infra/bots/recipes/test.expected/Test-Android-Clang-Nexus5x-GPU-Adreno418-arm64-Debug-All-Android_NoGPUThreads.json b/infra/bots/recipes/test.expected/Test-Android-Clang-Nexus5x-GPU-Adreno418-arm64-Debug-All-Android_NoGPUThreads.json
index 2c550bad53..46b256cbe4 100644
--- a/infra/bots/recipes/test.expected/Test-Android-Clang-Nexus5x-GPU-Adreno418-arm64-Debug-All-Android_NoGPUThreads.json
+++ b/infra/bots/recipes/test.expected/Test-Android-Clang-Nexus5x-GPU-Adreno418-arm64-Debug-All-Android_NoGPUThreads.json
@@ -657,10 +657,10 @@
"cmd": [
"python",
"-u",
- "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\nmodel = sys.argv[2]\ntarget_percent = float(sys.argv[3])\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nif model == 'Nexus7':\n # Nexus7 claims to support 1300000, but only really allows 1200000\n available_freqs = [51000, 102000, 204000, 340000, 475000, 640000, 760000,\n 860000, 1000000, 1100000, 1200000]\nelse:\n # Temporary logging to get a sense of what devices have multiple cpus\n try:\n print subprocess.check_output([ADB, 'shell', 'cat ',\n '/sys/devices/system/cpu/cpu?/cpufreq/affected_cpus'])\n print subprocess.check_output([ADB, 'shell', 'cat ',\n '/sys/devices/system/cpu/cpu?/cpufreq/scaling_available_frequencies'])\n except Exception as e:\n print e.output.strip()\n # Most devices give a list of their available frequencies.\n available_freqs = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies'])\n\n # Check for message like '/system/bin/sh: file not found'\n if available_freqs and '/system/bin/sh' not in available_freqs:\n available_freqs = sorted(\n int(i) for i in available_freqs.strip().split())\n else:\n raise Exception('Could not get list of available frequencies: %s' %\n available_freqs)\n\nmaxfreq = available_freqs[-1]\ntarget = int(round(maxfreq * target_percent))\nfreq = maxfreq\nfor f in reversed(available_freqs):\n if f <= target:\n freq = f\n break\n\nprint 'Setting frequency to %d' % freq\n\nsubprocess.check_output([ADB, 'shell', 'echo \"userspace\" > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor'])\n# If scaling_max_freq is lower than our attempted setting, it won't take.\n# We must set min first, because if we try to set max to be less than min\n# (which sometimes happens after certain devices reboot) it returns a\n# perplexing permissions error.\nsubprocess.check_output([ADB, 'shell', 'echo 0 > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq'])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed' % freq])\ntime.sleep(5)\nactual_freq = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq']).strip()\nif actual_freq != str(freq):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_freq, freq))\n",
+ "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ncpu = int(sys.argv[2])\ngov = sys.argv[3]\n\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nsubprocess.check_output([ADB, 'shell', 'echo \"%s\" > '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])\nactual_gov = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()\nif actual_gov != str(gov):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_gov, gov))\n",
"/opt/infra-android/tools/adb",
- "Nexus5x",
- "1.0"
+ "4",
+ "ondemand"
],
"env": {
"BUILDTYPE": "Debug",
@@ -669,7 +669,7 @@
"SKIA_OUT": "[START_DIR]/out"
},
"infra_step": true,
- "name": "Scale CPU to 1.000000",
+ "name": "Set CPU 4's governor to ondemand",
"timeout": 30,
"~followup_annotations": [
"@@@STEP_LOG_LINE@python.inline@@@@",
@@ -678,67 +678,66 @@
"@@@STEP_LOG_LINE@python.inline@import sys@@@",
"@@@STEP_LOG_LINE@python.inline@import time@@@",
"@@@STEP_LOG_LINE@python.inline@ADB = sys.argv[1]@@@",
- "@@@STEP_LOG_LINE@python.inline@model = sys.argv[2]@@@",
- "@@@STEP_LOG_LINE@python.inline@target_percent = float(sys.argv[3])@@@",
+ "@@@STEP_LOG_LINE@python.inline@cpu = int(sys.argv[2])@@@",
+ "@@@STEP_LOG_LINE@python.inline@gov = sys.argv[3]@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@log = subprocess.check_output([ADB, 'root'])@@@",
"@@@STEP_LOG_LINE@python.inline@# check for message like 'adbd cannot run as root in production builds'@@@",
"@@@STEP_LOG_LINE@python.inline@print log@@@",
"@@@STEP_LOG_LINE@python.inline@if 'cannot' in log:@@@",
"@@@STEP_LOG_LINE@python.inline@ raise Exception('adb root failed')@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@if model == 'Nexus7':@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Nexus7 claims to support 1300000, but only really allows 1200000@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = [51000, 102000, 204000, 340000, 475000, 640000, 760000,@@@",
- "@@@STEP_LOG_LINE@python.inline@ 860000, 1000000, 1100000, 1200000]@@@",
- "@@@STEP_LOG_LINE@python.inline@else:@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Temporary logging to get a sense of what devices have multiple cpus@@@",
- "@@@STEP_LOG_LINE@python.inline@ try:@@@",
- "@@@STEP_LOG_LINE@python.inline@ print subprocess.check_output([ADB, 'shell', 'cat ',@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu?/cpufreq/affected_cpus'])@@@",
- "@@@STEP_LOG_LINE@python.inline@ print subprocess.check_output([ADB, 'shell', 'cat ',@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu?/cpufreq/scaling_available_frequencies'])@@@",
- "@@@STEP_LOG_LINE@python.inline@ except Exception as e:@@@",
- "@@@STEP_LOG_LINE@python.inline@ print e.output.strip()@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Most devices give a list of their available frequencies.@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = subprocess.check_output([ADB, 'shell', 'cat '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies'])@@@",
- "@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Check for message like '/system/bin/sh: file not found'@@@",
- "@@@STEP_LOG_LINE@python.inline@ if available_freqs and '/system/bin/sh' not in available_freqs:@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = sorted(@@@",
- "@@@STEP_LOG_LINE@python.inline@ int(i) for i in available_freqs.strip().split())@@@",
- "@@@STEP_LOG_LINE@python.inline@ else:@@@",
- "@@@STEP_LOG_LINE@python.inline@ raise Exception('Could not get list of available frequencies: %s' %@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs)@@@",
+ "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo \"%s\" > '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])@@@",
+ "@@@STEP_LOG_LINE@python.inline@actual_gov = subprocess.check_output([ADB, 'shell', 'cat '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()@@@",
+ "@@@STEP_LOG_LINE@python.inline@if actual_gov != str(gov):@@@",
+ "@@@STEP_LOG_LINE@python.inline@ raise Exception('(actual, expected) (%s, %d)'@@@",
+ "@@@STEP_LOG_LINE@python.inline@ % (actual_gov, gov))@@@",
+ "@@@STEP_LOG_END@python.inline@@@"
+ ]
+ },
+ {
+ "cmd": [
+ "python",
+ "-u",
+ "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ncpu = int(sys.argv[2])\ngov = sys.argv[3]\n\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nsubprocess.check_output([ADB, 'shell', 'echo \"%s\" > '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])\nactual_gov = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()\nif actual_gov != str(gov):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_gov, gov))\n",
+ "/opt/infra-android/tools/adb",
+ "0",
+ "ondemand"
+ ],
+ "env": {
+ "BUILDTYPE": "Debug",
+ "CHROME_HEADLESS": "1",
+ "PATH": "<PATH>:RECIPE_PACKAGE_REPO[depot_tools]",
+ "SKIA_OUT": "[START_DIR]/out"
+ },
+ "infra_step": true,
+ "name": "Set CPU 0's governor to ondemand",
+ "timeout": 30,
+ "~followup_annotations": [
"@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@maxfreq = available_freqs[-1]@@@",
- "@@@STEP_LOG_LINE@python.inline@target = int(round(maxfreq * target_percent))@@@",
- "@@@STEP_LOG_LINE@python.inline@freq = maxfreq@@@",
- "@@@STEP_LOG_LINE@python.inline@for f in reversed(available_freqs):@@@",
- "@@@STEP_LOG_LINE@python.inline@ if f <= target:@@@",
- "@@@STEP_LOG_LINE@python.inline@ freq = f@@@",
- "@@@STEP_LOG_LINE@python.inline@ break@@@",
+ "@@@STEP_LOG_LINE@python.inline@import os@@@",
+ "@@@STEP_LOG_LINE@python.inline@import subprocess@@@",
+ "@@@STEP_LOG_LINE@python.inline@import sys@@@",
+ "@@@STEP_LOG_LINE@python.inline@import time@@@",
+ "@@@STEP_LOG_LINE@python.inline@ADB = sys.argv[1]@@@",
+ "@@@STEP_LOG_LINE@python.inline@cpu = int(sys.argv[2])@@@",
+ "@@@STEP_LOG_LINE@python.inline@gov = sys.argv[3]@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@print 'Setting frequency to %d' % freq@@@",
+ "@@@STEP_LOG_LINE@python.inline@log = subprocess.check_output([ADB, 'root'])@@@",
+ "@@@STEP_LOG_LINE@python.inline@# check for message like 'adbd cannot run as root in production builds'@@@",
+ "@@@STEP_LOG_LINE@python.inline@print log@@@",
+ "@@@STEP_LOG_LINE@python.inline@if 'cannot' in log:@@@",
+ "@@@STEP_LOG_LINE@python.inline@ raise Exception('adb root failed')@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo \"userspace\" > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor'])@@@",
- "@@@STEP_LOG_LINE@python.inline@# If scaling_max_freq is lower than our attempted setting, it won't take.@@@",
- "@@@STEP_LOG_LINE@python.inline@# We must set min first, because if we try to set max to be less than min@@@",
- "@@@STEP_LOG_LINE@python.inline@# (which sometimes happens after certain devices reboot) it returns a@@@",
- "@@@STEP_LOG_LINE@python.inline@# perplexing permissions error.@@@",
- "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo 0 > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq'])@@@",
- "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo %d > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])@@@",
- "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo %d > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed' % freq])@@@",
- "@@@STEP_LOG_LINE@python.inline@time.sleep(5)@@@",
- "@@@STEP_LOG_LINE@python.inline@actual_freq = subprocess.check_output([ADB, 'shell', 'cat '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq']).strip()@@@",
- "@@@STEP_LOG_LINE@python.inline@if actual_freq != str(freq):@@@",
+ "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo \"%s\" > '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])@@@",
+ "@@@STEP_LOG_LINE@python.inline@actual_gov = subprocess.check_output([ADB, 'shell', 'cat '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()@@@",
+ "@@@STEP_LOG_LINE@python.inline@if actual_gov != str(gov):@@@",
"@@@STEP_LOG_LINE@python.inline@ raise Exception('(actual, expected) (%s, %d)'@@@",
- "@@@STEP_LOG_LINE@python.inline@ % (actual_freq, freq))@@@",
+ "@@@STEP_LOG_LINE@python.inline@ % (actual_gov, gov))@@@",
"@@@STEP_LOG_END@python.inline@@@"
]
},
diff --git a/infra/bots/recipes/test.expected/Test-Android-Clang-Nexus7-CPU-Tegra3-arm-Release-All-Android.json b/infra/bots/recipes/test.expected/Test-Android-Clang-Nexus7-CPU-Tegra3-arm-Release-All-Android.json
index 852ec0324b..e51978ee52 100644
--- a/infra/bots/recipes/test.expected/Test-Android-Clang-Nexus7-CPU-Tegra3-arm-Release-All-Android.json
+++ b/infra/bots/recipes/test.expected/Test-Android-Clang-Nexus7-CPU-Tegra3-arm-Release-All-Android.json
@@ -657,10 +657,10 @@
"cmd": [
"python",
"-u",
- "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\nmodel = sys.argv[2]\ntarget_percent = float(sys.argv[3])\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nif model == 'Nexus7':\n # Nexus7 claims to support 1300000, but only really allows 1200000\n available_freqs = [51000, 102000, 204000, 340000, 475000, 640000, 760000,\n 860000, 1000000, 1100000, 1200000]\nelse:\n # Temporary logging to get a sense of what devices have multiple cpus\n try:\n print subprocess.check_output([ADB, 'shell', 'cat ',\n '/sys/devices/system/cpu/cpu?/cpufreq/affected_cpus'])\n print subprocess.check_output([ADB, 'shell', 'cat ',\n '/sys/devices/system/cpu/cpu?/cpufreq/scaling_available_frequencies'])\n except Exception as e:\n print e.output.strip()\n # Most devices give a list of their available frequencies.\n available_freqs = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies'])\n\n # Check for message like '/system/bin/sh: file not found'\n if available_freqs and '/system/bin/sh' not in available_freqs:\n available_freqs = sorted(\n int(i) for i in available_freqs.strip().split())\n else:\n raise Exception('Could not get list of available frequencies: %s' %\n available_freqs)\n\nmaxfreq = available_freqs[-1]\ntarget = int(round(maxfreq * target_percent))\nfreq = maxfreq\nfor f in reversed(available_freqs):\n if f <= target:\n freq = f\n break\n\nprint 'Setting frequency to %d' % freq\n\nsubprocess.check_output([ADB, 'shell', 'echo \"userspace\" > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor'])\n# If scaling_max_freq is lower than our attempted setting, it won't take.\n# We must set min first, because if we try to set max to be less than min\n# (which sometimes happens after certain devices reboot) it returns a\n# perplexing permissions error.\nsubprocess.check_output([ADB, 'shell', 'echo 0 > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq'])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed' % freq])\ntime.sleep(5)\nactual_freq = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq']).strip()\nif actual_freq != str(freq):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_freq, freq))\n",
+ "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ncpu = int(sys.argv[2])\ngov = sys.argv[3]\n\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nsubprocess.check_output([ADB, 'shell', 'echo \"%s\" > '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])\nactual_gov = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()\nif actual_gov != str(gov):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_gov, gov))\n",
"/usr/bin/adb.1.0.35",
- "Nexus7",
- "1.0"
+ "0",
+ "ondemand"
],
"env": {
"BUILDTYPE": "Release",
@@ -669,7 +669,7 @@
"SKIA_OUT": "[START_DIR]/out"
},
"infra_step": true,
- "name": "Scale CPU to 1.000000",
+ "name": "Set CPU 0's governor to ondemand",
"timeout": 30,
"~followup_annotations": [
"@@@STEP_LOG_LINE@python.inline@@@@",
@@ -678,67 +678,22 @@
"@@@STEP_LOG_LINE@python.inline@import sys@@@",
"@@@STEP_LOG_LINE@python.inline@import time@@@",
"@@@STEP_LOG_LINE@python.inline@ADB = sys.argv[1]@@@",
- "@@@STEP_LOG_LINE@python.inline@model = sys.argv[2]@@@",
- "@@@STEP_LOG_LINE@python.inline@target_percent = float(sys.argv[3])@@@",
+ "@@@STEP_LOG_LINE@python.inline@cpu = int(sys.argv[2])@@@",
+ "@@@STEP_LOG_LINE@python.inline@gov = sys.argv[3]@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@log = subprocess.check_output([ADB, 'root'])@@@",
"@@@STEP_LOG_LINE@python.inline@# check for message like 'adbd cannot run as root in production builds'@@@",
"@@@STEP_LOG_LINE@python.inline@print log@@@",
"@@@STEP_LOG_LINE@python.inline@if 'cannot' in log:@@@",
"@@@STEP_LOG_LINE@python.inline@ raise Exception('adb root failed')@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@if model == 'Nexus7':@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Nexus7 claims to support 1300000, but only really allows 1200000@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = [51000, 102000, 204000, 340000, 475000, 640000, 760000,@@@",
- "@@@STEP_LOG_LINE@python.inline@ 860000, 1000000, 1100000, 1200000]@@@",
- "@@@STEP_LOG_LINE@python.inline@else:@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Temporary logging to get a sense of what devices have multiple cpus@@@",
- "@@@STEP_LOG_LINE@python.inline@ try:@@@",
- "@@@STEP_LOG_LINE@python.inline@ print subprocess.check_output([ADB, 'shell', 'cat ',@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu?/cpufreq/affected_cpus'])@@@",
- "@@@STEP_LOG_LINE@python.inline@ print subprocess.check_output([ADB, 'shell', 'cat ',@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu?/cpufreq/scaling_available_frequencies'])@@@",
- "@@@STEP_LOG_LINE@python.inline@ except Exception as e:@@@",
- "@@@STEP_LOG_LINE@python.inline@ print e.output.strip()@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Most devices give a list of their available frequencies.@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = subprocess.check_output([ADB, 'shell', 'cat '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies'])@@@",
- "@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Check for message like '/system/bin/sh: file not found'@@@",
- "@@@STEP_LOG_LINE@python.inline@ if available_freqs and '/system/bin/sh' not in available_freqs:@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = sorted(@@@",
- "@@@STEP_LOG_LINE@python.inline@ int(i) for i in available_freqs.strip().split())@@@",
- "@@@STEP_LOG_LINE@python.inline@ else:@@@",
- "@@@STEP_LOG_LINE@python.inline@ raise Exception('Could not get list of available frequencies: %s' %@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs)@@@",
- "@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@maxfreq = available_freqs[-1]@@@",
- "@@@STEP_LOG_LINE@python.inline@target = int(round(maxfreq * target_percent))@@@",
- "@@@STEP_LOG_LINE@python.inline@freq = maxfreq@@@",
- "@@@STEP_LOG_LINE@python.inline@for f in reversed(available_freqs):@@@",
- "@@@STEP_LOG_LINE@python.inline@ if f <= target:@@@",
- "@@@STEP_LOG_LINE@python.inline@ freq = f@@@",
- "@@@STEP_LOG_LINE@python.inline@ break@@@",
- "@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@print 'Setting frequency to %d' % freq@@@",
- "@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo \"userspace\" > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor'])@@@",
- "@@@STEP_LOG_LINE@python.inline@# If scaling_max_freq is lower than our attempted setting, it won't take.@@@",
- "@@@STEP_LOG_LINE@python.inline@# We must set min first, because if we try to set max to be less than min@@@",
- "@@@STEP_LOG_LINE@python.inline@# (which sometimes happens after certain devices reboot) it returns a@@@",
- "@@@STEP_LOG_LINE@python.inline@# perplexing permissions error.@@@",
- "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo 0 > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq'])@@@",
- "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo %d > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])@@@",
- "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo %d > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed' % freq])@@@",
- "@@@STEP_LOG_LINE@python.inline@time.sleep(5)@@@",
- "@@@STEP_LOG_LINE@python.inline@actual_freq = subprocess.check_output([ADB, 'shell', 'cat '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq']).strip()@@@",
- "@@@STEP_LOG_LINE@python.inline@if actual_freq != str(freq):@@@",
+ "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo \"%s\" > '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])@@@",
+ "@@@STEP_LOG_LINE@python.inline@actual_gov = subprocess.check_output([ADB, 'shell', 'cat '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()@@@",
+ "@@@STEP_LOG_LINE@python.inline@if actual_gov != str(gov):@@@",
"@@@STEP_LOG_LINE@python.inline@ raise Exception('(actual, expected) (%s, %d)'@@@",
- "@@@STEP_LOG_LINE@python.inline@ % (actual_freq, freq))@@@",
+ "@@@STEP_LOG_LINE@python.inline@ % (actual_gov, gov))@@@",
"@@@STEP_LOG_END@python.inline@@@"
]
},
diff --git a/infra/bots/recipes/test.expected/Test-Android-Clang-Nexus7-GPU-Tegra3-arm-Debug-All-Android.json b/infra/bots/recipes/test.expected/Test-Android-Clang-Nexus7-GPU-Tegra3-arm-Debug-All-Android.json
index ca61bafab6..aa78fd1770 100644
--- a/infra/bots/recipes/test.expected/Test-Android-Clang-Nexus7-GPU-Tegra3-arm-Debug-All-Android.json
+++ b/infra/bots/recipes/test.expected/Test-Android-Clang-Nexus7-GPU-Tegra3-arm-Debug-All-Android.json
@@ -657,10 +657,10 @@
"cmd": [
"python",
"-u",
- "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\nmodel = sys.argv[2]\ntarget_percent = float(sys.argv[3])\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nif model == 'Nexus7':\n # Nexus7 claims to support 1300000, but only really allows 1200000\n available_freqs = [51000, 102000, 204000, 340000, 475000, 640000, 760000,\n 860000, 1000000, 1100000, 1200000]\nelse:\n # Temporary logging to get a sense of what devices have multiple cpus\n try:\n print subprocess.check_output([ADB, 'shell', 'cat ',\n '/sys/devices/system/cpu/cpu?/cpufreq/affected_cpus'])\n print subprocess.check_output([ADB, 'shell', 'cat ',\n '/sys/devices/system/cpu/cpu?/cpufreq/scaling_available_frequencies'])\n except Exception as e:\n print e.output.strip()\n # Most devices give a list of their available frequencies.\n available_freqs = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies'])\n\n # Check for message like '/system/bin/sh: file not found'\n if available_freqs and '/system/bin/sh' not in available_freqs:\n available_freqs = sorted(\n int(i) for i in available_freqs.strip().split())\n else:\n raise Exception('Could not get list of available frequencies: %s' %\n available_freqs)\n\nmaxfreq = available_freqs[-1]\ntarget = int(round(maxfreq * target_percent))\nfreq = maxfreq\nfor f in reversed(available_freqs):\n if f <= target:\n freq = f\n break\n\nprint 'Setting frequency to %d' % freq\n\nsubprocess.check_output([ADB, 'shell', 'echo \"userspace\" > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor'])\n# If scaling_max_freq is lower than our attempted setting, it won't take.\n# We must set min first, because if we try to set max to be less than min\n# (which sometimes happens after certain devices reboot) it returns a\n# perplexing permissions error.\nsubprocess.check_output([ADB, 'shell', 'echo 0 > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq'])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed' % freq])\ntime.sleep(5)\nactual_freq = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq']).strip()\nif actual_freq != str(freq):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_freq, freq))\n",
+ "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ncpu = int(sys.argv[2])\ngov = sys.argv[3]\n\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nsubprocess.check_output([ADB, 'shell', 'echo \"%s\" > '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])\nactual_gov = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()\nif actual_gov != str(gov):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_gov, gov))\n",
"/usr/bin/adb.1.0.35",
- "Nexus7",
- "1.0"
+ "0",
+ "ondemand"
],
"env": {
"BUILDTYPE": "Debug",
@@ -669,7 +669,7 @@
"SKIA_OUT": "[START_DIR]/out"
},
"infra_step": true,
- "name": "Scale CPU to 1.000000",
+ "name": "Set CPU 0's governor to ondemand",
"timeout": 30,
"~followup_annotations": [
"@@@STEP_LOG_LINE@python.inline@@@@",
@@ -678,67 +678,22 @@
"@@@STEP_LOG_LINE@python.inline@import sys@@@",
"@@@STEP_LOG_LINE@python.inline@import time@@@",
"@@@STEP_LOG_LINE@python.inline@ADB = sys.argv[1]@@@",
- "@@@STEP_LOG_LINE@python.inline@model = sys.argv[2]@@@",
- "@@@STEP_LOG_LINE@python.inline@target_percent = float(sys.argv[3])@@@",
+ "@@@STEP_LOG_LINE@python.inline@cpu = int(sys.argv[2])@@@",
+ "@@@STEP_LOG_LINE@python.inline@gov = sys.argv[3]@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@log = subprocess.check_output([ADB, 'root'])@@@",
"@@@STEP_LOG_LINE@python.inline@# check for message like 'adbd cannot run as root in production builds'@@@",
"@@@STEP_LOG_LINE@python.inline@print log@@@",
"@@@STEP_LOG_LINE@python.inline@if 'cannot' in log:@@@",
"@@@STEP_LOG_LINE@python.inline@ raise Exception('adb root failed')@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@if model == 'Nexus7':@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Nexus7 claims to support 1300000, but only really allows 1200000@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = [51000, 102000, 204000, 340000, 475000, 640000, 760000,@@@",
- "@@@STEP_LOG_LINE@python.inline@ 860000, 1000000, 1100000, 1200000]@@@",
- "@@@STEP_LOG_LINE@python.inline@else:@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Temporary logging to get a sense of what devices have multiple cpus@@@",
- "@@@STEP_LOG_LINE@python.inline@ try:@@@",
- "@@@STEP_LOG_LINE@python.inline@ print subprocess.check_output([ADB, 'shell', 'cat ',@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu?/cpufreq/affected_cpus'])@@@",
- "@@@STEP_LOG_LINE@python.inline@ print subprocess.check_output([ADB, 'shell', 'cat ',@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu?/cpufreq/scaling_available_frequencies'])@@@",
- "@@@STEP_LOG_LINE@python.inline@ except Exception as e:@@@",
- "@@@STEP_LOG_LINE@python.inline@ print e.output.strip()@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Most devices give a list of their available frequencies.@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = subprocess.check_output([ADB, 'shell', 'cat '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies'])@@@",
- "@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Check for message like '/system/bin/sh: file not found'@@@",
- "@@@STEP_LOG_LINE@python.inline@ if available_freqs and '/system/bin/sh' not in available_freqs:@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = sorted(@@@",
- "@@@STEP_LOG_LINE@python.inline@ int(i) for i in available_freqs.strip().split())@@@",
- "@@@STEP_LOG_LINE@python.inline@ else:@@@",
- "@@@STEP_LOG_LINE@python.inline@ raise Exception('Could not get list of available frequencies: %s' %@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs)@@@",
- "@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@maxfreq = available_freqs[-1]@@@",
- "@@@STEP_LOG_LINE@python.inline@target = int(round(maxfreq * target_percent))@@@",
- "@@@STEP_LOG_LINE@python.inline@freq = maxfreq@@@",
- "@@@STEP_LOG_LINE@python.inline@for f in reversed(available_freqs):@@@",
- "@@@STEP_LOG_LINE@python.inline@ if f <= target:@@@",
- "@@@STEP_LOG_LINE@python.inline@ freq = f@@@",
- "@@@STEP_LOG_LINE@python.inline@ break@@@",
- "@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@print 'Setting frequency to %d' % freq@@@",
- "@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo \"userspace\" > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor'])@@@",
- "@@@STEP_LOG_LINE@python.inline@# If scaling_max_freq is lower than our attempted setting, it won't take.@@@",
- "@@@STEP_LOG_LINE@python.inline@# We must set min first, because if we try to set max to be less than min@@@",
- "@@@STEP_LOG_LINE@python.inline@# (which sometimes happens after certain devices reboot) it returns a@@@",
- "@@@STEP_LOG_LINE@python.inline@# perplexing permissions error.@@@",
- "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo 0 > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq'])@@@",
- "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo %d > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])@@@",
- "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo %d > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed' % freq])@@@",
- "@@@STEP_LOG_LINE@python.inline@time.sleep(5)@@@",
- "@@@STEP_LOG_LINE@python.inline@actual_freq = subprocess.check_output([ADB, 'shell', 'cat '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq']).strip()@@@",
- "@@@STEP_LOG_LINE@python.inline@if actual_freq != str(freq):@@@",
+ "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo \"%s\" > '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])@@@",
+ "@@@STEP_LOG_LINE@python.inline@actual_gov = subprocess.check_output([ADB, 'shell', 'cat '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()@@@",
+ "@@@STEP_LOG_LINE@python.inline@if actual_gov != str(gov):@@@",
"@@@STEP_LOG_LINE@python.inline@ raise Exception('(actual, expected) (%s, %d)'@@@",
- "@@@STEP_LOG_LINE@python.inline@ % (actual_freq, freq))@@@",
+ "@@@STEP_LOG_LINE@python.inline@ % (actual_gov, gov))@@@",
"@@@STEP_LOG_END@python.inline@@@"
]
},
diff --git a/infra/bots/recipes/test.expected/Test-Android-Clang-NexusPlayer-CPU-Moorefield-x86-Release-All-Android.json b/infra/bots/recipes/test.expected/Test-Android-Clang-NexusPlayer-CPU-Moorefield-x86-Release-All-Android.json
index 79786e2ab9..0e9c63da4a 100644
--- a/infra/bots/recipes/test.expected/Test-Android-Clang-NexusPlayer-CPU-Moorefield-x86-Release-All-Android.json
+++ b/infra/bots/recipes/test.expected/Test-Android-Clang-NexusPlayer-CPU-Moorefield-x86-Release-All-Android.json
@@ -657,10 +657,10 @@
"cmd": [
"python",
"-u",
- "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\nmodel = sys.argv[2]\ntarget_percent = float(sys.argv[3])\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nif model == 'Nexus7':\n # Nexus7 claims to support 1300000, but only really allows 1200000\n available_freqs = [51000, 102000, 204000, 340000, 475000, 640000, 760000,\n 860000, 1000000, 1100000, 1200000]\nelse:\n # Temporary logging to get a sense of what devices have multiple cpus\n try:\n print subprocess.check_output([ADB, 'shell', 'cat ',\n '/sys/devices/system/cpu/cpu?/cpufreq/affected_cpus'])\n print subprocess.check_output([ADB, 'shell', 'cat ',\n '/sys/devices/system/cpu/cpu?/cpufreq/scaling_available_frequencies'])\n except Exception as e:\n print e.output.strip()\n # Most devices give a list of their available frequencies.\n available_freqs = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies'])\n\n # Check for message like '/system/bin/sh: file not found'\n if available_freqs and '/system/bin/sh' not in available_freqs:\n available_freqs = sorted(\n int(i) for i in available_freqs.strip().split())\n else:\n raise Exception('Could not get list of available frequencies: %s' %\n available_freqs)\n\nmaxfreq = available_freqs[-1]\ntarget = int(round(maxfreq * target_percent))\nfreq = maxfreq\nfor f in reversed(available_freqs):\n if f <= target:\n freq = f\n break\n\nprint 'Setting frequency to %d' % freq\n\nsubprocess.check_output([ADB, 'shell', 'echo \"userspace\" > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor'])\n# If scaling_max_freq is lower than our attempted setting, it won't take.\n# We must set min first, because if we try to set max to be less than min\n# (which sometimes happens after certain devices reboot) it returns a\n# perplexing permissions error.\nsubprocess.check_output([ADB, 'shell', 'echo 0 > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq'])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed' % freq])\ntime.sleep(5)\nactual_freq = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq']).strip()\nif actual_freq != str(freq):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_freq, freq))\n",
+ "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ncpu = int(sys.argv[2])\ngov = sys.argv[3]\n\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nsubprocess.check_output([ADB, 'shell', 'echo \"%s\" > '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])\nactual_gov = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()\nif actual_gov != str(gov):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_gov, gov))\n",
"/usr/bin/adb.1.0.35",
- "NexusPlayer",
- "1.0"
+ "2",
+ "ondemand"
],
"env": {
"BUILDTYPE": "Release",
@@ -669,7 +669,7 @@
"SKIA_OUT": "[START_DIR]/out"
},
"infra_step": true,
- "name": "Scale CPU to 1.000000",
+ "name": "Set CPU 2's governor to ondemand",
"timeout": 30,
"~followup_annotations": [
"@@@STEP_LOG_LINE@python.inline@@@@",
@@ -678,67 +678,66 @@
"@@@STEP_LOG_LINE@python.inline@import sys@@@",
"@@@STEP_LOG_LINE@python.inline@import time@@@",
"@@@STEP_LOG_LINE@python.inline@ADB = sys.argv[1]@@@",
- "@@@STEP_LOG_LINE@python.inline@model = sys.argv[2]@@@",
- "@@@STEP_LOG_LINE@python.inline@target_percent = float(sys.argv[3])@@@",
+ "@@@STEP_LOG_LINE@python.inline@cpu = int(sys.argv[2])@@@",
+ "@@@STEP_LOG_LINE@python.inline@gov = sys.argv[3]@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@log = subprocess.check_output([ADB, 'root'])@@@",
"@@@STEP_LOG_LINE@python.inline@# check for message like 'adbd cannot run as root in production builds'@@@",
"@@@STEP_LOG_LINE@python.inline@print log@@@",
"@@@STEP_LOG_LINE@python.inline@if 'cannot' in log:@@@",
"@@@STEP_LOG_LINE@python.inline@ raise Exception('adb root failed')@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@if model == 'Nexus7':@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Nexus7 claims to support 1300000, but only really allows 1200000@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = [51000, 102000, 204000, 340000, 475000, 640000, 760000,@@@",
- "@@@STEP_LOG_LINE@python.inline@ 860000, 1000000, 1100000, 1200000]@@@",
- "@@@STEP_LOG_LINE@python.inline@else:@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Temporary logging to get a sense of what devices have multiple cpus@@@",
- "@@@STEP_LOG_LINE@python.inline@ try:@@@",
- "@@@STEP_LOG_LINE@python.inline@ print subprocess.check_output([ADB, 'shell', 'cat ',@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu?/cpufreq/affected_cpus'])@@@",
- "@@@STEP_LOG_LINE@python.inline@ print subprocess.check_output([ADB, 'shell', 'cat ',@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu?/cpufreq/scaling_available_frequencies'])@@@",
- "@@@STEP_LOG_LINE@python.inline@ except Exception as e:@@@",
- "@@@STEP_LOG_LINE@python.inline@ print e.output.strip()@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Most devices give a list of their available frequencies.@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = subprocess.check_output([ADB, 'shell', 'cat '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies'])@@@",
- "@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Check for message like '/system/bin/sh: file not found'@@@",
- "@@@STEP_LOG_LINE@python.inline@ if available_freqs and '/system/bin/sh' not in available_freqs:@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = sorted(@@@",
- "@@@STEP_LOG_LINE@python.inline@ int(i) for i in available_freqs.strip().split())@@@",
- "@@@STEP_LOG_LINE@python.inline@ else:@@@",
- "@@@STEP_LOG_LINE@python.inline@ raise Exception('Could not get list of available frequencies: %s' %@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs)@@@",
+ "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo \"%s\" > '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])@@@",
+ "@@@STEP_LOG_LINE@python.inline@actual_gov = subprocess.check_output([ADB, 'shell', 'cat '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()@@@",
+ "@@@STEP_LOG_LINE@python.inline@if actual_gov != str(gov):@@@",
+ "@@@STEP_LOG_LINE@python.inline@ raise Exception('(actual, expected) (%s, %d)'@@@",
+ "@@@STEP_LOG_LINE@python.inline@ % (actual_gov, gov))@@@",
+ "@@@STEP_LOG_END@python.inline@@@"
+ ]
+ },
+ {
+ "cmd": [
+ "python",
+ "-u",
+ "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ncpu = int(sys.argv[2])\ngov = sys.argv[3]\n\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nsubprocess.check_output([ADB, 'shell', 'echo \"%s\" > '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])\nactual_gov = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()\nif actual_gov != str(gov):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_gov, gov))\n",
+ "/usr/bin/adb.1.0.35",
+ "0",
+ "ondemand"
+ ],
+ "env": {
+ "BUILDTYPE": "Release",
+ "CHROME_HEADLESS": "1",
+ "PATH": "<PATH>:RECIPE_PACKAGE_REPO[depot_tools]",
+ "SKIA_OUT": "[START_DIR]/out"
+ },
+ "infra_step": true,
+ "name": "Set CPU 0's governor to ondemand",
+ "timeout": 30,
+ "~followup_annotations": [
"@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@maxfreq = available_freqs[-1]@@@",
- "@@@STEP_LOG_LINE@python.inline@target = int(round(maxfreq * target_percent))@@@",
- "@@@STEP_LOG_LINE@python.inline@freq = maxfreq@@@",
- "@@@STEP_LOG_LINE@python.inline@for f in reversed(available_freqs):@@@",
- "@@@STEP_LOG_LINE@python.inline@ if f <= target:@@@",
- "@@@STEP_LOG_LINE@python.inline@ freq = f@@@",
- "@@@STEP_LOG_LINE@python.inline@ break@@@",
+ "@@@STEP_LOG_LINE@python.inline@import os@@@",
+ "@@@STEP_LOG_LINE@python.inline@import subprocess@@@",
+ "@@@STEP_LOG_LINE@python.inline@import sys@@@",
+ "@@@STEP_LOG_LINE@python.inline@import time@@@",
+ "@@@STEP_LOG_LINE@python.inline@ADB = sys.argv[1]@@@",
+ "@@@STEP_LOG_LINE@python.inline@cpu = int(sys.argv[2])@@@",
+ "@@@STEP_LOG_LINE@python.inline@gov = sys.argv[3]@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@print 'Setting frequency to %d' % freq@@@",
+ "@@@STEP_LOG_LINE@python.inline@log = subprocess.check_output([ADB, 'root'])@@@",
+ "@@@STEP_LOG_LINE@python.inline@# check for message like 'adbd cannot run as root in production builds'@@@",
+ "@@@STEP_LOG_LINE@python.inline@print log@@@",
+ "@@@STEP_LOG_LINE@python.inline@if 'cannot' in log:@@@",
+ "@@@STEP_LOG_LINE@python.inline@ raise Exception('adb root failed')@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo \"userspace\" > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor'])@@@",
- "@@@STEP_LOG_LINE@python.inline@# If scaling_max_freq is lower than our attempted setting, it won't take.@@@",
- "@@@STEP_LOG_LINE@python.inline@# We must set min first, because if we try to set max to be less than min@@@",
- "@@@STEP_LOG_LINE@python.inline@# (which sometimes happens after certain devices reboot) it returns a@@@",
- "@@@STEP_LOG_LINE@python.inline@# perplexing permissions error.@@@",
- "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo 0 > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq'])@@@",
- "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo %d > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])@@@",
- "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo %d > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed' % freq])@@@",
- "@@@STEP_LOG_LINE@python.inline@time.sleep(5)@@@",
- "@@@STEP_LOG_LINE@python.inline@actual_freq = subprocess.check_output([ADB, 'shell', 'cat '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq']).strip()@@@",
- "@@@STEP_LOG_LINE@python.inline@if actual_freq != str(freq):@@@",
+ "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo \"%s\" > '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])@@@",
+ "@@@STEP_LOG_LINE@python.inline@actual_gov = subprocess.check_output([ADB, 'shell', 'cat '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()@@@",
+ "@@@STEP_LOG_LINE@python.inline@if actual_gov != str(gov):@@@",
"@@@STEP_LOG_LINE@python.inline@ raise Exception('(actual, expected) (%s, %d)'@@@",
- "@@@STEP_LOG_LINE@python.inline@ % (actual_freq, freq))@@@",
+ "@@@STEP_LOG_LINE@python.inline@ % (actual_gov, gov))@@@",
"@@@STEP_LOG_END@python.inline@@@"
]
},
diff --git a/infra/bots/recipes/test.expected/Test-Android-Clang-NexusPlayer-GPU-PowerVR-x86-Release-All-Android_Vulkan.json b/infra/bots/recipes/test.expected/Test-Android-Clang-NexusPlayer-GPU-PowerVR-x86-Release-All-Android_Vulkan.json
index 27db6a8936..27e20ccb13 100644
--- a/infra/bots/recipes/test.expected/Test-Android-Clang-NexusPlayer-GPU-PowerVR-x86-Release-All-Android_Vulkan.json
+++ b/infra/bots/recipes/test.expected/Test-Android-Clang-NexusPlayer-GPU-PowerVR-x86-Release-All-Android_Vulkan.json
@@ -657,10 +657,10 @@
"cmd": [
"python",
"-u",
- "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\nmodel = sys.argv[2]\ntarget_percent = float(sys.argv[3])\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nif model == 'Nexus7':\n # Nexus7 claims to support 1300000, but only really allows 1200000\n available_freqs = [51000, 102000, 204000, 340000, 475000, 640000, 760000,\n 860000, 1000000, 1100000, 1200000]\nelse:\n # Temporary logging to get a sense of what devices have multiple cpus\n try:\n print subprocess.check_output([ADB, 'shell', 'cat ',\n '/sys/devices/system/cpu/cpu?/cpufreq/affected_cpus'])\n print subprocess.check_output([ADB, 'shell', 'cat ',\n '/sys/devices/system/cpu/cpu?/cpufreq/scaling_available_frequencies'])\n except Exception as e:\n print e.output.strip()\n # Most devices give a list of their available frequencies.\n available_freqs = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies'])\n\n # Check for message like '/system/bin/sh: file not found'\n if available_freqs and '/system/bin/sh' not in available_freqs:\n available_freqs = sorted(\n int(i) for i in available_freqs.strip().split())\n else:\n raise Exception('Could not get list of available frequencies: %s' %\n available_freqs)\n\nmaxfreq = available_freqs[-1]\ntarget = int(round(maxfreq * target_percent))\nfreq = maxfreq\nfor f in reversed(available_freqs):\n if f <= target:\n freq = f\n break\n\nprint 'Setting frequency to %d' % freq\n\nsubprocess.check_output([ADB, 'shell', 'echo \"userspace\" > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor'])\n# If scaling_max_freq is lower than our attempted setting, it won't take.\n# We must set min first, because if we try to set max to be less than min\n# (which sometimes happens after certain devices reboot) it returns a\n# perplexing permissions error.\nsubprocess.check_output([ADB, 'shell', 'echo 0 > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq'])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed' % freq])\ntime.sleep(5)\nactual_freq = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq']).strip()\nif actual_freq != str(freq):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_freq, freq))\n",
+ "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ncpu = int(sys.argv[2])\ngov = sys.argv[3]\n\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nsubprocess.check_output([ADB, 'shell', 'echo \"%s\" > '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])\nactual_gov = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()\nif actual_gov != str(gov):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_gov, gov))\n",
"/usr/bin/adb.1.0.35",
- "NexusPlayer",
- "1.0"
+ "2",
+ "ondemand"
],
"env": {
"BUILDTYPE": "Release",
@@ -669,7 +669,7 @@
"SKIA_OUT": "[START_DIR]/out"
},
"infra_step": true,
- "name": "Scale CPU to 1.000000",
+ "name": "Set CPU 2's governor to ondemand",
"timeout": 30,
"~followup_annotations": [
"@@@STEP_LOG_LINE@python.inline@@@@",
@@ -678,67 +678,66 @@
"@@@STEP_LOG_LINE@python.inline@import sys@@@",
"@@@STEP_LOG_LINE@python.inline@import time@@@",
"@@@STEP_LOG_LINE@python.inline@ADB = sys.argv[1]@@@",
- "@@@STEP_LOG_LINE@python.inline@model = sys.argv[2]@@@",
- "@@@STEP_LOG_LINE@python.inline@target_percent = float(sys.argv[3])@@@",
+ "@@@STEP_LOG_LINE@python.inline@cpu = int(sys.argv[2])@@@",
+ "@@@STEP_LOG_LINE@python.inline@gov = sys.argv[3]@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@log = subprocess.check_output([ADB, 'root'])@@@",
"@@@STEP_LOG_LINE@python.inline@# check for message like 'adbd cannot run as root in production builds'@@@",
"@@@STEP_LOG_LINE@python.inline@print log@@@",
"@@@STEP_LOG_LINE@python.inline@if 'cannot' in log:@@@",
"@@@STEP_LOG_LINE@python.inline@ raise Exception('adb root failed')@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@if model == 'Nexus7':@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Nexus7 claims to support 1300000, but only really allows 1200000@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = [51000, 102000, 204000, 340000, 475000, 640000, 760000,@@@",
- "@@@STEP_LOG_LINE@python.inline@ 860000, 1000000, 1100000, 1200000]@@@",
- "@@@STEP_LOG_LINE@python.inline@else:@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Temporary logging to get a sense of what devices have multiple cpus@@@",
- "@@@STEP_LOG_LINE@python.inline@ try:@@@",
- "@@@STEP_LOG_LINE@python.inline@ print subprocess.check_output([ADB, 'shell', 'cat ',@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu?/cpufreq/affected_cpus'])@@@",
- "@@@STEP_LOG_LINE@python.inline@ print subprocess.check_output([ADB, 'shell', 'cat ',@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu?/cpufreq/scaling_available_frequencies'])@@@",
- "@@@STEP_LOG_LINE@python.inline@ except Exception as e:@@@",
- "@@@STEP_LOG_LINE@python.inline@ print e.output.strip()@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Most devices give a list of their available frequencies.@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = subprocess.check_output([ADB, 'shell', 'cat '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies'])@@@",
- "@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Check for message like '/system/bin/sh: file not found'@@@",
- "@@@STEP_LOG_LINE@python.inline@ if available_freqs and '/system/bin/sh' not in available_freqs:@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = sorted(@@@",
- "@@@STEP_LOG_LINE@python.inline@ int(i) for i in available_freqs.strip().split())@@@",
- "@@@STEP_LOG_LINE@python.inline@ else:@@@",
- "@@@STEP_LOG_LINE@python.inline@ raise Exception('Could not get list of available frequencies: %s' %@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs)@@@",
+ "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo \"%s\" > '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])@@@",
+ "@@@STEP_LOG_LINE@python.inline@actual_gov = subprocess.check_output([ADB, 'shell', 'cat '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()@@@",
+ "@@@STEP_LOG_LINE@python.inline@if actual_gov != str(gov):@@@",
+ "@@@STEP_LOG_LINE@python.inline@ raise Exception('(actual, expected) (%s, %d)'@@@",
+ "@@@STEP_LOG_LINE@python.inline@ % (actual_gov, gov))@@@",
+ "@@@STEP_LOG_END@python.inline@@@"
+ ]
+ },
+ {
+ "cmd": [
+ "python",
+ "-u",
+ "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ncpu = int(sys.argv[2])\ngov = sys.argv[3]\n\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nsubprocess.check_output([ADB, 'shell', 'echo \"%s\" > '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])\nactual_gov = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()\nif actual_gov != str(gov):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_gov, gov))\n",
+ "/usr/bin/adb.1.0.35",
+ "0",
+ "ondemand"
+ ],
+ "env": {
+ "BUILDTYPE": "Release",
+ "CHROME_HEADLESS": "1",
+ "PATH": "<PATH>:RECIPE_PACKAGE_REPO[depot_tools]",
+ "SKIA_OUT": "[START_DIR]/out"
+ },
+ "infra_step": true,
+ "name": "Set CPU 0's governor to ondemand",
+ "timeout": 30,
+ "~followup_annotations": [
"@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@maxfreq = available_freqs[-1]@@@",
- "@@@STEP_LOG_LINE@python.inline@target = int(round(maxfreq * target_percent))@@@",
- "@@@STEP_LOG_LINE@python.inline@freq = maxfreq@@@",
- "@@@STEP_LOG_LINE@python.inline@for f in reversed(available_freqs):@@@",
- "@@@STEP_LOG_LINE@python.inline@ if f <= target:@@@",
- "@@@STEP_LOG_LINE@python.inline@ freq = f@@@",
- "@@@STEP_LOG_LINE@python.inline@ break@@@",
+ "@@@STEP_LOG_LINE@python.inline@import os@@@",
+ "@@@STEP_LOG_LINE@python.inline@import subprocess@@@",
+ "@@@STEP_LOG_LINE@python.inline@import sys@@@",
+ "@@@STEP_LOG_LINE@python.inline@import time@@@",
+ "@@@STEP_LOG_LINE@python.inline@ADB = sys.argv[1]@@@",
+ "@@@STEP_LOG_LINE@python.inline@cpu = int(sys.argv[2])@@@",
+ "@@@STEP_LOG_LINE@python.inline@gov = sys.argv[3]@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@print 'Setting frequency to %d' % freq@@@",
+ "@@@STEP_LOG_LINE@python.inline@log = subprocess.check_output([ADB, 'root'])@@@",
+ "@@@STEP_LOG_LINE@python.inline@# check for message like 'adbd cannot run as root in production builds'@@@",
+ "@@@STEP_LOG_LINE@python.inline@print log@@@",
+ "@@@STEP_LOG_LINE@python.inline@if 'cannot' in log:@@@",
+ "@@@STEP_LOG_LINE@python.inline@ raise Exception('adb root failed')@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo \"userspace\" > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor'])@@@",
- "@@@STEP_LOG_LINE@python.inline@# If scaling_max_freq is lower than our attempted setting, it won't take.@@@",
- "@@@STEP_LOG_LINE@python.inline@# We must set min first, because if we try to set max to be less than min@@@",
- "@@@STEP_LOG_LINE@python.inline@# (which sometimes happens after certain devices reboot) it returns a@@@",
- "@@@STEP_LOG_LINE@python.inline@# perplexing permissions error.@@@",
- "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo 0 > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq'])@@@",
- "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo %d > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])@@@",
- "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo %d > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed' % freq])@@@",
- "@@@STEP_LOG_LINE@python.inline@time.sleep(5)@@@",
- "@@@STEP_LOG_LINE@python.inline@actual_freq = subprocess.check_output([ADB, 'shell', 'cat '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq']).strip()@@@",
- "@@@STEP_LOG_LINE@python.inline@if actual_freq != str(freq):@@@",
+ "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo \"%s\" > '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])@@@",
+ "@@@STEP_LOG_LINE@python.inline@actual_gov = subprocess.check_output([ADB, 'shell', 'cat '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()@@@",
+ "@@@STEP_LOG_LINE@python.inline@if actual_gov != str(gov):@@@",
"@@@STEP_LOG_LINE@python.inline@ raise Exception('(actual, expected) (%s, %d)'@@@",
- "@@@STEP_LOG_LINE@python.inline@ % (actual_freq, freq))@@@",
+ "@@@STEP_LOG_LINE@python.inline@ % (actual_gov, gov))@@@",
"@@@STEP_LOG_END@python.inline@@@"
]
},
diff --git a/infra/bots/recipes/test.expected/Test-Android-Clang-Pixel-GPU-Adreno530-arm64-Debug-All-Android_CCPR.json b/infra/bots/recipes/test.expected/Test-Android-Clang-Pixel-GPU-Adreno530-arm64-Debug-All-Android_CCPR.json
index d520bcde40..3fd39a9559 100644
--- a/infra/bots/recipes/test.expected/Test-Android-Clang-Pixel-GPU-Adreno530-arm64-Debug-All-Android_CCPR.json
+++ b/infra/bots/recipes/test.expected/Test-Android-Clang-Pixel-GPU-Adreno530-arm64-Debug-All-Android_CCPR.json
@@ -657,10 +657,10 @@
"cmd": [
"python",
"-u",
- "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\nmodel = sys.argv[2]\ntarget_percent = float(sys.argv[3])\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nif model == 'Nexus7':\n # Nexus7 claims to support 1300000, but only really allows 1200000\n available_freqs = [51000, 102000, 204000, 340000, 475000, 640000, 760000,\n 860000, 1000000, 1100000, 1200000]\nelse:\n # Temporary logging to get a sense of what devices have multiple cpus\n try:\n print subprocess.check_output([ADB, 'shell', 'cat ',\n '/sys/devices/system/cpu/cpu?/cpufreq/affected_cpus'])\n print subprocess.check_output([ADB, 'shell', 'cat ',\n '/sys/devices/system/cpu/cpu?/cpufreq/scaling_available_frequencies'])\n except Exception as e:\n print e.output.strip()\n # Most devices give a list of their available frequencies.\n available_freqs = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies'])\n\n # Check for message like '/system/bin/sh: file not found'\n if available_freqs and '/system/bin/sh' not in available_freqs:\n available_freqs = sorted(\n int(i) for i in available_freqs.strip().split())\n else:\n raise Exception('Could not get list of available frequencies: %s' %\n available_freqs)\n\nmaxfreq = available_freqs[-1]\ntarget = int(round(maxfreq * target_percent))\nfreq = maxfreq\nfor f in reversed(available_freqs):\n if f <= target:\n freq = f\n break\n\nprint 'Setting frequency to %d' % freq\n\nsubprocess.check_output([ADB, 'shell', 'echo \"userspace\" > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor'])\n# If scaling_max_freq is lower than our attempted setting, it won't take.\n# We must set min first, because if we try to set max to be less than min\n# (which sometimes happens after certain devices reboot) it returns a\n# perplexing permissions error.\nsubprocess.check_output([ADB, 'shell', 'echo 0 > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq'])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed' % freq])\ntime.sleep(5)\nactual_freq = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq']).strip()\nif actual_freq != str(freq):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_freq, freq))\n",
+ "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ncpu = int(sys.argv[2])\ngov = sys.argv[3]\n\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nsubprocess.check_output([ADB, 'shell', 'echo \"%s\" > '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])\nactual_gov = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()\nif actual_gov != str(gov):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_gov, gov))\n",
"/usr/bin/adb.1.0.35",
- "Pixel",
- "1.0"
+ "2",
+ "ondemand"
],
"env": {
"BUILDTYPE": "Debug",
@@ -669,7 +669,7 @@
"SKIA_OUT": "[START_DIR]/out"
},
"infra_step": true,
- "name": "Scale CPU to 1.000000",
+ "name": "Set CPU 2's governor to ondemand",
"timeout": 30,
"~followup_annotations": [
"@@@STEP_LOG_LINE@python.inline@@@@",
@@ -678,67 +678,66 @@
"@@@STEP_LOG_LINE@python.inline@import sys@@@",
"@@@STEP_LOG_LINE@python.inline@import time@@@",
"@@@STEP_LOG_LINE@python.inline@ADB = sys.argv[1]@@@",
- "@@@STEP_LOG_LINE@python.inline@model = sys.argv[2]@@@",
- "@@@STEP_LOG_LINE@python.inline@target_percent = float(sys.argv[3])@@@",
+ "@@@STEP_LOG_LINE@python.inline@cpu = int(sys.argv[2])@@@",
+ "@@@STEP_LOG_LINE@python.inline@gov = sys.argv[3]@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@log = subprocess.check_output([ADB, 'root'])@@@",
"@@@STEP_LOG_LINE@python.inline@# check for message like 'adbd cannot run as root in production builds'@@@",
"@@@STEP_LOG_LINE@python.inline@print log@@@",
"@@@STEP_LOG_LINE@python.inline@if 'cannot' in log:@@@",
"@@@STEP_LOG_LINE@python.inline@ raise Exception('adb root failed')@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@if model == 'Nexus7':@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Nexus7 claims to support 1300000, but only really allows 1200000@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = [51000, 102000, 204000, 340000, 475000, 640000, 760000,@@@",
- "@@@STEP_LOG_LINE@python.inline@ 860000, 1000000, 1100000, 1200000]@@@",
- "@@@STEP_LOG_LINE@python.inline@else:@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Temporary logging to get a sense of what devices have multiple cpus@@@",
- "@@@STEP_LOG_LINE@python.inline@ try:@@@",
- "@@@STEP_LOG_LINE@python.inline@ print subprocess.check_output([ADB, 'shell', 'cat ',@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu?/cpufreq/affected_cpus'])@@@",
- "@@@STEP_LOG_LINE@python.inline@ print subprocess.check_output([ADB, 'shell', 'cat ',@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu?/cpufreq/scaling_available_frequencies'])@@@",
- "@@@STEP_LOG_LINE@python.inline@ except Exception as e:@@@",
- "@@@STEP_LOG_LINE@python.inline@ print e.output.strip()@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Most devices give a list of their available frequencies.@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = subprocess.check_output([ADB, 'shell', 'cat '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies'])@@@",
- "@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Check for message like '/system/bin/sh: file not found'@@@",
- "@@@STEP_LOG_LINE@python.inline@ if available_freqs and '/system/bin/sh' not in available_freqs:@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = sorted(@@@",
- "@@@STEP_LOG_LINE@python.inline@ int(i) for i in available_freqs.strip().split())@@@",
- "@@@STEP_LOG_LINE@python.inline@ else:@@@",
- "@@@STEP_LOG_LINE@python.inline@ raise Exception('Could not get list of available frequencies: %s' %@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs)@@@",
+ "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo \"%s\" > '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])@@@",
+ "@@@STEP_LOG_LINE@python.inline@actual_gov = subprocess.check_output([ADB, 'shell', 'cat '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()@@@",
+ "@@@STEP_LOG_LINE@python.inline@if actual_gov != str(gov):@@@",
+ "@@@STEP_LOG_LINE@python.inline@ raise Exception('(actual, expected) (%s, %d)'@@@",
+ "@@@STEP_LOG_LINE@python.inline@ % (actual_gov, gov))@@@",
+ "@@@STEP_LOG_END@python.inline@@@"
+ ]
+ },
+ {
+ "cmd": [
+ "python",
+ "-u",
+ "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ncpu = int(sys.argv[2])\ngov = sys.argv[3]\n\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nsubprocess.check_output([ADB, 'shell', 'echo \"%s\" > '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])\nactual_gov = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()\nif actual_gov != str(gov):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_gov, gov))\n",
+ "/usr/bin/adb.1.0.35",
+ "0",
+ "ondemand"
+ ],
+ "env": {
+ "BUILDTYPE": "Debug",
+ "CHROME_HEADLESS": "1",
+ "PATH": "<PATH>:RECIPE_PACKAGE_REPO[depot_tools]",
+ "SKIA_OUT": "[START_DIR]/out"
+ },
+ "infra_step": true,
+ "name": "Set CPU 0's governor to ondemand",
+ "timeout": 30,
+ "~followup_annotations": [
"@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@maxfreq = available_freqs[-1]@@@",
- "@@@STEP_LOG_LINE@python.inline@target = int(round(maxfreq * target_percent))@@@",
- "@@@STEP_LOG_LINE@python.inline@freq = maxfreq@@@",
- "@@@STEP_LOG_LINE@python.inline@for f in reversed(available_freqs):@@@",
- "@@@STEP_LOG_LINE@python.inline@ if f <= target:@@@",
- "@@@STEP_LOG_LINE@python.inline@ freq = f@@@",
- "@@@STEP_LOG_LINE@python.inline@ break@@@",
+ "@@@STEP_LOG_LINE@python.inline@import os@@@",
+ "@@@STEP_LOG_LINE@python.inline@import subprocess@@@",
+ "@@@STEP_LOG_LINE@python.inline@import sys@@@",
+ "@@@STEP_LOG_LINE@python.inline@import time@@@",
+ "@@@STEP_LOG_LINE@python.inline@ADB = sys.argv[1]@@@",
+ "@@@STEP_LOG_LINE@python.inline@cpu = int(sys.argv[2])@@@",
+ "@@@STEP_LOG_LINE@python.inline@gov = sys.argv[3]@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@print 'Setting frequency to %d' % freq@@@",
+ "@@@STEP_LOG_LINE@python.inline@log = subprocess.check_output([ADB, 'root'])@@@",
+ "@@@STEP_LOG_LINE@python.inline@# check for message like 'adbd cannot run as root in production builds'@@@",
+ "@@@STEP_LOG_LINE@python.inline@print log@@@",
+ "@@@STEP_LOG_LINE@python.inline@if 'cannot' in log:@@@",
+ "@@@STEP_LOG_LINE@python.inline@ raise Exception('adb root failed')@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo \"userspace\" > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor'])@@@",
- "@@@STEP_LOG_LINE@python.inline@# If scaling_max_freq is lower than our attempted setting, it won't take.@@@",
- "@@@STEP_LOG_LINE@python.inline@# We must set min first, because if we try to set max to be less than min@@@",
- "@@@STEP_LOG_LINE@python.inline@# (which sometimes happens after certain devices reboot) it returns a@@@",
- "@@@STEP_LOG_LINE@python.inline@# perplexing permissions error.@@@",
- "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo 0 > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq'])@@@",
- "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo %d > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])@@@",
- "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo %d > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed' % freq])@@@",
- "@@@STEP_LOG_LINE@python.inline@time.sleep(5)@@@",
- "@@@STEP_LOG_LINE@python.inline@actual_freq = subprocess.check_output([ADB, 'shell', 'cat '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq']).strip()@@@",
- "@@@STEP_LOG_LINE@python.inline@if actual_freq != str(freq):@@@",
+ "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo \"%s\" > '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])@@@",
+ "@@@STEP_LOG_LINE@python.inline@actual_gov = subprocess.check_output([ADB, 'shell', 'cat '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()@@@",
+ "@@@STEP_LOG_LINE@python.inline@if actual_gov != str(gov):@@@",
"@@@STEP_LOG_LINE@python.inline@ raise Exception('(actual, expected) (%s, %d)'@@@",
- "@@@STEP_LOG_LINE@python.inline@ % (actual_freq, freq))@@@",
+ "@@@STEP_LOG_LINE@python.inline@ % (actual_gov, gov))@@@",
"@@@STEP_LOG_END@python.inline@@@"
]
},
diff --git a/infra/bots/recipes/test.expected/Test-Android-Clang-Pixel-GPU-Adreno530-arm64-Debug-All-Android_Vulkan.json b/infra/bots/recipes/test.expected/Test-Android-Clang-Pixel-GPU-Adreno530-arm64-Debug-All-Android_Vulkan.json
index 1fd07b4dfe..ece52f5c12 100644
--- a/infra/bots/recipes/test.expected/Test-Android-Clang-Pixel-GPU-Adreno530-arm64-Debug-All-Android_Vulkan.json
+++ b/infra/bots/recipes/test.expected/Test-Android-Clang-Pixel-GPU-Adreno530-arm64-Debug-All-Android_Vulkan.json
@@ -657,10 +657,10 @@
"cmd": [
"python",
"-u",
- "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\nmodel = sys.argv[2]\ntarget_percent = float(sys.argv[3])\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nif model == 'Nexus7':\n # Nexus7 claims to support 1300000, but only really allows 1200000\n available_freqs = [51000, 102000, 204000, 340000, 475000, 640000, 760000,\n 860000, 1000000, 1100000, 1200000]\nelse:\n # Temporary logging to get a sense of what devices have multiple cpus\n try:\n print subprocess.check_output([ADB, 'shell', 'cat ',\n '/sys/devices/system/cpu/cpu?/cpufreq/affected_cpus'])\n print subprocess.check_output([ADB, 'shell', 'cat ',\n '/sys/devices/system/cpu/cpu?/cpufreq/scaling_available_frequencies'])\n except Exception as e:\n print e.output.strip()\n # Most devices give a list of their available frequencies.\n available_freqs = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies'])\n\n # Check for message like '/system/bin/sh: file not found'\n if available_freqs and '/system/bin/sh' not in available_freqs:\n available_freqs = sorted(\n int(i) for i in available_freqs.strip().split())\n else:\n raise Exception('Could not get list of available frequencies: %s' %\n available_freqs)\n\nmaxfreq = available_freqs[-1]\ntarget = int(round(maxfreq * target_percent))\nfreq = maxfreq\nfor f in reversed(available_freqs):\n if f <= target:\n freq = f\n break\n\nprint 'Setting frequency to %d' % freq\n\nsubprocess.check_output([ADB, 'shell', 'echo \"userspace\" > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor'])\n# If scaling_max_freq is lower than our attempted setting, it won't take.\n# We must set min first, because if we try to set max to be less than min\n# (which sometimes happens after certain devices reboot) it returns a\n# perplexing permissions error.\nsubprocess.check_output([ADB, 'shell', 'echo 0 > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq'])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed' % freq])\ntime.sleep(5)\nactual_freq = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq']).strip()\nif actual_freq != str(freq):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_freq, freq))\n",
+ "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ncpu = int(sys.argv[2])\ngov = sys.argv[3]\n\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nsubprocess.check_output([ADB, 'shell', 'echo \"%s\" > '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])\nactual_gov = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()\nif actual_gov != str(gov):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_gov, gov))\n",
"/usr/bin/adb.1.0.35",
- "Pixel",
- "1.0"
+ "2",
+ "ondemand"
],
"env": {
"BUILDTYPE": "Debug",
@@ -669,7 +669,7 @@
"SKIA_OUT": "[START_DIR]/out"
},
"infra_step": true,
- "name": "Scale CPU to 1.000000",
+ "name": "Set CPU 2's governor to ondemand",
"timeout": 30,
"~followup_annotations": [
"@@@STEP_LOG_LINE@python.inline@@@@",
@@ -678,67 +678,66 @@
"@@@STEP_LOG_LINE@python.inline@import sys@@@",
"@@@STEP_LOG_LINE@python.inline@import time@@@",
"@@@STEP_LOG_LINE@python.inline@ADB = sys.argv[1]@@@",
- "@@@STEP_LOG_LINE@python.inline@model = sys.argv[2]@@@",
- "@@@STEP_LOG_LINE@python.inline@target_percent = float(sys.argv[3])@@@",
+ "@@@STEP_LOG_LINE@python.inline@cpu = int(sys.argv[2])@@@",
+ "@@@STEP_LOG_LINE@python.inline@gov = sys.argv[3]@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@log = subprocess.check_output([ADB, 'root'])@@@",
"@@@STEP_LOG_LINE@python.inline@# check for message like 'adbd cannot run as root in production builds'@@@",
"@@@STEP_LOG_LINE@python.inline@print log@@@",
"@@@STEP_LOG_LINE@python.inline@if 'cannot' in log:@@@",
"@@@STEP_LOG_LINE@python.inline@ raise Exception('adb root failed')@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@if model == 'Nexus7':@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Nexus7 claims to support 1300000, but only really allows 1200000@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = [51000, 102000, 204000, 340000, 475000, 640000, 760000,@@@",
- "@@@STEP_LOG_LINE@python.inline@ 860000, 1000000, 1100000, 1200000]@@@",
- "@@@STEP_LOG_LINE@python.inline@else:@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Temporary logging to get a sense of what devices have multiple cpus@@@",
- "@@@STEP_LOG_LINE@python.inline@ try:@@@",
- "@@@STEP_LOG_LINE@python.inline@ print subprocess.check_output([ADB, 'shell', 'cat ',@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu?/cpufreq/affected_cpus'])@@@",
- "@@@STEP_LOG_LINE@python.inline@ print subprocess.check_output([ADB, 'shell', 'cat ',@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu?/cpufreq/scaling_available_frequencies'])@@@",
- "@@@STEP_LOG_LINE@python.inline@ except Exception as e:@@@",
- "@@@STEP_LOG_LINE@python.inline@ print e.output.strip()@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Most devices give a list of their available frequencies.@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = subprocess.check_output([ADB, 'shell', 'cat '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies'])@@@",
- "@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Check for message like '/system/bin/sh: file not found'@@@",
- "@@@STEP_LOG_LINE@python.inline@ if available_freqs and '/system/bin/sh' not in available_freqs:@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = sorted(@@@",
- "@@@STEP_LOG_LINE@python.inline@ int(i) for i in available_freqs.strip().split())@@@",
- "@@@STEP_LOG_LINE@python.inline@ else:@@@",
- "@@@STEP_LOG_LINE@python.inline@ raise Exception('Could not get list of available frequencies: %s' %@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs)@@@",
+ "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo \"%s\" > '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])@@@",
+ "@@@STEP_LOG_LINE@python.inline@actual_gov = subprocess.check_output([ADB, 'shell', 'cat '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()@@@",
+ "@@@STEP_LOG_LINE@python.inline@if actual_gov != str(gov):@@@",
+ "@@@STEP_LOG_LINE@python.inline@ raise Exception('(actual, expected) (%s, %d)'@@@",
+ "@@@STEP_LOG_LINE@python.inline@ % (actual_gov, gov))@@@",
+ "@@@STEP_LOG_END@python.inline@@@"
+ ]
+ },
+ {
+ "cmd": [
+ "python",
+ "-u",
+ "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ncpu = int(sys.argv[2])\ngov = sys.argv[3]\n\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nsubprocess.check_output([ADB, 'shell', 'echo \"%s\" > '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])\nactual_gov = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()\nif actual_gov != str(gov):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_gov, gov))\n",
+ "/usr/bin/adb.1.0.35",
+ "0",
+ "ondemand"
+ ],
+ "env": {
+ "BUILDTYPE": "Debug",
+ "CHROME_HEADLESS": "1",
+ "PATH": "<PATH>:RECIPE_PACKAGE_REPO[depot_tools]",
+ "SKIA_OUT": "[START_DIR]/out"
+ },
+ "infra_step": true,
+ "name": "Set CPU 0's governor to ondemand",
+ "timeout": 30,
+ "~followup_annotations": [
"@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@maxfreq = available_freqs[-1]@@@",
- "@@@STEP_LOG_LINE@python.inline@target = int(round(maxfreq * target_percent))@@@",
- "@@@STEP_LOG_LINE@python.inline@freq = maxfreq@@@",
- "@@@STEP_LOG_LINE@python.inline@for f in reversed(available_freqs):@@@",
- "@@@STEP_LOG_LINE@python.inline@ if f <= target:@@@",
- "@@@STEP_LOG_LINE@python.inline@ freq = f@@@",
- "@@@STEP_LOG_LINE@python.inline@ break@@@",
+ "@@@STEP_LOG_LINE@python.inline@import os@@@",
+ "@@@STEP_LOG_LINE@python.inline@import subprocess@@@",
+ "@@@STEP_LOG_LINE@python.inline@import sys@@@",
+ "@@@STEP_LOG_LINE@python.inline@import time@@@",
+ "@@@STEP_LOG_LINE@python.inline@ADB = sys.argv[1]@@@",
+ "@@@STEP_LOG_LINE@python.inline@cpu = int(sys.argv[2])@@@",
+ "@@@STEP_LOG_LINE@python.inline@gov = sys.argv[3]@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@print 'Setting frequency to %d' % freq@@@",
+ "@@@STEP_LOG_LINE@python.inline@log = subprocess.check_output([ADB, 'root'])@@@",
+ "@@@STEP_LOG_LINE@python.inline@# check for message like 'adbd cannot run as root in production builds'@@@",
+ "@@@STEP_LOG_LINE@python.inline@print log@@@",
+ "@@@STEP_LOG_LINE@python.inline@if 'cannot' in log:@@@",
+ "@@@STEP_LOG_LINE@python.inline@ raise Exception('adb root failed')@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo \"userspace\" > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor'])@@@",
- "@@@STEP_LOG_LINE@python.inline@# If scaling_max_freq is lower than our attempted setting, it won't take.@@@",
- "@@@STEP_LOG_LINE@python.inline@# We must set min first, because if we try to set max to be less than min@@@",
- "@@@STEP_LOG_LINE@python.inline@# (which sometimes happens after certain devices reboot) it returns a@@@",
- "@@@STEP_LOG_LINE@python.inline@# perplexing permissions error.@@@",
- "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo 0 > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq'])@@@",
- "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo %d > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])@@@",
- "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo %d > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed' % freq])@@@",
- "@@@STEP_LOG_LINE@python.inline@time.sleep(5)@@@",
- "@@@STEP_LOG_LINE@python.inline@actual_freq = subprocess.check_output([ADB, 'shell', 'cat '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq']).strip()@@@",
- "@@@STEP_LOG_LINE@python.inline@if actual_freq != str(freq):@@@",
+ "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo \"%s\" > '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])@@@",
+ "@@@STEP_LOG_LINE@python.inline@actual_gov = subprocess.check_output([ADB, 'shell', 'cat '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()@@@",
+ "@@@STEP_LOG_LINE@python.inline@if actual_gov != str(gov):@@@",
"@@@STEP_LOG_LINE@python.inline@ raise Exception('(actual, expected) (%s, %d)'@@@",
- "@@@STEP_LOG_LINE@python.inline@ % (actual_freq, freq))@@@",
+ "@@@STEP_LOG_LINE@python.inline@ % (actual_gov, gov))@@@",
"@@@STEP_LOG_END@python.inline@@@"
]
},
diff --git a/infra/bots/recipes/test.expected/failed_get_hashes.json b/infra/bots/recipes/test.expected/failed_get_hashes.json
index 14f03ca8de..9e88d616e1 100644
--- a/infra/bots/recipes/test.expected/failed_get_hashes.json
+++ b/infra/bots/recipes/test.expected/failed_get_hashes.json
@@ -659,10 +659,10 @@
"cmd": [
"python",
"-u",
- "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\nmodel = sys.argv[2]\ntarget_percent = float(sys.argv[3])\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nif model == 'Nexus7':\n # Nexus7 claims to support 1300000, but only really allows 1200000\n available_freqs = [51000, 102000, 204000, 340000, 475000, 640000, 760000,\n 860000, 1000000, 1100000, 1200000]\nelse:\n # Temporary logging to get a sense of what devices have multiple cpus\n try:\n print subprocess.check_output([ADB, 'shell', 'cat ',\n '/sys/devices/system/cpu/cpu?/cpufreq/affected_cpus'])\n print subprocess.check_output([ADB, 'shell', 'cat ',\n '/sys/devices/system/cpu/cpu?/cpufreq/scaling_available_frequencies'])\n except Exception as e:\n print e.output.strip()\n # Most devices give a list of their available frequencies.\n available_freqs = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies'])\n\n # Check for message like '/system/bin/sh: file not found'\n if available_freqs and '/system/bin/sh' not in available_freqs:\n available_freqs = sorted(\n int(i) for i in available_freqs.strip().split())\n else:\n raise Exception('Could not get list of available frequencies: %s' %\n available_freqs)\n\nmaxfreq = available_freqs[-1]\ntarget = int(round(maxfreq * target_percent))\nfreq = maxfreq\nfor f in reversed(available_freqs):\n if f <= target:\n freq = f\n break\n\nprint 'Setting frequency to %d' % freq\n\nsubprocess.check_output([ADB, 'shell', 'echo \"userspace\" > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor'])\n# If scaling_max_freq is lower than our attempted setting, it won't take.\n# We must set min first, because if we try to set max to be less than min\n# (which sometimes happens after certain devices reboot) it returns a\n# perplexing permissions error.\nsubprocess.check_output([ADB, 'shell', 'echo 0 > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq'])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed' % freq])\ntime.sleep(5)\nactual_freq = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq']).strip()\nif actual_freq != str(freq):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_freq, freq))\n",
+ "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ncpu = int(sys.argv[2])\ngov = sys.argv[3]\n\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nsubprocess.check_output([ADB, 'shell', 'echo \"%s\" > '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])\nactual_gov = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()\nif actual_gov != str(gov):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_gov, gov))\n",
"/usr/bin/adb.1.0.35",
- "Nexus7",
- "1.0"
+ "0",
+ "ondemand"
],
"env": {
"BUILDTYPE": "Release",
@@ -671,7 +671,7 @@
"SKIA_OUT": "[START_DIR]/out"
},
"infra_step": true,
- "name": "Scale CPU to 1.000000",
+ "name": "Set CPU 0's governor to ondemand",
"timeout": 30,
"~followup_annotations": [
"@@@STEP_LOG_LINE@python.inline@@@@",
@@ -680,67 +680,22 @@
"@@@STEP_LOG_LINE@python.inline@import sys@@@",
"@@@STEP_LOG_LINE@python.inline@import time@@@",
"@@@STEP_LOG_LINE@python.inline@ADB = sys.argv[1]@@@",
- "@@@STEP_LOG_LINE@python.inline@model = sys.argv[2]@@@",
- "@@@STEP_LOG_LINE@python.inline@target_percent = float(sys.argv[3])@@@",
+ "@@@STEP_LOG_LINE@python.inline@cpu = int(sys.argv[2])@@@",
+ "@@@STEP_LOG_LINE@python.inline@gov = sys.argv[3]@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@log = subprocess.check_output([ADB, 'root'])@@@",
"@@@STEP_LOG_LINE@python.inline@# check for message like 'adbd cannot run as root in production builds'@@@",
"@@@STEP_LOG_LINE@python.inline@print log@@@",
"@@@STEP_LOG_LINE@python.inline@if 'cannot' in log:@@@",
"@@@STEP_LOG_LINE@python.inline@ raise Exception('adb root failed')@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@if model == 'Nexus7':@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Nexus7 claims to support 1300000, but only really allows 1200000@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = [51000, 102000, 204000, 340000, 475000, 640000, 760000,@@@",
- "@@@STEP_LOG_LINE@python.inline@ 860000, 1000000, 1100000, 1200000]@@@",
- "@@@STEP_LOG_LINE@python.inline@else:@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Temporary logging to get a sense of what devices have multiple cpus@@@",
- "@@@STEP_LOG_LINE@python.inline@ try:@@@",
- "@@@STEP_LOG_LINE@python.inline@ print subprocess.check_output([ADB, 'shell', 'cat ',@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu?/cpufreq/affected_cpus'])@@@",
- "@@@STEP_LOG_LINE@python.inline@ print subprocess.check_output([ADB, 'shell', 'cat ',@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu?/cpufreq/scaling_available_frequencies'])@@@",
- "@@@STEP_LOG_LINE@python.inline@ except Exception as e:@@@",
- "@@@STEP_LOG_LINE@python.inline@ print e.output.strip()@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Most devices give a list of their available frequencies.@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = subprocess.check_output([ADB, 'shell', 'cat '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies'])@@@",
- "@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Check for message like '/system/bin/sh: file not found'@@@",
- "@@@STEP_LOG_LINE@python.inline@ if available_freqs and '/system/bin/sh' not in available_freqs:@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = sorted(@@@",
- "@@@STEP_LOG_LINE@python.inline@ int(i) for i in available_freqs.strip().split())@@@",
- "@@@STEP_LOG_LINE@python.inline@ else:@@@",
- "@@@STEP_LOG_LINE@python.inline@ raise Exception('Could not get list of available frequencies: %s' %@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs)@@@",
- "@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@maxfreq = available_freqs[-1]@@@",
- "@@@STEP_LOG_LINE@python.inline@target = int(round(maxfreq * target_percent))@@@",
- "@@@STEP_LOG_LINE@python.inline@freq = maxfreq@@@",
- "@@@STEP_LOG_LINE@python.inline@for f in reversed(available_freqs):@@@",
- "@@@STEP_LOG_LINE@python.inline@ if f <= target:@@@",
- "@@@STEP_LOG_LINE@python.inline@ freq = f@@@",
- "@@@STEP_LOG_LINE@python.inline@ break@@@",
- "@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@print 'Setting frequency to %d' % freq@@@",
- "@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo \"userspace\" > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor'])@@@",
- "@@@STEP_LOG_LINE@python.inline@# If scaling_max_freq is lower than our attempted setting, it won't take.@@@",
- "@@@STEP_LOG_LINE@python.inline@# We must set min first, because if we try to set max to be less than min@@@",
- "@@@STEP_LOG_LINE@python.inline@# (which sometimes happens after certain devices reboot) it returns a@@@",
- "@@@STEP_LOG_LINE@python.inline@# perplexing permissions error.@@@",
- "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo 0 > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq'])@@@",
- "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo %d > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])@@@",
- "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo %d > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed' % freq])@@@",
- "@@@STEP_LOG_LINE@python.inline@time.sleep(5)@@@",
- "@@@STEP_LOG_LINE@python.inline@actual_freq = subprocess.check_output([ADB, 'shell', 'cat '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq']).strip()@@@",
- "@@@STEP_LOG_LINE@python.inline@if actual_freq != str(freq):@@@",
+ "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo \"%s\" > '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])@@@",
+ "@@@STEP_LOG_LINE@python.inline@actual_gov = subprocess.check_output([ADB, 'shell', 'cat '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()@@@",
+ "@@@STEP_LOG_LINE@python.inline@if actual_gov != str(gov):@@@",
"@@@STEP_LOG_LINE@python.inline@ raise Exception('(actual, expected) (%s, %d)'@@@",
- "@@@STEP_LOG_LINE@python.inline@ % (actual_freq, freq))@@@",
+ "@@@STEP_LOG_LINE@python.inline@ % (actual_gov, gov))@@@",
"@@@STEP_LOG_END@python.inline@@@"
]
},
diff --git a/infra/bots/recipes/test.expected/failed_pull.json b/infra/bots/recipes/test.expected/failed_pull.json
index 0008c7d227..343e73269e 100644
--- a/infra/bots/recipes/test.expected/failed_pull.json
+++ b/infra/bots/recipes/test.expected/failed_pull.json
@@ -657,10 +657,10 @@
"cmd": [
"python",
"-u",
- "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\nmodel = sys.argv[2]\ntarget_percent = float(sys.argv[3])\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nif model == 'Nexus7':\n # Nexus7 claims to support 1300000, but only really allows 1200000\n available_freqs = [51000, 102000, 204000, 340000, 475000, 640000, 760000,\n 860000, 1000000, 1100000, 1200000]\nelse:\n # Temporary logging to get a sense of what devices have multiple cpus\n try:\n print subprocess.check_output([ADB, 'shell', 'cat ',\n '/sys/devices/system/cpu/cpu?/cpufreq/affected_cpus'])\n print subprocess.check_output([ADB, 'shell', 'cat ',\n '/sys/devices/system/cpu/cpu?/cpufreq/scaling_available_frequencies'])\n except Exception as e:\n print e.output.strip()\n # Most devices give a list of their available frequencies.\n available_freqs = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies'])\n\n # Check for message like '/system/bin/sh: file not found'\n if available_freqs and '/system/bin/sh' not in available_freqs:\n available_freqs = sorted(\n int(i) for i in available_freqs.strip().split())\n else:\n raise Exception('Could not get list of available frequencies: %s' %\n available_freqs)\n\nmaxfreq = available_freqs[-1]\ntarget = int(round(maxfreq * target_percent))\nfreq = maxfreq\nfor f in reversed(available_freqs):\n if f <= target:\n freq = f\n break\n\nprint 'Setting frequency to %d' % freq\n\nsubprocess.check_output([ADB, 'shell', 'echo \"userspace\" > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor'])\n# If scaling_max_freq is lower than our attempted setting, it won't take.\n# We must set min first, because if we try to set max to be less than min\n# (which sometimes happens after certain devices reboot) it returns a\n# perplexing permissions error.\nsubprocess.check_output([ADB, 'shell', 'echo 0 > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq'])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed' % freq])\ntime.sleep(5)\nactual_freq = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq']).strip()\nif actual_freq != str(freq):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_freq, freq))\n",
+ "\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ncpu = int(sys.argv[2])\ngov = sys.argv[3]\n\nlog = subprocess.check_output([ADB, 'root'])\n# check for message like 'adbd cannot run as root in production builds'\nprint log\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nsubprocess.check_output([ADB, 'shell', 'echo \"%s\" > '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])\nactual_gov = subprocess.check_output([ADB, 'shell', 'cat '\n '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()\nif actual_gov != str(gov):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_gov, gov))\n",
"/usr/bin/adb.1.0.35",
- "Nexus7",
- "1.0"
+ "0",
+ "ondemand"
],
"env": {
"BUILDTYPE": "Debug",
@@ -669,7 +669,7 @@
"SKIA_OUT": "[START_DIR]/out"
},
"infra_step": true,
- "name": "Scale CPU to 1.000000",
+ "name": "Set CPU 0's governor to ondemand",
"timeout": 30,
"~followup_annotations": [
"@@@STEP_LOG_LINE@python.inline@@@@",
@@ -678,67 +678,22 @@
"@@@STEP_LOG_LINE@python.inline@import sys@@@",
"@@@STEP_LOG_LINE@python.inline@import time@@@",
"@@@STEP_LOG_LINE@python.inline@ADB = sys.argv[1]@@@",
- "@@@STEP_LOG_LINE@python.inline@model = sys.argv[2]@@@",
- "@@@STEP_LOG_LINE@python.inline@target_percent = float(sys.argv[3])@@@",
+ "@@@STEP_LOG_LINE@python.inline@cpu = int(sys.argv[2])@@@",
+ "@@@STEP_LOG_LINE@python.inline@gov = sys.argv[3]@@@",
+ "@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@log = subprocess.check_output([ADB, 'root'])@@@",
"@@@STEP_LOG_LINE@python.inline@# check for message like 'adbd cannot run as root in production builds'@@@",
"@@@STEP_LOG_LINE@python.inline@print log@@@",
"@@@STEP_LOG_LINE@python.inline@if 'cannot' in log:@@@",
"@@@STEP_LOG_LINE@python.inline@ raise Exception('adb root failed')@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@if model == 'Nexus7':@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Nexus7 claims to support 1300000, but only really allows 1200000@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = [51000, 102000, 204000, 340000, 475000, 640000, 760000,@@@",
- "@@@STEP_LOG_LINE@python.inline@ 860000, 1000000, 1100000, 1200000]@@@",
- "@@@STEP_LOG_LINE@python.inline@else:@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Temporary logging to get a sense of what devices have multiple cpus@@@",
- "@@@STEP_LOG_LINE@python.inline@ try:@@@",
- "@@@STEP_LOG_LINE@python.inline@ print subprocess.check_output([ADB, 'shell', 'cat ',@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu?/cpufreq/affected_cpus'])@@@",
- "@@@STEP_LOG_LINE@python.inline@ print subprocess.check_output([ADB, 'shell', 'cat ',@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu?/cpufreq/scaling_available_frequencies'])@@@",
- "@@@STEP_LOG_LINE@python.inline@ except Exception as e:@@@",
- "@@@STEP_LOG_LINE@python.inline@ print e.output.strip()@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Most devices give a list of their available frequencies.@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = subprocess.check_output([ADB, 'shell', 'cat '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies'])@@@",
- "@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@ # Check for message like '/system/bin/sh: file not found'@@@",
- "@@@STEP_LOG_LINE@python.inline@ if available_freqs and '/system/bin/sh' not in available_freqs:@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs = sorted(@@@",
- "@@@STEP_LOG_LINE@python.inline@ int(i) for i in available_freqs.strip().split())@@@",
- "@@@STEP_LOG_LINE@python.inline@ else:@@@",
- "@@@STEP_LOG_LINE@python.inline@ raise Exception('Could not get list of available frequencies: %s' %@@@",
- "@@@STEP_LOG_LINE@python.inline@ available_freqs)@@@",
- "@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@maxfreq = available_freqs[-1]@@@",
- "@@@STEP_LOG_LINE@python.inline@target = int(round(maxfreq * target_percent))@@@",
- "@@@STEP_LOG_LINE@python.inline@freq = maxfreq@@@",
- "@@@STEP_LOG_LINE@python.inline@for f in reversed(available_freqs):@@@",
- "@@@STEP_LOG_LINE@python.inline@ if f <= target:@@@",
- "@@@STEP_LOG_LINE@python.inline@ freq = f@@@",
- "@@@STEP_LOG_LINE@python.inline@ break@@@",
- "@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@print 'Setting frequency to %d' % freq@@@",
- "@@@STEP_LOG_LINE@python.inline@@@@",
- "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo \"userspace\" > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor'])@@@",
- "@@@STEP_LOG_LINE@python.inline@# If scaling_max_freq is lower than our attempted setting, it won't take.@@@",
- "@@@STEP_LOG_LINE@python.inline@# We must set min first, because if we try to set max to be less than min@@@",
- "@@@STEP_LOG_LINE@python.inline@# (which sometimes happens after certain devices reboot) it returns a@@@",
- "@@@STEP_LOG_LINE@python.inline@# perplexing permissions error.@@@",
- "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo 0 > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq'])@@@",
- "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo %d > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])@@@",
- "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo %d > '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed' % freq])@@@",
- "@@@STEP_LOG_LINE@python.inline@time.sleep(5)@@@",
- "@@@STEP_LOG_LINE@python.inline@actual_freq = subprocess.check_output([ADB, 'shell', 'cat '@@@",
- "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq']).strip()@@@",
- "@@@STEP_LOG_LINE@python.inline@if actual_freq != str(freq):@@@",
+ "@@@STEP_LOG_LINE@python.inline@subprocess.check_output([ADB, 'shell', 'echo \"%s\" > '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % (gov, cpu)])@@@",
+ "@@@STEP_LOG_LINE@python.inline@actual_gov = subprocess.check_output([ADB, 'shell', 'cat '@@@",
+ "@@@STEP_LOG_LINE@python.inline@ '/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor' % cpu]).strip()@@@",
+ "@@@STEP_LOG_LINE@python.inline@if actual_gov != str(gov):@@@",
"@@@STEP_LOG_LINE@python.inline@ raise Exception('(actual, expected) (%s, %d)'@@@",
- "@@@STEP_LOG_LINE@python.inline@ % (actual_freq, freq))@@@",
+ "@@@STEP_LOG_LINE@python.inline@ % (actual_gov, gov))@@@",
"@@@STEP_LOG_END@python.inline@@@"
]
},