Index: tools/gc-nvp-trace-processor.py |
diff --git a/tools/gc-nvp-trace-processor.py b/tools/gc-nvp-trace-processor.py |
index f1f9dc01c7782e380dfda235330d7225ffa1b37f..285689d8f24f08ea11448156da2984baa99ee059 100755 |
--- a/tools/gc-nvp-trace-processor.py |
+++ b/tools/gc-nvp-trace-processor.py |
@@ -288,7 +288,10 @@ def process_trace(filename): |
n = len(trace) |
total = calc_total(trace, field) |
max = calc_max(trace, field) |
- avg = total / n |
+ if n > 0: |
+ avg = total / n |
+ else: |
+ avg = 0 |
if n > 1: |
dev = math.sqrt(freduce(lambda t,r: (r - avg) ** 2, field, trace, 0) / |
(n - 1)) |