tools/kvm_stat: fix event counts display for interrupted intervals
authorStefan Raspl <raspl@linux.vnet.ibm.com>
Wed, 7 Jun 2017 19:08:26 +0000 (21:08 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 8 Jun 2017 16:13:23 +0000 (18:13 +0200)
commit124c2fc9fdf5fb1d9cea4707d7e5471e317ba3bf
treee2551445b4cd606a2446835a0d37300eec96f212
parent773bffeeb2f1fca7739516d0a5a814dd14a5cc83
tools/kvm_stat: fix event counts display for interrupted intervals

When an update interval is interrupted via key press (e.g. space), the
'Current' column value is calculated using the full interval length
instead of the elapsed time, which leads to lower than actual numbers.
Furthermore, the value should be rounded, not truncated.
This is fixed by using the actual elapsed time for the calculation.

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