aboutsummaryrefslogtreecommitdiff
path: root/scripts/kvm/kvm_stat
diff options
context:
space:
mode:
authorMichael Ellerman <mpe@ellerman.id.au>2014-06-17 17:54:35 +1000
committerPaolo Bonzini <pbonzini@redhat.com>2014-10-31 16:36:23 +0100
commit4725398f9309d05936fec2eaaa6e97e01e25545e (patch)
treecbc3606b19159e147faab0dbe3ebf7eca30c0dbd /scripts/kvm/kvm_stat
parenta15d5642a03a0b6c6cf327e497e688d1ba4c676d (diff)
kvm_stat: Add powerpc support
Add support for powerpc platforms. We use uname -m, which allows us to detect ppc, ppc64 and ppc64le/el. Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'scripts/kvm/kvm_stat')
-rwxr-xr-xscripts/kvm/kvm_stat18
1 files changed, 16 insertions, 2 deletions
diff --git a/scripts/kvm/kvm_stat b/scripts/kvm/kvm_stat
index a65d0a364d..7b1437ca21 100755
--- a/scripts/kvm/kvm_stat
+++ b/scripts/kvm/kvm_stat
@@ -12,7 +12,7 @@
# the COPYING file in the top-level directory.
import curses
-import sys, os, time, optparse
+import sys, os, time, optparse, ctypes
class DebugfsProvider(object):
def __init__(self):
@@ -194,7 +194,21 @@ def s390_init():
'sc_perf_evt_open' : 331
})
+def ppc_init():
+ globals().update({
+ 'sc_perf_evt_open' : 319,
+ 'ioctl_numbers' : {
+ 'SET_FILTER' : 0x80002406 | (ctypes.sizeof(ctypes.c_char_p) << 16),
+ 'ENABLE' : 0x20002400,
+ 'DISABLE' : 0x20002401,
+ }
+ })
+
def detect_platform():
+ if os.uname()[4].startswith('ppc'):
+ ppc_init()
+ return
+
for line in file('/proc/cpuinfo').readlines():
if line.startswith('flags'):
for flag in line.split():
@@ -217,7 +231,7 @@ filters['kvm_userspace_exit'] = ('reason', invert(userspace_exit_reasons))
if exit_reasons:
filters['kvm_exit'] = ('exit_reason', invert(exit_reasons))
-import ctypes, struct, array
+import struct, array
libc = ctypes.CDLL('libc.so.6')
syscall = libc.syscall