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..7ab30038b25257a21c38523399d75a0959e88960 100644 |
--- a/build/android/pylib/perf_tests_helper.py |
+++ b/build/android/pylib/perf_tests_helper.py |
@@ -133,15 +133,13 @@ class PerfTestSetup(object): |
num_cpus = self._adb.GetFileContents('/sys/devices/system/cpu/online', |
log_result=False) |
assert num_cpus, 'Unable to find /sys/devices/system/cpu/online' |
- self._num_cpus = int(num_cpus[0].split('-')[-1]) |
+ self._num_cpus = int(re.findall(r'\d+',num_cpus[0])[-1]) |
bulach
2013/01/14 17:26:50
nit: space after ,
aberent
2013/01/14 20:19:10
Done.
|
self._original_scaling_governor = None |
def DropRamCaches(self): |
"""Drops the filesystem ram caches for performance testing.""" |
- if not self._adb.IsRootEnabled(): |
- self._adb.EnableAdbRoot() |
- self._adb.RunShellCommand('sync') |
- self._adb.RunShellCommand('echo 3 > ' + PerfTestSetup._DROP_CACHES) |
+ self._adb.RunShellCommand('su -c sync') |
+ self._adb.RunShellCommand('su -c echo 3 > ' + PerfTestSetup._DROP_CACHES) |
def SetUp(self): |
"""Sets up performance tests.""" |