1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2024-10-06 19:01:15 +01:00

report_power_stats: number of entries returned always matches number of reporters

Previously, only reports that were generated were returned. With this
commit, there will be an entry for each active reporter in the returned
list. If a reporter did not produce a valid report, the entry will be
None.

This ensures consistent output, even if a run time issue causes a
reporter not to produce a report  (e.g. if cpufreq events were not
enabled).
This commit is contained in:
Sergei Trofimov 2016-05-09 10:07:36 +01:00
parent 5773da0d08
commit fe7f98a98b
2 changed files with 6 additions and 3 deletions

View File

@ -181,7 +181,8 @@ class CpuStatesProcessor(ResultProcessor):
cpu_utilisation = os.path.join(context.output_directory, 'cpu_utilisation.csv')
else:
cpu_utilisation = None
parallel_report, powerstate_report = report_power_stats( # pylint: disable=unbalanced-tuple-unpacking
reports = report_power_stats( # pylint: disable=unbalanced-tuple-unpacking
trace_file=trace.path,
idle_state_names=self.idle_state_names,
core_names=self.core_names,
@ -194,6 +195,9 @@ class CpuStatesProcessor(ResultProcessor):
cpu_utilisation=cpu_utilisation,
max_freq_list=self.max_freq_list,
)
parallel_report = reports.pop(0)
powerstate_report = reports.pop(0)
if parallel_report is None:
self.logger.warning('No power state reports generated; are power '
'events enabled in the trace?')

View File

@ -644,7 +644,6 @@ def report_power_stats(trace_file, idle_state_names, core_names, core_clusters,
reports = []
for reporter in reporters:
report = reporter.report()
if report:
reports.append(report)
return reports