mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-01-31 10:11:17 +00:00
Fixing turning off UI in ChromeOS + adding it energy_model.
This commit is contained in:
parent
bf8dc6642f
commit
76253e1e26
@ -308,6 +308,7 @@ class Device(Extension):
|
||||
raise ConfigError('Unknown runtime parameter(s): {}'.format(unknown_params))
|
||||
|
||||
for param in params:
|
||||
self.logger.debug('Setting runtime parameter "{}"'.format(param))
|
||||
rtp = rtp_map[param]
|
||||
setter = getattr(self, rtp.setter)
|
||||
args = dict(rtp.setter_args.items() + [(rtp.value_name, params[rtp.name.lower()])])
|
||||
|
@ -16,6 +16,7 @@
|
||||
import re
|
||||
|
||||
from wlauto import LinuxDevice, Parameter
|
||||
from wlauto.exceptions import DeviceError
|
||||
from wlauto.core.device import RuntimeParameter
|
||||
from wlauto.utils.misc import convert_new_lines
|
||||
from wlauto.utils.types import boolean
|
||||
@ -54,7 +55,7 @@ class ChromeOsDevice(LinuxDevice):
|
||||
|
||||
def __init__(self, **kwargs):
|
||||
super(ChromeOsDevice, self).__init__(**kwargs)
|
||||
self.ui_status = True
|
||||
self.ui_status = None
|
||||
|
||||
def validate(self):
|
||||
# pylint: disable=access-member-before-definition,attribute-defined-outside-init
|
||||
@ -67,18 +68,33 @@ class ChromeOsDevice(LinuxDevice):
|
||||
self.uninstall('busybox')
|
||||
self.busybox = self.deploy_busybox(context)
|
||||
|
||||
def start(self):
|
||||
if not self.ui_status:
|
||||
self.execute('stop ui')
|
||||
|
||||
def stop(self):
|
||||
if not self.ui_status:
|
||||
self.execute('start ui')
|
||||
self.ui_status = True
|
||||
|
||||
def get_ui_status(self):
|
||||
return self.ui_status
|
||||
|
||||
def set_ui_status(self, status):
|
||||
self.ui_status = boolean(status)
|
||||
if self.ui_status is None:
|
||||
pass
|
||||
elif self.ui_status:
|
||||
try:
|
||||
self.execute('start ui')
|
||||
except DeviceError:
|
||||
pass
|
||||
else:
|
||||
try:
|
||||
self.execute('stop ui')
|
||||
except DeviceError:
|
||||
pass
|
||||
|
||||
def stop(self):
|
||||
if self.ui_status is None:
|
||||
pass
|
||||
elif not self.ui_status:
|
||||
try:
|
||||
self.execute('start ui')
|
||||
except DeviceError:
|
||||
pass
|
||||
else:
|
||||
pass
|
||||
self.ui_status = None
|
||||
|
||||
|
@ -725,6 +725,7 @@ class EnergyModelInstrument(Instrument):
|
||||
if not self.no_hotplug:
|
||||
spec.runtime_parameters['{}_cores'.format(core)] = num_cpus
|
||||
spec.runtime_parameters['{}_frequency'.format(core)] = min_frequency
|
||||
spec.runtime_parameters['ui'] = 'off'
|
||||
spec.cluster = cluster
|
||||
spec.num_cpus = num_cpus
|
||||
spec.id = '{}_idle_{}_{}'.format(cluster, state.id, num_cpus)
|
||||
@ -743,6 +744,7 @@ class EnergyModelInstrument(Instrument):
|
||||
spec.runtime_parameters['{}_frequency'.format(core)] = freq
|
||||
if not self.no_hotplug:
|
||||
spec.runtime_parameters['{}_cores'.format(core)] = num_cpus
|
||||
spec.runtime_parameters['ui'] = 'off'
|
||||
spec.id = '{}_{}_{}'.format(cluster, num_cpus, freq)
|
||||
spec.label = 'freq_{}_{}'.format(cluster, spec.label)
|
||||
spec.workload_parameters['taskset_mask'] = list_to_mask(self.get_cpus(cluster))
|
||||
|
Loading…
x
Reference in New Issue
Block a user