Skip to content

Commit

Permalink
tools/kvm_stat: print 'Total' line for multiple events only
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
  • Loading branch information
Stefan-Raspl authored and bonzini committed Feb 24, 2018
1 parent df72ecf commit 6789af0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/kvm/kvm_stat/kvm_stat
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 6789af0

Please sign in to comment.