Fix: prevent division by zero in cputop
authorAntoine Busque <abusque@efficios.com>
Sun, 25 Oct 2015 05:08:01 +0000 (01:08 -0400)
committerAntoine Busque <abusque@efficios.com>
Sun, 25 Oct 2015 05:08:01 +0000 (01:08 -0400)
Signed-off-by: Antoine Busque <abusque@efficios.com>
lttnganalyses/cli/cputop.py

index 28d62b00fb859330ac31f8f8cbb5732dce372367..a2ca9b6610f664fa95ee0d4a3aee2ecb0349fef9 100644 (file)
@@ -127,6 +127,9 @@ class Cputop(Command):
         cpu_count = len(self.state.cpus)
         usage_percent = 0
 
+        if not cpu_count:
+            return
+
         for cpu in sorted(self._analysis.cpus.values(),
                           key=operator.attrgetter('usage_percent'),
                           reverse=True):
This page took 0.026974 seconds and 5 git commands to generate.