tools/kvm_stat: print 'Total' line for multiple events only
authorStefan Raspl <stefan.raspl@de.ibm.com>
Thu, 22 Feb 2018 11:16:30 +0000 (12:16 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Sat, 24 Feb 2018 00:43:46 +0000 (01:43 +0100)
The 'Total' line looks a bit weird when we have a single event only. This
can happen e.g. due to filters. Therefore suppress when there's only a
single event in the output.

Signed-off-by: Stefan Raspl <raspl@linux.vnet.ibm.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
tools/kvm/kvm_stat/kvm_stat

index 862c997..5898c22 100755 (executable)
@@ -1206,7 +1206,7 @@ class Tui(object):
             row += 1
         if row == 3:
             self.screen.addstr(4, 1, 'No matching events reported yet')
-        else:
+        if row > 4:
             tavg = int(round(tcur / sleeptime)) if tcur > 0 else ''
             self.screen.addstr(row, 1, '%-40s %10d        %8s' %
                                ('Total', total, tavg), curses.A_BOLD)