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

Unified Diff: build/android/pylib/perf/perf_control.py

Issue 1135393005: [Android] Enable root in perf_control.SetHighPerfMode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/pylib/perf/perf_control.py
diff --git a/build/android/pylib/perf/perf_control.py b/build/android/pylib/perf/perf_control.py
index b6a0989eb9f052c7e54459f7b0e1e725d54b90a3..f89f397d24e2930f54a8d737aeb54166912555e4 100644
--- a/build/android/pylib/perf/perf_control.py
+++ b/build/android/pylib/perf/perf_control.py
@@ -6,8 +6,10 @@ import atexit
import logging
from pylib import android_commands
+from pylib.device import device_errors
from pylib.device import device_utils
+
class PerfControl(object):
"""Provides methods for setting the performance mode of a device."""
_CPU_PATH = '/sys/devices/system/cpu'
@@ -28,7 +30,9 @@ class PerfControl(object):
def SetHighPerfMode(self):
"""Sets the highest stable performance mode for the device."""
- if not self._device.HasRoot():
+ try:
+ self._device.EnableRoot()
+ except device_errors.CommandFailedError:
message = 'Need root for performance mode. Results may be NOISY!!'
logging.warning(message)
# Add an additional warning at exit, such that it's clear that any results
« 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