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

Side by Side Diff: build/android/pylib/perf/perf_control.py

Issue 371813005: [Android] Switch to DeviceUtils versions of Ls, SetJavaAsserts, GetProp, and SetProp. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 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 unified diff | Download patch
OLDNEW
1 # Copyright 2013 The Chromium Authors. All rights reserved. 1 # Copyright 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import logging 5 import logging
6 6
7 from pylib import android_commands 7 from pylib import android_commands
8 from pylib.device import device_utils 8 from pylib.device import device_utils
9 9
10 10
(...skipping 28 matching lines...) Expand all
39 """Sets the highest possible performance mode for the device.""" 39 """Sets the highest possible performance mode for the device."""
40 self._ForceAllCpusOnline(True) 40 self._ForceAllCpusOnline(True)
41 self._SetScalingGovernorInternal('performance') 41 self._SetScalingGovernorInternal('performance')
42 if not self._AllCpusAreOnline(): 42 if not self._AllCpusAreOnline():
43 if not self._device.old_interface.IsRootEnabled(): 43 if not self._device.old_interface.IsRootEnabled():
44 raise RuntimeError('Need root to force CPUs online.') 44 raise RuntimeError('Need root to force CPUs online.')
45 raise RuntimeError('Failed to force CPUs online.') 45 raise RuntimeError('Failed to force CPUs online.')
46 46
47 def SetDefaultPerfMode(self): 47 def SetDefaultPerfMode(self):
48 """Sets the performance mode for the device to its default mode.""" 48 """Sets the performance mode for the device to its default mode."""
49 product_model = self._device.old_interface.GetProductModel() 49 product_model = self._device.GetProp('ro.product.model')
50 governor_mode = { 50 governor_mode = {
51 'GT-I9300': 'pegasusq', 51 'GT-I9300': 'pegasusq',
52 'Galaxy Nexus': 'interactive', 52 'Galaxy Nexus': 'interactive',
53 'Nexus 4': 'ondemand', 53 'Nexus 4': 'ondemand',
54 'Nexus 7': 'interactive', 54 'Nexus 7': 'interactive',
55 'Nexus 10': 'interactive' 55 'Nexus 10': 'interactive'
56 }.get(product_model, 'ondemand') 56 }.get(product_model, 'ondemand')
57 self._SetScalingGovernorInternal(governor_mode) 57 self._SetScalingGovernorInternal(governor_mode)
58 self._ForceAllCpusOnline(False) 58 self._ForceAllCpusOnline(False)
59 59
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 92
93 if not self._have_mpdecision and not self._AllCpusAreOnline(): 93 if not self._have_mpdecision and not self._AllCpusAreOnline():
94 logging.warning('Unexpected cpu hot plugging detected.') 94 logging.warning('Unexpected cpu hot plugging detected.')
95 95
96 if not force_online: 96 if not force_online:
97 return 97 return
98 98
99 for cpu in range(self._num_cpu_cores): 99 for cpu in range(self._num_cpu_cores):
100 online_path = PerfControl._CPU_ONLINE_FMT % cpu 100 online_path = PerfControl._CPU_ONLINE_FMT % cpu
101 self._device.WriteFile(online_path, '1', as_root=True) 101 self._device.WriteFile(online_path, '1', as_root=True)
OLDNEW
« no previous file with comments | « build/android/pylib/instrumentation/test_runner.py ('k') | tools/android/adb_profile_chrome/chrome_controller.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698