Bug 1547135 Comment 19 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

(In reply to Andrew Creskey from comment #18)

> I didn't realize this but the calls to set the no-op scheduler require root on the android device, otherwise raptor fails:
> ```
> 15:44:49    ERROR -  Traceback (most recent call last):
> 15:44:49     INFO -    File "/Users/acreskey/dev/src/mozilla-central/testing/raptor/raptor/raptor.py", line 1211, in <module>
> 15:44:49     INFO -      main()
> 15:44:49     INFO -    File "/Users/acreskey/dev/src/mozilla-central/testing/raptor/raptor/raptor.py", line 1169, in main
> 15:44:49     INFO -      raptor.tune_performance()
> 15:44:49     INFO -    File "/Users/acreskey/dev/src/mozilla-central/testing/raptor/raptor/raptor.py", line 675, in tune_performance
> 15:44:49     INFO -      self.set_scheduler()
> 15:44:49     INFO -    File "/Users/acreskey/dev/src/mozilla-central/testing/raptor/raptor/raptor.py", line 703, in set_scheduler
> 15:44:49     INFO -      self._set_value_and_check_exitcode(scheduler_location, 'noop')
> 15:44:49     INFO -    File "/Users/acreskey/dev/src/mozilla-central/testing/raptor/raptor/raptor.py", line 689, in _set_value_and_check_exitcode
> 15:44:49     INFO -      process = self.device.shell(' '.join(['echo', str(value), '>', str(file_name)]), root=True)
> 15:44:49     INFO -    File "/Users/acreskey/dev/src/build/obj-release/testing/raptor-venv/lib/python2.7/site-packages/mozdevice/adb.py", line 1352, in shell
> 15:44:49     INFO -      raise ADBRootError('Can not run command %s as root!' % cmd)
> 15:44:49     INFO -  mozdevice.adb.ADBRootError: Can not run command echo noop > /sys/block/sda/queue/scheduler as root!
> 15:44:49    ERROR - Return code: 1
> ```
> 
> Raptor is used by developers on their local hardware and, prior to this change, it did not required rooted devices.
> 
> So what if we made the set_scheduler() command fail gracefully without root?

Interesting. I had thought the requirement for root was accounted for here:
https://searchfox.org/mozilla-central/source/testing/raptor/raptor/raptor.py#692

`if (self.device._have_su or self.device._have_android_su):`

I will toggle my root and give it a try, will create a new bug for this.
(In reply to Andrew Creskey from comment #18)

> I didn't realize this but the calls to set the no-op scheduler require root on the android device, otherwise raptor fails:
> ```
> 15:44:49    ERROR -  Traceback (most recent call last):
> 15:44:49     INFO -    File "/Users/acreskey/dev/src/mozilla-central/testing/raptor/raptor/raptor.py", line 1211, in <module>
> 15:44:49     INFO -      main()
> 15:44:49     INFO -    File "/Users/acreskey/dev/src/mozilla-central/testing/raptor/raptor/raptor.py", line 1169, in main
> 15:44:49     INFO -      raptor.tune_performance()
> 15:44:49     INFO -    File "/Users/acreskey/dev/src/mozilla-central/testing/raptor/raptor/raptor.py", line 675, in tune_performance
> 15:44:49     INFO -      self.set_scheduler()
> 15:44:49     INFO -    File "/Users/acreskey/dev/src/mozilla-central/testing/raptor/raptor/raptor.py", line 703, in set_scheduler
> 15:44:49     INFO -      self._set_value_and_check_exitcode(scheduler_location, 'noop')
> 15:44:49     INFO -    File "/Users/acreskey/dev/src/mozilla-central/testing/raptor/raptor/raptor.py", line 689, in _set_value_and_check_exitcode
> 15:44:49     INFO -      process = self.device.shell(' '.join(['echo', str(value), '>', str(file_name)]), root=True)
> 15:44:49     INFO -    File "/Users/acreskey/dev/src/build/obj-release/testing/raptor-venv/lib/python2.7/site-packages/mozdevice/adb.py", line 1352, in shell
> 15:44:49     INFO -      raise ADBRootError('Can not run command %s as root!' % cmd)
> 15:44:49     INFO -  mozdevice.adb.ADBRootError: Can not run command echo noop > /sys/block/sda/queue/scheduler as root!
> 15:44:49    ERROR - Return code: 1
> ```
> 
> Raptor is used by developers on their local hardware and, prior to this change, it did not required rooted devices.
> 
> So what if we made the set_scheduler() command fail gracefully without root?

~~Interesting. I had thought the requirement for root was accounted for here:
https://searchfox.org/mozilla-central/source/testing/raptor/raptor/raptor.py#692~~

~~`if (self.device._have_su or self.device._have_android_su):`~~

I had misread my own code - somehow the scheduler tuning method ended up outside of the if/else statement meant to skip unrooted devices. I've created a bug to address this.

Back to Bug 1547135 Comment 19