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

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

Issue 1315743004: [Android] Add a custom pylintrc for build/android/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix appurify_sanitized import-errors Created 5 years, 3 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
« no previous file with comments | « build/android/pylib/perf/cache_control.py ('k') | build/android/pylib/perf/setup.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 atexit 5 import atexit
6 import logging 6 import logging
7 7
8 from devil.android import device_errors 8 from devil.android import device_errors
9 from devil.android import device_utils
10 9
11 10
12 class PerfControl(object): 11 class PerfControl(object):
13 """Provides methods for setting the performance mode of a device.""" 12 """Provides methods for setting the performance mode of a device."""
14 _CPU_PATH = '/sys/devices/system/cpu' 13 _CPU_PATH = '/sys/devices/system/cpu'
15 _KERNEL_MAX = '/sys/devices/system/cpu/kernel_max' 14 _KERNEL_MAX = '/sys/devices/system/cpu/kernel_max'
16 15
17 def __init__(self, device): 16 def __init__(self, device):
18 self._device = device 17 self._device = device
19 # this will raise an AdbCommandFailedError if no CPU files are found 18 # this will raise an AdbCommandFailedError if no CPU files are found
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 """ 147 """
149 if self._have_mpdecision: 148 if self._have_mpdecision:
150 script = 'stop mpdecision' if force_online else 'start mpdecision' 149 script = 'stop mpdecision' if force_online else 'start mpdecision'
151 self._device.RunShellCommand(script, check_return=True, as_root=True) 150 self._device.RunShellCommand(script, check_return=True, as_root=True)
152 151
153 if not self._have_mpdecision and not self._AllCpusAreOnline(): 152 if not self._have_mpdecision and not self._AllCpusAreOnline():
154 logging.warning('Unexpected cpu hot plugging detected.') 153 logging.warning('Unexpected cpu hot plugging detected.')
155 154
156 if force_online: 155 if force_online:
157 self._ForEachCpu('echo 1 > "$CPU/online"') 156 self._ForEachCpu('echo 1 > "$CPU/online"')
OLDNEW
« no previous file with comments | « build/android/pylib/perf/cache_control.py ('k') | build/android/pylib/perf/setup.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698