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

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

Issue 605773002: [Android] Do not check if cpu0 is online. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 | « no previous file | no next file » | 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 pylib import android_commands 8 from pylib import android_commands
9 from pylib.device import device_utils 9 from pylib.device import device_utils
10 10
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 def _SetScalingGovernorInternal(self, value): 70 def _SetScalingGovernorInternal(self, value):
71 cpu_cores = ' '.join([str(x) for x in range(self._num_cpu_cores)]) 71 cpu_cores = ' '.join([str(x) for x in range(self._num_cpu_cores)])
72 script = ('for CPU in %s; do\n' 72 script = ('for CPU in %s; do\n'
73 ' FILE="/sys/devices/system/cpu/cpu$CPU/cpufreq/scaling_governor"\n' 73 ' FILE="/sys/devices/system/cpu/cpu$CPU/cpufreq/scaling_governor"\n'
74 ' test -e $FILE && echo %s > $FILE\n' 74 ' test -e $FILE && echo %s > $FILE\n'
75 'done\n') % (cpu_cores, value) 75 'done\n') % (cpu_cores, value)
76 logging.info('Setting scaling governor mode: %s', value) 76 logging.info('Setting scaling governor mode: %s', value)
77 self._device.RunShellCommand(script, as_root=True) 77 self._device.RunShellCommand(script, as_root=True)
78 78
79 def _AllCpusAreOnline(self): 79 def _AllCpusAreOnline(self):
80 for cpu in range(self._num_cpu_cores): 80 for cpu in range(1, self._num_cpu_cores):
81 online_path = PerfControl._CPU_ONLINE_FMT % cpu 81 online_path = PerfControl._CPU_ONLINE_FMT % cpu
82 # TODO(epenner): Investigate why file may be missing 82 # TODO(epenner): Investigate why file may be missing
83 # (http://crbug.com/397118) 83 # (http://crbug.com/397118)
84 if not self._device.FileExists(online_path) or \ 84 if not self._device.FileExists(online_path) or \
85 self._device.ReadFile(online_path)[0] == '0': 85 self._device.ReadFile(online_path)[0] == '0':
86 return False 86 return False
87 return True 87 return True
88 88
89 def _ForceAllCpusOnline(self, force_online): 89 def _ForceAllCpusOnline(self, force_online):
90 """Enable all CPUs on a device. 90 """Enable all CPUs on a device.
(...skipping 15 matching lines...) Expand all
106 106
107 if not self._have_mpdecision and not self._AllCpusAreOnline(): 107 if not self._have_mpdecision and not self._AllCpusAreOnline():
108 logging.warning('Unexpected cpu hot plugging detected.') 108 logging.warning('Unexpected cpu hot plugging detected.')
109 109
110 if not force_online: 110 if not force_online:
111 return 111 return
112 112
113 for cpu in range(self._num_cpu_cores): 113 for cpu in range(self._num_cpu_cores):
114 online_path = PerfControl._CPU_ONLINE_FMT % cpu 114 online_path = PerfControl._CPU_ONLINE_FMT % cpu
115 self._device.WriteFile(online_path, '1', as_root=True) 115 self._device.WriteFile(online_path, '1', as_root=True)
OLDNEW
« 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