mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-02-07 05:31:21 +00:00
output_processors/cpustates: Deal with cpufreq data being unavailable
If the `cpufreq` module is not detected as present then warn the user and processes the remaining data instead of crashing.
This commit is contained in:
parent
09d6f4dea1
commit
298bc3a7f3
@ -94,6 +94,9 @@ class CpuStatesProcessor(OutputProcessor):
|
|||||||
if not trace_file:
|
if not trace_file:
|
||||||
self.logger.warning('Text trace does not appear to have been generated; skipping this iteration.')
|
self.logger.warning('Text trace does not appear to have been generated; skipping this iteration.')
|
||||||
return
|
return
|
||||||
|
if 'cpufreq' not in target_info.modules:
|
||||||
|
msg = '"cpufreq" module not detected on target, cpu frequency information may be missing.'
|
||||||
|
self.logger.warning(msg)
|
||||||
|
|
||||||
self.logger.info('Generating power state reports from trace...')
|
self.logger.info('Generating power state reports from trace...')
|
||||||
reports = report_power_stats( # pylint: disable=unbalanced-tuple-unpacking
|
reports = report_power_stats( # pylint: disable=unbalanced-tuple-unpacking
|
||||||
|
@ -560,12 +560,12 @@ class CpuUtilizationTimeline(object):
|
|||||||
|
|
||||||
headers = ['ts'] + ['{} CPU{}'.format(cpu.name, cpu.id) for cpu in cpus]
|
headers = ['ts'] + ['{} CPU{}'.format(cpu.name, cpu.id) for cpu in cpus]
|
||||||
self.writer.writerow(headers)
|
self.writer.writerow(headers)
|
||||||
self._max_freq_list = [cpu.cpufreq.available_frequencies[-1] for cpu in cpus]
|
self._max_freq_list = [cpu.cpufreq.available_frequencies[-1] for cpu in cpus if cpu.cpufreq.available_frequencies]
|
||||||
|
|
||||||
def update(self, timestamp, core_states): # NOQA
|
def update(self, timestamp, core_states): # NOQA
|
||||||
row = [timestamp]
|
row = [timestamp]
|
||||||
for core, [_, frequency] in enumerate(core_states):
|
for core, [_, frequency] in enumerate(core_states):
|
||||||
if frequency is not None:
|
if frequency is not None and core in self._max_freq_list:
|
||||||
frequency /= float(self._max_freq_list[core])
|
frequency /= float(self._max_freq_list[core])
|
||||||
row.append(frequency)
|
row.append(frequency)
|
||||||
else:
|
else:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user