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) |