[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 25/35] kvm_stat: Fix the non-x86 exit reasons
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 25/35] kvm_stat: Fix the non-x86 exit reasons |
Date: |
Fri, 31 Oct 2014 18:26:03 +0100 |
From: Michael Ellerman <address@hidden>
In kvm_stat we have a dictionary of exit reasons for s390. Firstly these
are not s390 specific, they are the generic exit reasons. So rename the
dictionary to reflect that, and add it separately to filters[].
Secondly, the values are defined using hex, but in the kernel header
they are decimal. That means values above 9 in kvm_stat are incorrect.
While we're there, fix the whitespace to match the rest of the file.
Signed-off-by: Michael Ellerman <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
scripts/kvm/kvm_stat | 57 +++++++++++++++++++++++++++-------------------------
1 file changed, 30 insertions(+), 27 deletions(-)
diff --git a/scripts/kvm/kvm_stat b/scripts/kvm/kvm_stat
index 2a788bc..4ec1fa5 100755
--- a/scripts/kvm/kvm_stat
+++ b/scripts/kvm/kvm_stat
@@ -141,33 +141,37 @@ svm_exit_reasons = {
0x400: 'NPF',
}
-s390_exit_reasons = {
- 0x000: 'UNKNOWN',
- 0x001: 'EXCEPTION',
- 0x002: 'IO',
- 0x003: 'HYPERCALL',
- 0x004: 'DEBUG',
- 0x005: 'HLT',
- 0x006: 'MMIO',
- 0x007: 'IRQ_WINDOW_OPEN',
- 0x008: 'SHUTDOWN',
- 0x009: 'FAIL_ENTRY',
- 0x010: 'INTR',
- 0x011: 'SET_TPR',
- 0x012: 'TPR_ACCESS',
- 0x013: 'S390_SIEIC',
- 0x014: 'S390_RESET',
- 0x015: 'DCR',
- 0x016: 'NMI',
- 0x017: 'INTERNAL_ERROR',
- 0x018: 'OSI',
- 0x019: 'PAPR_HCALL',
+# From include/uapi/linux/kvm.h, KVM_EXIT_xxx
+userspace_exit_reasons = {
+ 0: 'UNKNOWN',
+ 1: 'EXCEPTION',
+ 2: 'IO',
+ 3: 'HYPERCALL',
+ 4: 'DEBUG',
+ 5: 'HLT',
+ 6: 'MMIO',
+ 7: 'IRQ_WINDOW_OPEN',
+ 8: 'SHUTDOWN',
+ 9: 'FAIL_ENTRY',
+ 10: 'INTR',
+ 11: 'SET_TPR',
+ 12: 'TPR_ACCESS',
+ 13: 'S390_SIEIC',
+ 14: 'S390_RESET',
+ 15: 'DCR',
+ 16: 'NMI',
+ 17: 'INTERNAL_ERROR',
+ 18: 'OSI',
+ 19: 'PAPR_HCALL',
+ 20: 'S390_UCONTROL',
+ 21: 'WATCHDOG',
+ 22: 'S390_TSCH',
+ 23: 'EPR',
}
vendor_exit_reasons = {
'vmx': vmx_exit_reasons,
'svm': svm_exit_reasons,
- 'IBM/S390': s390_exit_reasons,
}
syscall_numbers = {
@@ -185,15 +189,14 @@ for line in file('/proc/cpuinfo').readlines():
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)
-}
def invert(d):
return dict((x[1], x[0]) for x in d.iteritems())
-for f in filters:
- filters[f] = (filters[f][0], invert(filters[f][1]))
+filters = {}
+filters['kvm_userspace_exit'] = ('reason', invert(userspace_exit_reasons))
+if exit_reasons:
+ filters['kvm_exit'] = ('exit_reason', invert(exit_reasons))
import ctypes, struct, array
--
1.8.3.1
- [Qemu-devel] [PULL 15/35] megasas: Fixup MSI-X handling, (continued)
- [Qemu-devel] [PULL 15/35] megasas: Fixup MSI-X handling, Paolo Bonzini, 2014/10/31
- [Qemu-devel] [PULL 16/35] -machine vmport=off: Allow disabling of VMWare ioport emulation, Paolo Bonzini, 2014/10/31
- [Qemu-devel] [PULL 17/35] Add skip_dump flag to ignore memory region during dump, Paolo Bonzini, 2014/10/31
- [Qemu-devel] [PULL 18/35] vl.c: Fix Coverity complaining for vmstate_dump_file, Paolo Bonzini, 2014/10/31
- [Qemu-devel] [PULL 19/35] kvmvapic: patch_instruction fix, Paolo Bonzini, 2014/10/31
- [Qemu-devel] [PULL 20/35] iscsi: Refuse to open as writable if the LUN is write protected, Paolo Bonzini, 2014/10/31
- [Qemu-devel] [PULL 21/35] virtio-scsi: Fix memory leak when realize failed, Paolo Bonzini, 2014/10/31
- [Qemu-devel] [PULL 22/35] scsi: devirtualize unrealize of SCSI devices, Paolo Bonzini, 2014/10/31
- [Qemu-devel] [PULL 23/35] virtio-scsi: Fix num_queue input validation, Paolo Bonzini, 2014/10/31
- [Qemu-devel] [PULL 24/35] kvm_stat: Only consider online cpus, Paolo Bonzini, 2014/10/31
- [Qemu-devel] [PULL 25/35] kvm_stat: Fix the non-x86 exit reasons,
Paolo Bonzini <=
- [Qemu-devel] [PULL 26/35] kvm_stat: Rework platform detection, Paolo Bonzini, 2014/10/31
- [Qemu-devel] [PULL 27/35] kvm_stat: Abstract ioctl numbers, Paolo Bonzini, 2014/10/31
- [Qemu-devel] [PULL 28/35] kvm_stat: Add powerpc support, Paolo Bonzini, 2014/10/31
- [Qemu-devel] [PULL 29/35] i386: fix breakpoints handling in icount mode, Paolo Bonzini, 2014/10/31
- [Qemu-devel] [PULL 32/35] ivshmem: Fix potential OOB r/w access, Paolo Bonzini, 2014/10/31
- [Qemu-devel] [PULL 33/35] ivshmem: Fix fd leak on error, Paolo Bonzini, 2014/10/31
- [Qemu-devel] [PULL 30/35] ivshmem: Check ivshmem_read() size argument, Paolo Bonzini, 2014/10/31
- [Qemu-devel] [PULL 34/35] ivshmem: use error_report, Paolo Bonzini, 2014/10/31
- [Qemu-devel] [PULL 35/35] virtio-scsi: fix dataplane, Paolo Bonzini, 2014/10/31
- [Qemu-devel] [PULL 31/35] ivshmem: validate incoming_posn value from server, Paolo Bonzini, 2014/10/31