1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-02-21 20:38:57 +00:00

output_processors/cpustates: Improve handling of missing cpuinfo data

Improve checking of whether cpu idle state information is available for
processing.
Add debug message to inform user if the cpuidle module is not detected
on the target.
This commit is contained in:
Marc Bonnici 2019-10-15 13:41:39 +01:00 committed by setrofim
parent 298bc3a7f3
commit ab5d12be72
2 changed files with 6 additions and 3 deletions

View File

@ -97,6 +97,9 @@ class CpuStatesProcessor(OutputProcessor):
if 'cpufreq' not in target_info.modules:
msg = '"cpufreq" module not detected on target, cpu frequency information may be missing.'
self.logger.warning(msg)
if 'cpuidle' not in target_info.modules:
msg = '"cpuidle" module not detected on target, cpu idle information may be missing.'
self.logger.debug(msg)
self.logger.info('Generating power state reports from trace...')
reports = report_power_stats( # pylint: disable=unbalanced-tuple-unpacking

View File

@ -151,7 +151,7 @@ class PowerStateProcessor(object):
def __init__(self, cpus, wait_for_marker=True, no_idle=None):
if no_idle is None:
no_idle = False if cpus[0].cpuidle else True
no_idle = False if cpus[0].cpuidle and cpus[0].cpuidle.states else True
self.power_state = SystemPowerState(len(cpus), no_idle=no_idle)
self.requested_states = {} # cpu_id -> requeseted state
self.wait_for_marker = wait_for_marker
@ -368,7 +368,7 @@ class PowerStateTimeline(object):
if frequency is None:
if idle_state == -1:
row.append('Running (unknown kHz)')
elif idle_state is None:
elif idle_state is None or not self.idle_state_names[cpu_idx]:
row.append('unknown')
else:
row.append(self.idle_state_names[cpu_idx][idle_state])
@ -499,7 +499,7 @@ class PowerStateStats(object):
state = 'Running (unknown KHz)'
elif freq:
state = '{}-{:07}KHz'.format(self.idle_state_names[cpu][idle], freq)
elif idle is not None:
elif idle is not None and self.idle_state_names[cpu]:
state = self.idle_state_names[cpu][idle]
else:
state = 'unknown'