diff options
author | Kevin Lubick <kjlubick@google.com> | 2017-12-08 10:26:56 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-12-08 15:41:50 +0000 |
commit | 7f5d5d2baba439a78a5a2e4f5149a17236ed84fe (patch) | |
tree | dd2e0210f72a7f687ea5895868123d870e16af74 /infra | |
parent | 3f330693a01cac6dbfdbdcef1346ca9b59c09ee5 (diff) |
Fix scaling issues for some devices (e.g. Pixel)
Bug: skia:
NOTRY=true
Change-Id: Ia6a80ecb97b5d30197932ec7d340163624e315bd
Reviewed-on: https://skia-review.googlesource.com/82682
Reviewed-by: Ravi Mistry <rmistry@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Diffstat (limited to 'infra')
31 files changed, 525 insertions, 105 deletions
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 88f0f2864d..c98525b52d 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,7 +642,7 @@ "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'\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nif model == 'Nexus10':\n # Nexus10 doesn't list available frequencies, but it does give a\n # min and a max and seems to round to the nearest 100khz, so a\n # subset of those available are here.\n available_freqs = [200000, 400000, 600000, 800000, 1000000, 1200000,\n 1400000, 1700000]\nelif 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 # 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.\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])\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_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]\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 == 'Nexus10':\n # Nexus10 doesn't list available frequencies, but it does give a\n # min and a max and seems to round to the nearest 100khz, so a\n # subset of those available are here.\n available_freqs = [200000, 400000, 600000, 800000, 1000000, 1200000,\n 1400000, 1700000]\nelif 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", "/usr/bin/adb.1.0.35", "NexusPlayer", "0.6" @@ -667,6 +667,7 @@ "@@@STEP_LOG_LINE@python.inline@target_percent = float(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@@@@", @@ -681,6 +682,14 @@ "@@@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'])@@@", @@ -706,11 +715,14 @@ "@@@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@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@# 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 '@@@", 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 c06b70c22e..cf6dc6db8f 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,7 +642,7 @@ "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'\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nif model == 'Nexus10':\n # Nexus10 doesn't list available frequencies, but it does give a\n # min and a max and seems to round to the nearest 100khz, so a\n # subset of those available are here.\n available_freqs = [200000, 400000, 600000, 800000, 1000000, 1200000,\n 1400000, 1700000]\nelif 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 # 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.\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])\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_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]\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 == 'Nexus10':\n # Nexus10 doesn't list available frequencies, but it does give a\n # min and a max and seems to round to the nearest 100khz, so a\n # subset of those available are here.\n available_freqs = [200000, 400000, 600000, 800000, 1000000, 1200000,\n 1400000, 1700000]\nelif 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", "/usr/bin/adb.1.0.35", "Pixel", "0.6" @@ -667,6 +667,7 @@ "@@@STEP_LOG_LINE@python.inline@target_percent = float(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@@@@", @@ -681,6 +682,14 @@ "@@@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'])@@@", @@ -706,11 +715,14 @@ "@@@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@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@# 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 '@@@", 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 b6600b7ea2..aadc078200 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,7 +642,7 @@ "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'\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nif model == 'Nexus10':\n # Nexus10 doesn't list available frequencies, but it does give a\n # min and a max and seems to round to the nearest 100khz, so a\n # subset of those available are here.\n available_freqs = [200000, 400000, 600000, 800000, 1000000, 1200000,\n 1400000, 1700000]\nelif 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 # 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.\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])\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_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]\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 == 'Nexus10':\n # Nexus10 doesn't list available frequencies, but it does give a\n # min and a max and seems to round to the nearest 100khz, so a\n # subset of those available are here.\n available_freqs = [200000, 400000, 600000, 800000, 1000000, 1200000,\n 1400000, 1700000]\nelif 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", "/opt/infra-android/tools/adb", "Nexus5x", "1.0" @@ -667,6 +667,7 @@ "@@@STEP_LOG_LINE@python.inline@target_percent = float(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@@@@", @@ -681,6 +682,14 @@ "@@@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'])@@@", @@ -706,11 +715,14 @@ "@@@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@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@# 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 '@@@", 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 15c81ed899..18288efeeb 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,7 +642,7 @@ "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'\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nif model == 'Nexus10':\n # Nexus10 doesn't list available frequencies, but it does give a\n # min and a max and seems to round to the nearest 100khz, so a\n # subset of those available are here.\n available_freqs = [200000, 400000, 600000, 800000, 1000000, 1200000,\n 1400000, 1700000]\nelif 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 # 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.\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])\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_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]\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 == 'Nexus10':\n # Nexus10 doesn't list available frequencies, but it does give a\n # min and a max and seems to round to the nearest 100khz, so a\n # subset of those available are here.\n available_freqs = [200000, 400000, 600000, 800000, 1000000, 1200000,\n 1400000, 1700000]\nelif 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", "/usr/bin/adb.1.0.35", "Nexus7", "1.0" @@ -667,6 +667,7 @@ "@@@STEP_LOG_LINE@python.inline@target_percent = float(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@@@@", @@ -681,6 +682,14 @@ "@@@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'])@@@", @@ -706,11 +715,14 @@ "@@@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@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@# 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 '@@@", 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 02a1ee281a..0ad2789f2c 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,7 +642,7 @@ "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'\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nif model == 'Nexus10':\n # Nexus10 doesn't list available frequencies, but it does give a\n # min and a max and seems to round to the nearest 100khz, so a\n # subset of those available are here.\n available_freqs = [200000, 400000, 600000, 800000, 1000000, 1200000,\n 1400000, 1700000]\nelif 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 # 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.\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])\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_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]\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 == 'Nexus10':\n # Nexus10 doesn't list available frequencies, but it does give a\n # min and a max and seems to round to the nearest 100khz, so a\n # subset of those available are here.\n available_freqs = [200000, 400000, 600000, 800000, 1000000, 1200000,\n 1400000, 1700000]\nelif 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", "/usr/bin/adb.1.0.35", "Pixel", "1.0" @@ -667,6 +667,7 @@ "@@@STEP_LOG_LINE@python.inline@target_percent = float(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@@@@", @@ -681,6 +682,14 @@ "@@@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'])@@@", @@ -706,11 +715,14 @@ "@@@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@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@# 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 '@@@", 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 01bb4bb37e..2f656682f1 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,7 +642,7 @@ "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'\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nif model == 'Nexus10':\n # Nexus10 doesn't list available frequencies, but it does give a\n # min and a max and seems to round to the nearest 100khz, so a\n # subset of those available are here.\n available_freqs = [200000, 400000, 600000, 800000, 1000000, 1200000,\n 1400000, 1700000]\nelif 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 # 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.\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])\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_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]\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 == 'Nexus10':\n # Nexus10 doesn't list available frequencies, but it does give a\n # min and a max and seems to round to the nearest 100khz, so a\n # subset of those available are here.\n available_freqs = [200000, 400000, 600000, 800000, 1000000, 1200000,\n 1400000, 1700000]\nelif 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", "/usr/bin/adb.1.0.35", "NexusPlayer", "0.6" @@ -668,6 +668,7 @@ "@@@STEP_LOG_LINE@python.inline@target_percent = float(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@@@@", @@ -682,6 +683,14 @@ "@@@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'])@@@", @@ -707,11 +716,14 @@ "@@@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@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@# 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 '@@@", @@ -727,7 +739,7 @@ "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'\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nif model == 'Nexus10':\n # Nexus10 doesn't list available frequencies, but it does give a\n # min and a max and seems to round to the nearest 100khz, so a\n # subset of those available are here.\n available_freqs = [200000, 400000, 600000, 800000, 1000000, 1200000,\n 1400000, 1700000]\nelif 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 # 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.\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])\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_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]\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 == 'Nexus10':\n # Nexus10 doesn't list available frequencies, but it does give a\n # min and a max and seems to round to the nearest 100khz, so a\n # subset of those available are here.\n available_freqs = [200000, 400000, 600000, 800000, 1000000, 1200000,\n 1400000, 1700000]\nelif 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", "/usr/bin/adb.1.0.35", "NexusPlayer", "0.6" @@ -752,6 +764,7 @@ "@@@STEP_LOG_LINE@python.inline@target_percent = float(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@@@@", @@ -766,6 +779,14 @@ "@@@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'])@@@", @@ -791,11 +812,14 @@ "@@@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@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@# 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 '@@@", 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 0d0eb4b752..f990f8fc02 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,7 +642,7 @@ "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'\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nif model == 'Nexus10':\n # Nexus10 doesn't list available frequencies, but it does give a\n # min and a max and seems to round to the nearest 100khz, so a\n # subset of those available are here.\n available_freqs = [200000, 400000, 600000, 800000, 1000000, 1200000,\n 1400000, 1700000]\nelif 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 # 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.\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])\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_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]\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 == 'Nexus10':\n # Nexus10 doesn't list available frequencies, but it does give a\n # min and a max and seems to round to the nearest 100khz, so a\n # subset of those available are here.\n available_freqs = [200000, 400000, 600000, 800000, 1000000, 1200000,\n 1400000, 1700000]\nelif 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", "/usr/bin/adb.1.0.35", "NexusPlayer", "0.6" @@ -667,6 +667,7 @@ "@@@STEP_LOG_LINE@python.inline@target_percent = float(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@@@@", @@ -681,6 +682,14 @@ "@@@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'])@@@", @@ -706,11 +715,14 @@ "@@@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@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@# 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 '@@@", 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 f695dfff5c..aed381a7d2 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,7 +696,7 @@ "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'\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nif model == 'Nexus10':\n # Nexus10 doesn't list available frequencies, but it does give a\n # min and a max and seems to round to the nearest 100khz, so a\n # subset of those available are here.\n available_freqs = [200000, 400000, 600000, 800000, 1000000, 1200000,\n 1400000, 1700000]\nelif 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 # 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.\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])\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_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]\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 == 'Nexus10':\n # Nexus10 doesn't list available frequencies, but it does give a\n # min and a max and seems to round to the nearest 100khz, so a\n # subset of those available are here.\n available_freqs = [200000, 400000, 600000, 800000, 1000000, 1200000,\n 1400000, 1700000]\nelif 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", "/usr/bin/adb.1.0.35", "NexusPlayer", "0.6" @@ -721,6 +721,7 @@ "@@@STEP_LOG_LINE@python.inline@target_percent = float(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@@@@", @@ -735,6 +736,14 @@ "@@@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'])@@@", @@ -760,11 +769,14 @@ "@@@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@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@# 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 '@@@", 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 937684c929..fde30d8232 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,7 +696,7 @@ "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'\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nif model == 'Nexus10':\n # Nexus10 doesn't list available frequencies, but it does give a\n # min and a max and seems to round to the nearest 100khz, so a\n # subset of those available are here.\n available_freqs = [200000, 400000, 600000, 800000, 1000000, 1200000,\n 1400000, 1700000]\nelif 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 # 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.\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])\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_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]\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 == 'Nexus10':\n # Nexus10 doesn't list available frequencies, but it does give a\n # min and a max and seems to round to the nearest 100khz, so a\n # subset of those available are here.\n available_freqs = [200000, 400000, 600000, 800000, 1000000, 1200000,\n 1400000, 1700000]\nelif 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", "/usr/bin/adb.1.0.35", "NexusPlayer", "0.6" @@ -721,6 +721,7 @@ "@@@STEP_LOG_LINE@python.inline@target_percent = float(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@@@@", @@ -735,6 +736,14 @@ "@@@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'])@@@", @@ -760,11 +769,14 @@ "@@@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@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@# 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 '@@@", diff --git a/infra/bots/recipe_modules/flavor/gn_android_flavor.py b/infra/bots/recipe_modules/flavor/gn_android_flavor.py index 6bb444bcf2..98b128d99c 100644 --- a/infra/bots/recipe_modules/flavor/gn_android_flavor.py +++ b/infra/bots/recipe_modules/flavor/gn_android_flavor.py @@ -90,6 +90,7 @@ model = sys.argv[2] target_percent = float(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') @@ -104,6 +105,14 @@ elif model == 'Nexus7': available_freqs = [51000, 102000, 204000, 340000, 475000, 640000, 760000, 860000, 1000000, 1100000, 1200000] 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']) @@ -129,11 +138,14 @@ 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. -subprocess.check_output([ADB, 'shell', 'echo %d > ' - '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq]) +# 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']) subprocess.check_output([ADB, 'shell', 'echo %d > ' + '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq]) +subprocess.check_output([ADB, 'shell', 'echo %d > ' '/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed' % freq]) time.sleep(5) actual_freq = subprocess.check_output([ADB, 'shell', 'cat ' @@ -141,7 +153,7 @@ actual_freq = subprocess.check_output([ADB, 'shell', 'cat ' 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)], infra_step=True, 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 d071f15843..c01913d479 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,7 +540,7 @@ "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'\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nif model == 'Nexus10':\n # Nexus10 doesn't list available frequencies, but it does give a\n # min and a max and seems to round to the nearest 100khz, so a\n # subset of those available are here.\n available_freqs = [200000, 400000, 600000, 800000, 1000000, 1200000,\n 1400000, 1700000]\nelif 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 # 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.\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])\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_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]\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 == 'Nexus10':\n # Nexus10 doesn't list available frequencies, but it does give a\n # min and a max and seems to round to the nearest 100khz, so a\n # subset of those available are here.\n available_freqs = [200000, 400000, 600000, 800000, 1000000, 1200000,\n 1400000, 1700000]\nelif 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", "/usr/bin/adb.1.0.35", "Nexus5", "0.6" @@ -565,6 +565,7 @@ "@@@STEP_LOG_LINE@python.inline@target_percent = float(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@@@@", @@ -579,6 +580,14 @@ "@@@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'])@@@", @@ -604,11 +613,14 @@ "@@@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@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@# 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 '@@@", 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 d062256767..a1b6466b94 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,7 +576,7 @@ "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'\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nif model == 'Nexus10':\n # Nexus10 doesn't list available frequencies, but it does give a\n # min and a max and seems to round to the nearest 100khz, so a\n # subset of those available are here.\n available_freqs = [200000, 400000, 600000, 800000, 1000000, 1200000,\n 1400000, 1700000]\nelif 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 # 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.\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])\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_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]\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 == 'Nexus10':\n # Nexus10 doesn't list available frequencies, but it does give a\n # min and a max and seems to round to the nearest 100khz, so a\n # subset of those available are here.\n available_freqs = [200000, 400000, 600000, 800000, 1000000, 1200000,\n 1400000, 1700000]\nelif 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", "/opt/infra-android/tools/adb", "Nexus5x", "0.6" @@ -601,6 +601,7 @@ "@@@STEP_LOG_LINE@python.inline@target_percent = float(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@@@@", @@ -615,6 +616,14 @@ "@@@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'])@@@", @@ -640,11 +649,14 @@ "@@@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@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@# 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 '@@@", 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 724209825f..d31e0143a0 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,7 +576,7 @@ "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'\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nif model == 'Nexus10':\n # Nexus10 doesn't list available frequencies, but it does give a\n # min and a max and seems to round to the nearest 100khz, so a\n # subset of those available are here.\n available_freqs = [200000, 400000, 600000, 800000, 1000000, 1200000,\n 1400000, 1700000]\nelif 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 # 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.\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])\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_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]\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 == 'Nexus10':\n # Nexus10 doesn't list available frequencies, but it does give a\n # min and a max and seems to round to the nearest 100khz, so a\n # subset of those available are here.\n available_freqs = [200000, 400000, 600000, 800000, 1000000, 1200000,\n 1400000, 1700000]\nelif 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", "/usr/bin/adb.1.0.35", "Nexus7", "0.6" @@ -601,6 +601,7 @@ "@@@STEP_LOG_LINE@python.inline@target_percent = float(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@@@@", @@ -615,6 +616,14 @@ "@@@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'])@@@", @@ -640,11 +649,14 @@ "@@@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@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@# 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 '@@@", 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 d71b006d84..a739e8f8da 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,7 +576,7 @@ "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'\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nif model == 'Nexus10':\n # Nexus10 doesn't list available frequencies, but it does give a\n # min and a max and seems to round to the nearest 100khz, so a\n # subset of those available are here.\n available_freqs = [200000, 400000, 600000, 800000, 1000000, 1200000,\n 1400000, 1700000]\nelif 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 # 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.\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])\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_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]\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 == 'Nexus10':\n # Nexus10 doesn't list available frequencies, but it does give a\n # min and a max and seems to round to the nearest 100khz, so a\n # subset of those available are here.\n available_freqs = [200000, 400000, 600000, 800000, 1000000, 1200000,\n 1400000, 1700000]\nelif 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", "/usr/bin/adb.1.0.35", "Nexus7", "0.6" @@ -601,6 +601,7 @@ "@@@STEP_LOG_LINE@python.inline@target_percent = float(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@@@@", @@ -615,6 +616,14 @@ "@@@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'])@@@", @@ -640,11 +649,14 @@ "@@@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@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@# 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 '@@@", 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 0719286a23..51180ed4a7 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,7 +576,7 @@ "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'\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nif model == 'Nexus10':\n # Nexus10 doesn't list available frequencies, but it does give a\n # min and a max and seems to round to the nearest 100khz, so a\n # subset of those available are here.\n available_freqs = [200000, 400000, 600000, 800000, 1000000, 1200000,\n 1400000, 1700000]\nelif 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 # 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.\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])\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_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]\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 == 'Nexus10':\n # Nexus10 doesn't list available frequencies, but it does give a\n # min and a max and seems to round to the nearest 100khz, so a\n # subset of those available are here.\n available_freqs = [200000, 400000, 600000, 800000, 1000000, 1200000,\n 1400000, 1700000]\nelif 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", "/usr/bin/adb.1.0.35", "NexusPlayer", "0.6" @@ -601,6 +601,7 @@ "@@@STEP_LOG_LINE@python.inline@target_percent = float(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@@@@", @@ -615,6 +616,14 @@ "@@@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'])@@@", @@ -640,11 +649,14 @@ "@@@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@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@# 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 '@@@", 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 3867ca42a3..46987fe38c 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,7 +576,7 @@ "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'\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nif model == 'Nexus10':\n # Nexus10 doesn't list available frequencies, but it does give a\n # min and a max and seems to round to the nearest 100khz, so a\n # subset of those available are here.\n available_freqs = [200000, 400000, 600000, 800000, 1000000, 1200000,\n 1400000, 1700000]\nelif 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 # 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.\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])\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_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]\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 == 'Nexus10':\n # Nexus10 doesn't list available frequencies, but it does give a\n # min and a max and seems to round to the nearest 100khz, so a\n # subset of those available are here.\n available_freqs = [200000, 400000, 600000, 800000, 1000000, 1200000,\n 1400000, 1700000]\nelif 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", "/usr/bin/adb.1.0.35", "NexusPlayer", "0.6" @@ -601,6 +601,7 @@ "@@@STEP_LOG_LINE@python.inline@target_percent = float(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@@@@", @@ -615,6 +616,14 @@ "@@@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'])@@@", @@ -640,11 +649,14 @@ "@@@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@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@# 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 '@@@", 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 6eb5f97e79..a035f41df6 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,7 +576,7 @@ "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'\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nif model == 'Nexus10':\n # Nexus10 doesn't list available frequencies, but it does give a\n # min and a max and seems to round to the nearest 100khz, so a\n # subset of those available are here.\n available_freqs = [200000, 400000, 600000, 800000, 1000000, 1200000,\n 1400000, 1700000]\nelif 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 # 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.\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])\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_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]\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 == 'Nexus10':\n # Nexus10 doesn't list available frequencies, but it does give a\n # min and a max and seems to round to the nearest 100khz, so a\n # subset of those available are here.\n available_freqs = [200000, 400000, 600000, 800000, 1000000, 1200000,\n 1400000, 1700000]\nelif 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", "/usr/bin/adb.1.0.35", "PixelC", "0.6" @@ -601,6 +601,7 @@ "@@@STEP_LOG_LINE@python.inline@target_percent = float(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@@@@", @@ -615,6 +616,14 @@ "@@@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'])@@@", @@ -640,11 +649,14 @@ "@@@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@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@# 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 '@@@", diff --git a/infra/bots/recipes/perf.expected/cpu_scale_failed.json b/infra/bots/recipes/perf.expected/cpu_scale_failed.json index 0e628a5f5b..e993389490 100644 --- a/infra/bots/recipes/perf.expected/cpu_scale_failed.json +++ b/infra/bots/recipes/perf.expected/cpu_scale_failed.json @@ -540,7 +540,7 @@ "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'\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nif model == 'Nexus10':\n # Nexus10 doesn't list available frequencies, but it does give a\n # min and a max and seems to round to the nearest 100khz, so a\n # subset of those available are here.\n available_freqs = [200000, 400000, 600000, 800000, 1000000, 1200000,\n 1400000, 1700000]\nelif 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 # 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.\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])\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_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]\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 == 'Nexus10':\n # Nexus10 doesn't list available frequencies, but it does give a\n # min and a max and seems to round to the nearest 100khz, so a\n # subset of those available are here.\n available_freqs = [200000, 400000, 600000, 800000, 1000000, 1200000,\n 1400000, 1700000]\nelif 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", "/usr/bin/adb.1.0.35", "NexusPlayer", "0.6" @@ -566,6 +566,7 @@ "@@@STEP_LOG_LINE@python.inline@target_percent = float(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@@@@", @@ -580,6 +581,14 @@ "@@@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'])@@@", @@ -605,11 +614,14 @@ "@@@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@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@# 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 '@@@", @@ -625,7 +637,7 @@ "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'\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nif model == 'Nexus10':\n # Nexus10 doesn't list available frequencies, but it does give a\n # min and a max and seems to round to the nearest 100khz, so a\n # subset of those available are here.\n available_freqs = [200000, 400000, 600000, 800000, 1000000, 1200000,\n 1400000, 1700000]\nelif 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 # 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.\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])\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_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]\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 == 'Nexus10':\n # Nexus10 doesn't list available frequencies, but it does give a\n # min and a max and seems to round to the nearest 100khz, so a\n # subset of those available are here.\n available_freqs = [200000, 400000, 600000, 800000, 1000000, 1200000,\n 1400000, 1700000]\nelif 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", "/usr/bin/adb.1.0.35", "NexusPlayer", "0.6" @@ -651,6 +663,7 @@ "@@@STEP_LOG_LINE@python.inline@target_percent = float(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@@@@", @@ -665,6 +678,14 @@ "@@@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'])@@@", @@ -690,11 +711,14 @@ "@@@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@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@# 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 '@@@", @@ -710,7 +734,7 @@ "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'\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nif model == 'Nexus10':\n # Nexus10 doesn't list available frequencies, but it does give a\n # min and a max and seems to round to the nearest 100khz, so a\n # subset of those available are here.\n available_freqs = [200000, 400000, 600000, 800000, 1000000, 1200000,\n 1400000, 1700000]\nelif 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 # 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.\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])\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_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]\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 == 'Nexus10':\n # Nexus10 doesn't list available frequencies, but it does give a\n # min and a max and seems to round to the nearest 100khz, so a\n # subset of those available are here.\n available_freqs = [200000, 400000, 600000, 800000, 1000000, 1200000,\n 1400000, 1700000]\nelif 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", "/usr/bin/adb.1.0.35", "NexusPlayer", "0.6" @@ -736,6 +760,7 @@ "@@@STEP_LOG_LINE@python.inline@target_percent = float(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@@@@", @@ -750,6 +775,14 @@ "@@@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'])@@@", @@ -775,11 +808,14 @@ "@@@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@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@# 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 '@@@", 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 dd803e5670..21d479bb8b 100644 --- a/infra/bots/recipes/perf.expected/cpu_scale_failed_once.json +++ b/infra/bots/recipes/perf.expected/cpu_scale_failed_once.json @@ -540,7 +540,7 @@ "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'\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nif model == 'Nexus10':\n # Nexus10 doesn't list available frequencies, but it does give a\n # min and a max and seems to round to the nearest 100khz, so a\n # subset of those available are here.\n available_freqs = [200000, 400000, 600000, 800000, 1000000, 1200000,\n 1400000, 1700000]\nelif 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 # 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.\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])\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_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]\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 == 'Nexus10':\n # Nexus10 doesn't list available frequencies, but it does give a\n # min and a max and seems to round to the nearest 100khz, so a\n # subset of those available are here.\n available_freqs = [200000, 400000, 600000, 800000, 1000000, 1200000,\n 1400000, 1700000]\nelif 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", "/usr/bin/adb.1.0.35", "NexusPlayer", "0.6" @@ -566,6 +566,7 @@ "@@@STEP_LOG_LINE@python.inline@target_percent = float(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@@@@", @@ -580,6 +581,14 @@ "@@@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'])@@@", @@ -605,11 +614,14 @@ "@@@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@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@# 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 '@@@", @@ -625,7 +637,7 @@ "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'\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nif model == 'Nexus10':\n # Nexus10 doesn't list available frequencies, but it does give a\n # min and a max and seems to round to the nearest 100khz, so a\n # subset of those available are here.\n available_freqs = [200000, 400000, 600000, 800000, 1000000, 1200000,\n 1400000, 1700000]\nelif 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 # 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.\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])\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_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]\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 == 'Nexus10':\n # Nexus10 doesn't list available frequencies, but it does give a\n # min and a max and seems to round to the nearest 100khz, so a\n # subset of those available are here.\n available_freqs = [200000, 400000, 600000, 800000, 1000000, 1200000,\n 1400000, 1700000]\nelif 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", "/usr/bin/adb.1.0.35", "NexusPlayer", "0.6" @@ -650,6 +662,7 @@ "@@@STEP_LOG_LINE@python.inline@target_percent = float(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@@@@", @@ -664,6 +677,14 @@ "@@@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'])@@@", @@ -689,11 +710,14 @@ "@@@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@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@# 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 '@@@", 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 229e07fcdb..a3af995ae5 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,7 +657,7 @@ "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'\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nif model == 'Nexus10':\n # Nexus10 doesn't list available frequencies, but it does give a\n # min and a max and seems to round to the nearest 100khz, so a\n # subset of those available are here.\n available_freqs = [200000, 400000, 600000, 800000, 1000000, 1200000,\n 1400000, 1700000]\nelif 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 # 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.\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])\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_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]\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 == 'Nexus10':\n # Nexus10 doesn't list available frequencies, but it does give a\n # min and a max and seems to round to the nearest 100khz, so a\n # subset of those available are here.\n available_freqs = [200000, 400000, 600000, 800000, 1000000, 1200000,\n 1400000, 1700000]\nelif 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", "/usr/bin/adb.1.0.35", "AndroidOne", "1.0" @@ -682,6 +682,7 @@ "@@@STEP_LOG_LINE@python.inline@target_percent = float(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@@@@", @@ -696,6 +697,14 @@ "@@@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'])@@@", @@ -721,11 +730,14 @@ "@@@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@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@# 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 '@@@", diff --git a/infra/bots/recipes/test.expected/Test-Android-Clang-Nexus10-CPU-Exynos5250-arm-Release-All-Android.json b/infra/bots/recipes/test.expected/Test-Android-Clang-Nexus10-CPU-Exynos5250-arm-Release-All-Android.json index 6d1eead296..8084c23546 100644 --- a/infra/bots/recipes/test.expected/Test-Android-Clang-Nexus10-CPU-Exynos5250-arm-Release-All-Android.json +++ b/infra/bots/recipes/test.expected/Test-Android-Clang-Nexus10-CPU-Exynos5250-arm-Release-All-Android.json @@ -657,7 +657,7 @@ "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'\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nif model == 'Nexus10':\n # Nexus10 doesn't list available frequencies, but it does give a\n # min and a max and seems to round to the nearest 100khz, so a\n # subset of those available are here.\n available_freqs = [200000, 400000, 600000, 800000, 1000000, 1200000,\n 1400000, 1700000]\nelif 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 # 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.\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])\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_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]\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 == 'Nexus10':\n # Nexus10 doesn't list available frequencies, but it does give a\n # min and a max and seems to round to the nearest 100khz, so a\n # subset of those available are here.\n available_freqs = [200000, 400000, 600000, 800000, 1000000, 1200000,\n 1400000, 1700000]\nelif 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", "/usr/bin/adb.1.0.35", "Nexus10", "1.0" @@ -682,6 +682,7 @@ "@@@STEP_LOG_LINE@python.inline@target_percent = float(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@@@@", @@ -696,6 +697,14 @@ "@@@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'])@@@", @@ -721,11 +730,14 @@ "@@@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@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@# 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 '@@@", 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 ceb561f3fd..ec3e7df8ad 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,7 +657,7 @@ "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'\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nif model == 'Nexus10':\n # Nexus10 doesn't list available frequencies, but it does give a\n # min and a max and seems to round to the nearest 100khz, so a\n # subset of those available are here.\n available_freqs = [200000, 400000, 600000, 800000, 1000000, 1200000,\n 1400000, 1700000]\nelif 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 # 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.\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])\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_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]\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 == 'Nexus10':\n # Nexus10 doesn't list available frequencies, but it does give a\n # min and a max and seems to round to the nearest 100khz, so a\n # subset of those available are here.\n available_freqs = [200000, 400000, 600000, 800000, 1000000, 1200000,\n 1400000, 1700000]\nelif 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", "/usr/bin/adb.1.0.35", "Nexus5", "1.0" @@ -682,6 +682,7 @@ "@@@STEP_LOG_LINE@python.inline@target_percent = float(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@@@@", @@ -696,6 +697,14 @@ "@@@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'])@@@", @@ -721,11 +730,14 @@ "@@@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@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@# 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 '@@@", 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 9011333892..41cb265880 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,7 +657,7 @@ "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'\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nif model == 'Nexus10':\n # Nexus10 doesn't list available frequencies, but it does give a\n # min and a max and seems to round to the nearest 100khz, so a\n # subset of those available are here.\n available_freqs = [200000, 400000, 600000, 800000, 1000000, 1200000,\n 1400000, 1700000]\nelif 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 # 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.\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])\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_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]\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 == 'Nexus10':\n # Nexus10 doesn't list available frequencies, but it does give a\n # min and a max and seems to round to the nearest 100khz, so a\n # subset of those available are here.\n available_freqs = [200000, 400000, 600000, 800000, 1000000, 1200000,\n 1400000, 1700000]\nelif 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", "/usr/bin/adb.1.0.35", "Nexus7", "1.0" @@ -682,6 +682,7 @@ "@@@STEP_LOG_LINE@python.inline@target_percent = float(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@@@@", @@ -696,6 +697,14 @@ "@@@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'])@@@", @@ -721,11 +730,14 @@ "@@@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@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@# 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 '@@@", 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 c70b32e1d0..9261f0ab4e 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,7 +657,7 @@ "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'\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nif model == 'Nexus10':\n # Nexus10 doesn't list available frequencies, but it does give a\n # min and a max and seems to round to the nearest 100khz, so a\n # subset of those available are here.\n available_freqs = [200000, 400000, 600000, 800000, 1000000, 1200000,\n 1400000, 1700000]\nelif 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 # 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.\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])\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_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]\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 == 'Nexus10':\n # Nexus10 doesn't list available frequencies, but it does give a\n # min and a max and seems to round to the nearest 100khz, so a\n # subset of those available are here.\n available_freqs = [200000, 400000, 600000, 800000, 1000000, 1200000,\n 1400000, 1700000]\nelif 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", "/usr/bin/adb.1.0.35", "Nexus7", "1.0" @@ -682,6 +682,7 @@ "@@@STEP_LOG_LINE@python.inline@target_percent = float(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@@@@", @@ -696,6 +697,14 @@ "@@@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'])@@@", @@ -721,11 +730,14 @@ "@@@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@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@# 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 '@@@", 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 a1ffe10d1e..ca2a77cfc9 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,7 +657,7 @@ "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'\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nif model == 'Nexus10':\n # Nexus10 doesn't list available frequencies, but it does give a\n # min and a max and seems to round to the nearest 100khz, so a\n # subset of those available are here.\n available_freqs = [200000, 400000, 600000, 800000, 1000000, 1200000,\n 1400000, 1700000]\nelif 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 # 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.\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])\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_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]\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 == 'Nexus10':\n # Nexus10 doesn't list available frequencies, but it does give a\n # min and a max and seems to round to the nearest 100khz, so a\n # subset of those available are here.\n available_freqs = [200000, 400000, 600000, 800000, 1000000, 1200000,\n 1400000, 1700000]\nelif 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", "/usr/bin/adb.1.0.35", "NexusPlayer", "1.0" @@ -682,6 +682,7 @@ "@@@STEP_LOG_LINE@python.inline@target_percent = float(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@@@@", @@ -696,6 +697,14 @@ "@@@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'])@@@", @@ -721,11 +730,14 @@ "@@@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@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@# 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 '@@@", 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 09dc228e8f..e9ebdb4df7 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,7 +657,7 @@ "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'\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nif model == 'Nexus10':\n # Nexus10 doesn't list available frequencies, but it does give a\n # min and a max and seems to round to the nearest 100khz, so a\n # subset of those available are here.\n available_freqs = [200000, 400000, 600000, 800000, 1000000, 1200000,\n 1400000, 1700000]\nelif 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 # 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.\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])\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_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]\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 == 'Nexus10':\n # Nexus10 doesn't list available frequencies, but it does give a\n # min and a max and seems to round to the nearest 100khz, so a\n # subset of those available are here.\n available_freqs = [200000, 400000, 600000, 800000, 1000000, 1200000,\n 1400000, 1700000]\nelif 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", "/usr/bin/adb.1.0.35", "NexusPlayer", "1.0" @@ -682,6 +682,7 @@ "@@@STEP_LOG_LINE@python.inline@target_percent = float(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@@@@", @@ -696,6 +697,14 @@ "@@@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'])@@@", @@ -721,11 +730,14 @@ "@@@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@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@# 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 '@@@", 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 6ba7a19d97..fbe13e7851 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,7 +657,7 @@ "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'\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nif model == 'Nexus10':\n # Nexus10 doesn't list available frequencies, but it does give a\n # min and a max and seems to round to the nearest 100khz, so a\n # subset of those available are here.\n available_freqs = [200000, 400000, 600000, 800000, 1000000, 1200000,\n 1400000, 1700000]\nelif 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 # 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.\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])\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_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]\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 == 'Nexus10':\n # Nexus10 doesn't list available frequencies, but it does give a\n # min and a max and seems to round to the nearest 100khz, so a\n # subset of those available are here.\n available_freqs = [200000, 400000, 600000, 800000, 1000000, 1200000,\n 1400000, 1700000]\nelif 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", "/usr/bin/adb.1.0.35", "Pixel", "1.0" @@ -682,6 +682,7 @@ "@@@STEP_LOG_LINE@python.inline@target_percent = float(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@@@@", @@ -696,6 +697,14 @@ "@@@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'])@@@", @@ -721,11 +730,14 @@ "@@@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@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@# 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 '@@@", 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 5b24c401f8..868818cb5a 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,7 +657,7 @@ "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'\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nif model == 'Nexus10':\n # Nexus10 doesn't list available frequencies, but it does give a\n # min and a max and seems to round to the nearest 100khz, so a\n # subset of those available are here.\n available_freqs = [200000, 400000, 600000, 800000, 1000000, 1200000,\n 1400000, 1700000]\nelif 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 # 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.\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])\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_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]\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 == 'Nexus10':\n # Nexus10 doesn't list available frequencies, but it does give a\n # min and a max and seems to round to the nearest 100khz, so a\n # subset of those available are here.\n available_freqs = [200000, 400000, 600000, 800000, 1000000, 1200000,\n 1400000, 1700000]\nelif 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", "/usr/bin/adb.1.0.35", "Pixel", "1.0" @@ -682,6 +682,7 @@ "@@@STEP_LOG_LINE@python.inline@target_percent = float(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@@@@", @@ -696,6 +697,14 @@ "@@@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'])@@@", @@ -721,11 +730,14 @@ "@@@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@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@# 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 '@@@", diff --git a/infra/bots/recipes/test.expected/Test-Android-Clang-PixelC-CPU-TegraX1-arm64-Debug-All-Android.json b/infra/bots/recipes/test.expected/Test-Android-Clang-PixelC-CPU-TegraX1-arm64-Debug-All-Android.json index b20624f545..403663df7c 100644 --- a/infra/bots/recipes/test.expected/Test-Android-Clang-PixelC-CPU-TegraX1-arm64-Debug-All-Android.json +++ b/infra/bots/recipes/test.expected/Test-Android-Clang-PixelC-CPU-TegraX1-arm64-Debug-All-Android.json @@ -657,7 +657,7 @@ "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'\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nif model == 'Nexus10':\n # Nexus10 doesn't list available frequencies, but it does give a\n # min and a max and seems to round to the nearest 100khz, so a\n # subset of those available are here.\n available_freqs = [200000, 400000, 600000, 800000, 1000000, 1200000,\n 1400000, 1700000]\nelif 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 # 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.\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])\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_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]\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 == 'Nexus10':\n # Nexus10 doesn't list available frequencies, but it does give a\n # min and a max and seems to round to the nearest 100khz, so a\n # subset of those available are here.\n available_freqs = [200000, 400000, 600000, 800000, 1000000, 1200000,\n 1400000, 1700000]\nelif 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", "/usr/bin/adb.1.0.35", "PixelC", "1.0" @@ -682,6 +682,7 @@ "@@@STEP_LOG_LINE@python.inline@target_percent = float(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@@@@", @@ -696,6 +697,14 @@ "@@@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'])@@@", @@ -721,11 +730,14 @@ "@@@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@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@# 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 '@@@", diff --git a/infra/bots/recipes/test.expected/failed_get_hashes.json b/infra/bots/recipes/test.expected/failed_get_hashes.json index 3af22398b0..7270ebdcb2 100644 --- a/infra/bots/recipes/test.expected/failed_get_hashes.json +++ b/infra/bots/recipes/test.expected/failed_get_hashes.json @@ -659,7 +659,7 @@ "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'\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nif model == 'Nexus10':\n # Nexus10 doesn't list available frequencies, but it does give a\n # min and a max and seems to round to the nearest 100khz, so a\n # subset of those available are here.\n available_freqs = [200000, 400000, 600000, 800000, 1000000, 1200000,\n 1400000, 1700000]\nelif 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 # 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.\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])\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_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]\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 == 'Nexus10':\n # Nexus10 doesn't list available frequencies, but it does give a\n # min and a max and seems to round to the nearest 100khz, so a\n # subset of those available are here.\n available_freqs = [200000, 400000, 600000, 800000, 1000000, 1200000,\n 1400000, 1700000]\nelif 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", "/usr/bin/adb.1.0.35", "Nexus7", "1.0" @@ -684,6 +684,7 @@ "@@@STEP_LOG_LINE@python.inline@target_percent = float(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@@@@", @@ -698,6 +699,14 @@ "@@@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'])@@@", @@ -723,11 +732,14 @@ "@@@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@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@# 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 '@@@", diff --git a/infra/bots/recipes/test.expected/failed_pull.json b/infra/bots/recipes/test.expected/failed_pull.json index f53367b900..c13e92e0b8 100644 --- a/infra/bots/recipes/test.expected/failed_pull.json +++ b/infra/bots/recipes/test.expected/failed_pull.json @@ -657,7 +657,7 @@ "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'\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nif model == 'Nexus10':\n # Nexus10 doesn't list available frequencies, but it does give a\n # min and a max and seems to round to the nearest 100khz, so a\n # subset of those available are here.\n available_freqs = [200000, 400000, 600000, 800000, 1000000, 1200000,\n 1400000, 1700000]\nelif 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 # 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.\nsubprocess.check_output([ADB, 'shell', 'echo %d > '\n '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' % freq])\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_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]\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 == 'Nexus10':\n # Nexus10 doesn't list available frequencies, but it does give a\n # min and a max and seems to round to the nearest 100khz, so a\n # subset of those available are here.\n available_freqs = [200000, 400000, 600000, 800000, 1000000, 1200000,\n 1400000, 1700000]\nelif 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", "/usr/bin/adb.1.0.35", "Nexus7", "1.0" @@ -682,6 +682,7 @@ "@@@STEP_LOG_LINE@python.inline@target_percent = float(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@@@@", @@ -696,6 +697,14 @@ "@@@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'])@@@", @@ -721,11 +730,14 @@ "@@@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@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@# 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 '@@@", |