aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHemant Kumar <hemant@linux.vnet.ibm.com>2016-04-18 23:24:54 -0400
committerPaolo Bonzini <pbonzini@redhat.com>2016-05-25 10:12:04 -0400
commitc7d4fb5a6ebea2d3e8b3a1c251cc30bc56319897 (patch)
tree61973ed6b9c606cc0243ac07214dad175222d88e
parentfd41b5a96948f67785458c04e9ddb5ef619251d5 (diff)
tools: kvm_stat: Powerpc related fixes
kvm_stat script is failing to execute on powerpc : # ./kvm_stat Traceback (most recent call last): File "./kvm_stat", line 825, in <module> main() File "./kvm_stat", line 813, in main providers = get_providers(options) File "./kvm_stat", line 778, in get_providers providers.append(TracepointProvider()) File "./kvm_stat", line 416, in __init__ self.filters = get_filters() File "./kvm_stat", line 315, in get_filters if ARCH.exit_reasons: AttributeError: 'ArchPPC' object has no attribute 'exit_reasons' This is because, its trying to access a non-defined attribute. Also, the IOCTL number of RESET is incorrect for powerpc. The correct number has been added. Signed-off-by: Hemant Kumar <hemant@linux.vnet.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rwxr-xr-xtools/kvm/kvm_stat/kvm_stat2
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/kvm/kvm_stat/kvm_stat b/tools/kvm/kvm_stat/kvm_stat
index 769d884b6d94..27d217a4c4c1 100755
--- a/tools/kvm/kvm_stat/kvm_stat
+++ b/tools/kvm/kvm_stat/kvm_stat
@@ -256,11 +256,13 @@ class ArchPPC(Arch):
256 self.ioctl_numbers = IOCTL_NUMBERS 256 self.ioctl_numbers = IOCTL_NUMBERS
257 self.ioctl_numbers['ENABLE'] = 0x20002400 257 self.ioctl_numbers['ENABLE'] = 0x20002400
258 self.ioctl_numbers['DISABLE'] = 0x20002401 258 self.ioctl_numbers['DISABLE'] = 0x20002401
259 self.ioctl_numbers['RESET'] = 0x20002403
259 260
260 # PPC comes in 32 and 64 bit and some generated ioctl 261 # PPC comes in 32 and 64 bit and some generated ioctl
261 # numbers depend on the wordsize. 262 # numbers depend on the wordsize.
262 char_ptr_size = ctypes.sizeof(ctypes.c_char_p) 263 char_ptr_size = ctypes.sizeof(ctypes.c_char_p)
263 self.ioctl_numbers['SET_FILTER'] = 0x80002406 | char_ptr_size << 16 264 self.ioctl_numbers['SET_FILTER'] = 0x80002406 | char_ptr_size << 16
265 self.exit_reasons = {}
264 266
265class ArchA64(Arch): 267class ArchA64(Arch):
266 def __init__(self): 268 def __init__(self):