| OLD | NEW |
| 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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 measurement is started. | 83 measurement is started. |
| 84 - The scaling governor can't be set for an offline CPU and frequency scaling | 84 - The scaling governor can't be set for an offline CPU and frequency scaling |
| 85 on newly enabled CPUs adds noise to both perf and tracing measurements. | 85 on newly enabled CPUs adds noise to both perf and tracing measurements. |
| 86 | 86 |
| 87 It appears Qualcomm is the only vendor that hot-plugs CPUs, and on Qualcomm | 87 It appears Qualcomm is the only vendor that hot-plugs CPUs, and on Qualcomm |
| 88 this is done by "mpdecision". | 88 this is done by "mpdecision". |
| 89 | 89 |
| 90 """ | 90 """ |
| 91 if self._have_mpdecision: | 91 if self._have_mpdecision: |
| 92 script = 'stop mpdecision' if force_online else 'start mpdecision' | 92 script = 'stop mpdecision' if force_online else 'start mpdecision' |
| 93 self._device.RunShellCommand(script, root=True) | 93 self._device.RunShellCommand(script, as_root=True) |
| 94 | 94 |
| 95 if not self._have_mpdecision and not self._AllCpusAreOnline(): | 95 if not self._have_mpdecision and not self._AllCpusAreOnline(): |
| 96 logging.warning('Unexpected cpu hot plugging detected.') | 96 logging.warning('Unexpected cpu hot plugging detected.') |
| 97 | 97 |
| 98 if not force_online: | 98 if not force_online: |
| 99 return | 99 return |
| 100 | 100 |
| 101 for cpu in range(self._num_cpu_cores): | 101 for cpu in range(self._num_cpu_cores): |
| 102 online_path = PerfControl._CPU_ONLINE_FMT % cpu | 102 online_path = PerfControl._CPU_ONLINE_FMT % cpu |
| 103 self._device.old_interface.SetProtectedFileContents( | 103 self._device.old_interface.SetProtectedFileContents( |
| 104 online_path, '1') | 104 online_path, '1') |
| OLD | NEW |