]> git.baikalelectronics.ru Git - kernel.git/commit
tools/kvm_stat: fix crash when filtering out all non-child trace events
authorStefan Raspl <stefan.raspl@de.ibm.com>
Mon, 5 Feb 2018 12:59:57 +0000 (13:59 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Sat, 24 Feb 2018 00:43:41 +0000 (01:43 +0100)
commit8485b838593eaa5a549e16b070c291d55a657f59
treed88cec5c5fde40902b5fdbb6b75ac4c89172b4ec
parentbb9d468ef3d4df1512df4e885f8f60e03b7bbb68
tools/kvm_stat: fix crash when filtering out all non-child trace events

When we apply a filter that will only leave child trace events, we
receive a ZeroDivisionError when calculating the percentages.
In that case, provide percentages based on child events only.
To reproduce, run 'kvm_stat -f .*[\(].*'.

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