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

Unified Diff: tools/skpbench/_hardware_pixel_c.py

Issue 2481413003: skpbench: simplify adb and reduce number of invocations (Closed)
Patch Set: skpbench: simplify adb and reduce number of invocations Created 4 years, 1 month 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 | « tools/skpbench/_hardware_nexus_6p.py ('k') | tools/skpbench/skpbench.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/skpbench/_hardware_pixel_c.py
diff --git a/tools/skpbench/_hardware_pixel_c.py b/tools/skpbench/_hardware_pixel_c.py
index 3ea74c1c03ea651c7c5ab9b2e026141fba38ac49..842ee0c50235b1fbef109448d048cfbb80f51d3d 100644
--- a/tools/skpbench/_hardware_pixel_c.py
+++ b/tools/skpbench/_hardware_pixel_c.py
@@ -24,45 +24,47 @@ class HardwarePixelC(HardwareAndroid):
self._unlock_clocks()
def _lock_clocks(self):
- if not self._is_root:
+ if not self._adb.is_root():
return
- # lock cpu clocks.
- self._adb.shell('''\
+ self._adb.shell('\n'.join([
+ # lock cpu clocks.
+ '''
for N in $(seq 0 3); do
echo userspace > /sys/devices/system/cpu/cpu$N/cpufreq/scaling_governor
echo %i > /sys/devices/system/cpu/cpu$N/cpufreq/scaling_setspeed
- done''' % CPU_CLOCK_RATE)
+ done''' % CPU_CLOCK_RATE,
- # lock gpu/emc clocks.
- self._adb.shell('''\
+ # lock gpu/emc clocks.
+ '''
chown root:root /sys/devices/57000000.gpu/pstate
- echo %s > /sys/devices/57000000.gpu/pstate''' % GPU_EMC_PROFILE_ID)
+ echo %s > /sys/devices/57000000.gpu/pstate''' % GPU_EMC_PROFILE_ID]))
def _unlock_clocks(self):
- if not self._is_root:
+ if not self._adb.is_root():
return
- # unlock gpu/emc clocks.
- self._adb.shell('''\
+ self._adb.shell('\n'.join([
+ # unlock gpu/emc clocks.
+ '''
echo auto > /sys/devices/57000000.gpu/pstate
- chown system:system /sys/devices/57000000.gpu/pstate''')
+ chown system:system /sys/devices/57000000.gpu/pstate''',
- # unlock cpu clocks.
- self._adb.shell('''\
+ # unlock cpu clocks.
+ '''
for N in $(seq 0 3); do
echo 0 > /sys/devices/system/cpu/cpu$N/cpufreq/scaling_setspeed
- echo interactive > /sys/devices/system/cpu/cpu$N/cpufreq/scaling_governor
- done''')
+ echo interactive >/sys/devices/system/cpu/cpu$N/cpufreq/scaling_governor
+ done''']))
def sanity_check(self):
HardwareAndroid.sanity_check(self)
- if not self._is_root:
+ if not self._adb.is_root():
return
# only issue one shell command in an attempt to minimize interference.
- result = self._adb.check_lines('''\
+ result = self._adb.check('''\
cat /sys/class/power_supply/bq27742-0/capacity \
/sys/class/thermal/thermal_zone7/temp \
/sys/class/thermal/thermal_zone0/temp \
@@ -86,7 +88,7 @@ class HardwarePixelC(HardwareAndroid):
for i in range(4)] + \
[Expectation(str, exact_value=GPU_EMC_PROFILE, name='gpu/emc profile')]
- Expectation.check_all(expectations, result)
+ Expectation.check_all(expectations, result.splitlines())
def sleep(self, sleeptime):
self._unlock_clocks()
« no previous file with comments | « tools/skpbench/_hardware_nexus_6p.py ('k') | tools/skpbench/skpbench.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698