Bug 1528236 - [raptor] Fix root permission failures for device tuning. r=perftest-reviewers,stephendonner
authorHenrik Skupin <mail@hskupin.info>
Tue, 14 May 2019 19:29:53 +0000
changeset 473831 d12eb6d840fc2dbbf0746b3dbbbd0ca34352ca75
parent 473830 90a51dbd6ee1126091052281424dfd8fb46fb119
child 473832 0d0a4250902b027df34308763f167bc84f3be8d9
push id36017
push userrgurzau@mozilla.com
push dateWed, 15 May 2019 09:25:56 +0000
treeherdermozilla-central@76bbedc1ec1a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersperftest-reviewers, stephendonner
bugs1528236
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1528236 - [raptor] Fix root permission failures for device tuning. r=perftest-reviewers,stephendonner Differential Revision: https://phabricator.services.mozilla.com/D30922
testing/raptor/raptor/raptor.py
--- a/testing/raptor/raptor/raptor.py
+++ b/testing/raptor/raptor/raptor.py
@@ -693,19 +693,19 @@ class RaptorAndroid(Raptor):
             # all commands require root shell from here on
             self.set_virtual_memory_parameters()
             self.turn_off_services()
             self.set_cpu_performance_parameters(device_name)
             self.set_gpu_performance_parameters(device_name)
             self.set_kernel_performance_parameters()
         self.device.clear_logcat()
 
-    def _set_value_and_check_exitcode(self, file_name, value):
+    def _set_value_and_check_exitcode(self, file_name, value, root=False):
         self.log.info('setting {} to {}'.format(file_name, value))
-        process = self.device.shell(' '.join(['echo', str(value), '>', str(file_name)]), root=True)
+        process = self.device.shell(' '.join(['echo', str(value), '>', str(file_name)]), root=root)
         if process.exitcode == 0:
             self.log.info('successfully set {} to {}'.format(file_name, value))
         else:
             self.log.warning('command failed with exitcode {}'.format(str(process.exitcode)))
 
     def set_svc_power_stayon(self):
         self.log.info('set device to stay awake on usb')
         self.device.shell('svc power stayon usb')
@@ -763,17 +763,17 @@ class RaptorAndroid(Raptor):
         self.log.info('setting virtual memory parameters')
         commands = {
             '/proc/sys/vm/swappiness': 0,
             '/proc/sys/vm/dirty_ratio': 85,
             '/proc/sys/vm/dirty_background_ratio': 70
         }
 
         for key, value in commands.items():
-            self._set_value_and_check_exitcode(key, value)
+            self._set_value_and_check_exitcode(key, value, root=True)
 
     def set_cpu_performance_parameters(self, device_name):
         self.log.info('setting cpu performance parameters')
         commands = {}
 
         if device_name == 'Pixel 2':
             # MSM8998 (4x 2.35GHz, 4x 1.9GHz)
             # values obtained from:
@@ -795,17 +795,17 @@ class RaptorAndroid(Raptor):
                     'cpufreq/scaling_governor'.format(x): 'performance',
                     '/sys/devices/system/cpu/cpu{}/'
                     'cpufreq/scaling_min_freq'.format(x): '1401000'
                 })
         else:
             pass
 
         for key, value in commands.items():
-            self._set_value_and_check_exitcode(key, value)
+            self._set_value_and_check_exitcode(key, value, root=True)
 
     def set_gpu_performance_parameters(self, device_name):
         self.log.info('setting gpu performance parameters')
         commands = {
             '/sys/class/kgsl/kgsl-3d0/bus_split': '0',
             '/sys/class/kgsl/kgsl-3d0/force_bus_on': '1',
             '/sys/class/kgsl/kgsl-3d0/force_rail_on': '1',
             '/sys/class/kgsl/kgsl-3d0/force_clk_on': '1',
@@ -831,28 +831,28 @@ class RaptorAndroid(Raptor):
             commands.update({
                 '/sys/devices/soc/1c00000.qcom,kgsl-3d0/devfreq/'
                 '1c00000.qcom,kgsl-3d0/governor': 'performance',
                 '/sys/devices/soc/1c00000.qcom,kgsl-3d0/kgsl/kgsl-3d0/min_clock_mhz': '450',
             })
         else:
             pass
         for key, value in commands.items():
-            self._set_value_and_check_exitcode(key, value)
+            self._set_value_and_check_exitcode(key, value, root=True)
 
     def set_kernel_performance_parameters(self):
         self.log.info('setting kernel performance parameters')
         commands = {
             '/sys/kernel/debug/msm-bus-dbg/shell-client/update_request': '1',
             '/sys/kernel/debug/msm-bus-dbg/shell-client/mas': '1',
             '/sys/kernel/debug/msm-bus-dbg/shell-client/ab': '0',
             '/sys/kernel/debug/msm-bus-dbg/shell-client/slv': '512',
         }
         for key, value in commands.items():
-            self._set_value_and_check_exitcode(key, value)
+            self._set_value_and_check_exitcode(key, value, root=True)
 
     def clear_app_data(self):
         self.log.info("clearing %s app data" % self.config['binary'])
         self.device.shell("pm clear %s" % self.config['binary'])
 
     def copy_profile_to_device(self):
         """Copy the profile to the device, and update permissions of all files."""
         if not self.device.is_app_installed(self.config['binary']):