mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-02-20 20:09:11 +00:00
PowerStateProcessor: Added a warning when no stop marker is encountered
PowerStateProcessor will now stop itrerating over events when it finds a stop marker. If it does not find a stop marker it will log a warning.
This commit is contained in:
parent
0ae03e2c54
commit
1811a8b733
@ -157,6 +157,7 @@ class PowerStateProcessor(object):
|
||||
self.requested_states = defaultdict(lambda: -1) # cpu_id -> requeseted state
|
||||
self.wait_for_start_marker = wait_for_start_marker
|
||||
self._saw_start_marker = False
|
||||
self._saw_stop_marker = False
|
||||
self.exceptions = []
|
||||
|
||||
idle_state_domains = build_idle_domains(core_clusters,
|
||||
@ -178,8 +179,13 @@ class PowerStateProcessor(object):
|
||||
next_state = self.update_power_state(event)
|
||||
if self._saw_start_marker or not self.wait_for_start_marker:
|
||||
yield next_state
|
||||
if self._saw_stop_marker:
|
||||
break
|
||||
except Exception as e: # pylint: disable=broad-except
|
||||
self.exceptions.append(e)
|
||||
else:
|
||||
if self.wait_for_start_marker:
|
||||
logger.warning("Did not see a STOP marker in the trace")
|
||||
|
||||
def update_power_state(self, event):
|
||||
"""
|
||||
@ -195,7 +201,7 @@ class PowerStateProcessor(object):
|
||||
if event.name == 'START':
|
||||
self._saw_start_marker = True
|
||||
elif event.name == 'STOP':
|
||||
self._saw_start_marker = False
|
||||
self._saw_stop_marker = True
|
||||
else:
|
||||
raise ValueError('Unexpected event type: {}'.format(event.kind))
|
||||
return self.power_state.copy()
|
||||
|
Loading…
x
Reference in New Issue
Block a user