summary refs log tree commit diff stats
path: root/scripts/kvm
diff options
context:
space:
mode:
authorAurelien Jarno <aurelien@aurel32.net>2012-10-30 00:35:43 +0100
committerAurelien Jarno <aurelien@aurel32.net>2012-10-30 00:35:43 +0100
commit38c4718392fda2bda1e084366b9aa41b49b9d8cf (patch)
tree881cb519ffcebc0b458bcbb92338297da19cb914 /scripts/kvm
parent3585317f6fdff0e3ae082f88afb2784d815a07e2 (diff)
parent130c57c036fdc2eba8936da1b1dad39e78d5ea32 (diff)
downloadfocaccia-qemu-38c4718392fda2bda1e084366b9aa41b49b9d8cf.tar.gz
focaccia-qemu-38c4718392fda2bda1e084366b9aa41b49b9d8cf.zip
Merge branch 's390-for-upstream' of git://repo.or.cz/qemu/agraf
* 's390-for-upstream' of git://repo.or.cz/qemu/agraf:
  s390: sclp ascii console support
  s390: sclp signal quiesce support
  s390: sclp event support
  s390: sclp base support
  s390: use sync regs for register transfer
  s390/kvm_stat: correct sys_perf_event_open syscall number
  s390x: fix -initrd in virtio machine
Diffstat (limited to 'scripts/kvm')
-rwxr-xr-xscripts/kvm/kvm_stat11
1 files changed, 9 insertions, 2 deletions
diff --git a/scripts/kvm/kvm_stat b/scripts/kvm/kvm_stat
index e8d68f05ca..762544b197 100755
--- a/scripts/kvm/kvm_stat
+++ b/scripts/kvm/kvm_stat
@@ -170,6 +170,12 @@ vendor_exit_reasons = {
     'IBM/S390': s390_exit_reasons,
 }
 
+syscall_numbers = {
+    'IBM/S390': 331,
+}
+
+sc_perf_evt_open = 298
+
 exit_reasons = None
 
 for line in file('/proc/cpuinfo').readlines():
@@ -177,7 +183,8 @@ for line in file('/proc/cpuinfo').readlines():
         for flag in line.split():
             if flag in vendor_exit_reasons:
                 exit_reasons = vendor_exit_reasons[flag]
-
+            if flag in syscall_numbers:
+                sc_perf_evt_open = syscall_numbers[flag]
 filters = {
     'kvm_exit': ('exit_reason', exit_reasons)
 }
@@ -206,7 +213,7 @@ class perf_event_attr(ctypes.Structure):
                 ('bp_len', ctypes.c_uint64),
                 ]
 def _perf_event_open(attr, pid, cpu, group_fd, flags):
-    return syscall(298, ctypes.pointer(attr), ctypes.c_int(pid),
+    return syscall(sc_perf_evt_open, ctypes.pointer(attr), ctypes.c_int(pid),
                    ctypes.c_int(cpu), ctypes.c_int(group_fd),
                    ctypes.c_long(flags))