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

cpustate: fixing division by zero

total running time (in parallel stats) is zero when all cores on a
cluster are hotplugged. this caused a division by zero when calculating
percentage.
This commit is contained in:
Sergei Trofimov 2015-06-12 13:02:05 +01:00
parent 179baf030e
commit ab76aa73f2

View File

@ -330,7 +330,10 @@ class ParallelStats(object):
if not self.use_ratios:
time_pc *= 100
if n:
running_time_pc = time / running_time
if running_time:
running_time_pc = time / running_time
else:
running_time_pc = 0
if not self.use_ratios:
running_time_pc *= 100
else: