Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2647)

Unified Diff: build/android/pylib/perf_tests_helper.py

Issue 11938002: Android: fix cpu governor setup for perf tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix random changes in perf test results Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/pylib/perf_tests_helper.py
diff --git a/build/android/pylib/perf_tests_helper.py b/build/android/pylib/perf_tests_helper.py
index bec92a20d2a1bcb308322ba658d08b5c7e304692..80f80d44ffdbf5eeca1af4cf5018f75681201fe1 100644
--- a/build/android/pylib/perf_tests_helper.py
+++ b/build/android/pylib/perf_tests_helper.py
@@ -130,10 +130,10 @@ class PerfTestSetup(object):
def __init__(self, adb):
self._adb = adb
- num_cpus = self._adb.GetFileContents('/sys/devices/system/cpu/online',
+ kernel_max = self._adb.GetFileContents('/sys/devices/system/cpu/kernel_max',
log_result=False)
- assert num_cpus, 'Unable to find /sys/devices/system/cpu/online'
- self._num_cpus = int(num_cpus[0].split('-')[-1])
+ assert kernel_max, 'Unable to find /sys/devices/system/cpu/kernel_max'
+ self._kernel_max = int(kernel_max[0])
self._original_scaling_governor = None
def DropRamCaches(self):
@@ -159,6 +159,8 @@ class PerfTestSetup(object):
self._original_scaling_governor = None
def _SetScalingGovernorInternal(self, value):
- for cpu in range(self._num_cpus):
- self._adb.RunShellCommand(
- ('echo %s > ' + PerfTestSetup._SCALING_GOVERNOR) % (value, cpu))
+ for cpu in range(self._kernel_max + 1):
+ scaling_governor = PerfTestSetup._SCALING_GOVERNOR % cpu
bulach 2013/01/16 09:34:15 hehe, probably best to: scaling_governor_file = Pe
+ if self._adb.Adb().DoesFileExist(scaling_governor):
+ self._adb.RunShellCommand(
+ ('echo %s > ' + scaling_governor) % value)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698