summaryrefslogtreecommitdiffstats
path: root/scripts/kvm
Commit message (Collapse)AuthorAgeFilesLines
* kvm_stat: add kvm_stat.1 man pageStefan Hajnoczi2015-03-101-0/+55
| | | | | | | | Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Ademar Reis <areis@redhat.com> Reviewed-by: Wei Huang <wei@redhat.com> Message-Id: <1425338947-10296-3-git-send-email-stefanha@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* kvm_stat: add column headers to text UIStefan Hajnoczi2015-03-101-1/+4
| | | | | | | | | | | | The curses user interface shows both the accumulated total and the current event counts. Add column headers so it's clear what the numbers mean. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Ademar Reis <areis@redhat.com> Reviewed-by: Wei Huang <wei@redhat.com> Message-Id: <1425338947-10296-2-git-send-email-stefanha@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* kvm_stat: Add kvm_exit reasons for aarch64Wei Huang2015-02-111-1/+41
| | | | | | | | | | | | | | | | This patch defines the list of kvm_exit reasons for aarch64. This list is based on the Exception Class (EC) field of HSR register. With this patch users can trace the execution of guest VMs better. A sample output from command "kvm_stat -1 -t" is shown as the following: <...> kvm_exit(WATCHPT_HYP) 0 0 kvm_exit(WFI) 9422 9361 NOTE: This patch requires TRACE_EVENT(kvm_exit) to include exit_reason field in TP_ARGS. A patch to upstream kernel has been submitted. Signed-off-by: Wei Huang <wei@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* kvm_stat: Add RESET support for perf event ioctlWei Huang2015-01-261-0/+5
| | | | | | | | | | | | | | | | | | | | | | | While running kvm_stat using tracepoint on ARM64 hardware (e.g. "kvm_stat -1 -t"), the initial values of some kvm_userspace_exit counters were found to be very suspecious. For instance the tracing tool showed that S390_TSCH was called many times on ARM64 machine, which apparently was wrong. This patch adds RESET ioctl support for perf monitoring. Before calling ioctl to enable a perf event, this patch resets the counter first. With this patch, the init counter values become correct on ARM64 hardware. Example: ==== before patch ==== kvm_userspace_exit(S390_SIEIC) 1426 0 kvm_userspace_exit(S390_TSCH) 339 0 ==== after patch ==== kvm_userspace_exit(S390_SIEIC) 0 0 kvm_userspace_exit(S390_TSCH) 0 0 Signed-off-by: Wei Huang <wei@redhat.com>
* kvm_stat: Print errno when syscall to perf_event_open() failsWei Huang2015-01-261-1/+6
| | | | | | | | | | | kvm_stat uses syscall() to call perf_event_open(). If this function call fails, the returned value is -1, which doesn't tell the details of such failure (i.e. ENOSYS or EINVAL). This patch retrieves errno and prints it when syscall() fails. The error message will look like "Exception: perf_event_open failed, errno = 38". Signed-off-by: Wei Huang <wei@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* kvm_stat: Update exit reasons to the latest defintionWei Huang2015-01-261-0/+4
| | | | | | | | This patch updates the exit reasons for x86_vmx, x86_svm, and userspace to the latest definition. Signed-off-by: Wei Huang <wei@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* kvm_stat: Add aarch64 supportWei Huang2015-01-261-0/+8
| | | | | | | | This patch enables aarch64 support for kvm_stat. The platform detection is based on OS uname. Signed-off-by: Wei Huang <wei@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* kvm_stat: Add powerpc supportMichael Ellerman2014-10-311-2/+16
| | | | | | | | 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>
* kvm_stat: Abstract ioctl numbersMichael Ellerman2014-10-311-3/+9
| | | | | | | | | Unfortunately ioctl numbers are platform specific, so abstract them out of the code so they can be overridden. As it happens x86 and s390 share the same values, so nothing needs to change yet. Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* kvm_stat: Rework platform detectionMichael Ellerman2014-10-311-14/+27
| | | | | | | | | | | | | | The current platform detection is a little bit messy. We look for lines in /proc/cpuinfo starting with 'flags' OR 'vendor-id', and scan both for values we know will only occur in one or the other. We also keep scanning once we've found a value, which could be a feature, but isn't in this case. We'd also like to add another platform, powerpc, which will just make it worse. So clean it up in preparation. Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* kvm_stat: Fix the non-x86 exit reasonsMichael Ellerman2014-10-311-27/+30
| | | | | | | | | | | | | | 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 <mpe@ellerman.id.au> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* kvm_stat: Only consider online cpusMichael Ellerman2014-10-311-6/+18
| | | | | | | | | | | | | In kvm_stat we grovel through /sys to find out how many cpus are in the system. However if a cpu is offline it will still be present in /sys, and the perf_event_open() will fail. Modify the logic to only return online cpus. We need to be careful on systems which don't support cpu hotplug, the online file will not be present at all. Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* vmxcap: Update according to SDM of September 2014Adrian-Ken Rueegsegger2014-09-261-4/+6
| | | | | | | | This adds reporting of RDSEED exiting and XSAVES/XRSTORS #UD and fixes the range of VMCS revision as well as some typos. Signed-off-by: Adrian-Ken Rueegsegger <ken@codelabs.ch> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
* kvm_stat: allow choosing between tracepoints and old statsPaolo Bonzini2014-05-211-19/+41
| | | | | | | | | | The old stats contain information not available in the tracepoints. By default, keep the old behavior, but allow choosing which set of stats to present, or even both. Inspired by a patch from Marcelo Tosatti. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* vmxcap: Update according to SDM of January 2013Jan Kiszka2013-04-171-1/+5
| | | | | | | | This adds reporting of VMCS shadowing, #VE, IA32_SMBASE, unrestricted VMWRITE and fixes the range of the MSEG revision ID. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
* vmxcap: Report APIC register emulation and RDTSCP controlJan Kiszka2013-04-171-0/+2
| | | | | Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
* vmxcap: Augment reported informationJan Kiszka2013-04-171-0/+14
| | | | | | | | Parse the Basic VMX Information MSR and add the bit for the new posted interrupts. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Gleb Natapov <gleb@redhat.com>
* vmxcap: Open MSR file in unbuffered modeJan Kiszka2013-04-171-2/+2
| | | | | | | | | Python may otherwise decide to to read larger chunks, applying the seek only on the software buffer. This will return results from the wrong MSRs. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Gleb Natapov <gleb@redhat.com>
* vmxcap: bit 9 of VMX_PROCBASED_CTLS2 is 'virtual interrupt delivery'Marcelo Tosatti2013-01-211-0/+1
| | | | | | | Bit 9 of MSR_IA32_VMX_PROCBASED_CTLS2 is virtual interrupt delivery. Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
* s390/kvm_stat: correct sys_perf_event_open syscall numberHeinz Graalfs2012-10-291-2/+9
| | | | | | | | | | | | | Correct sys_perf_event_open syscall number for s390 architecture - the hardcoded syscall number 298 is for x86 but should be different for other architectures. In case we figure out via /proc/cpuinfo that we are running on s390 the appropriate syscall number is used from map syscall_numbers; other architectures can extend this. Signed-off-by: Heinz Graalfs <graalfs@linux.vnet.ibm.com> Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com> Signed-off-by: Alexander Graf <agraf@suse.de>
* s390: make kvm_stat work on s390Jens Freimann2012-06-181-1/+25
| | | | | | | | | Add s390_exit_reasons so kvm_stat doesn't crash when called on s390. Look for 'vendor_id' in /proc/cpuinfo as well, instead of just for 'flags', so we can determine if we run on S390. Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com> Signed-off-by: Alexander Graf <agraf@suse.de>
* kvm: update vmxcap for EPT A/D, INVPCID, RDRAND, VMFUNCAvi Kivity2012-05-171-0/+13
| | | | | Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
* kvm: add flightrecorder scriptStefan Hajnoczi2012-04-121-0/+126
| | | | | | | | | | | | | | | | | | | | | | | | | The kvm kernel module includes a number of trace events which can be useful when debugging system behavior. Even on production systems these trace events can be used to observe guest behavior and identify the source of problems. The kvm_flightrecorder script is a command-line wrapper for the /sys/kernel/debug/tracing interface. Kernel symbols do not need to be installed. This script captures a fixed-size buffer of KVM trace events. Recent events overwrite the oldest events when the buffer size is exceeded and it is possible to leave KVM tracing enabled for any period of time with just a fixed-size buffer. If the buffer is large enough this script is a useful tool for collecting detailed information after an issue occurs with a guest. Hence the name "flight recorder". The script can also be used in 'tail' mode to simply view KVM trace events as they occur. This is handy for development and to ensure that the guest is indeed running. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
* kvm: Add top-like kvm statistics scriptJan Kiszka2011-10-241-0/+480
| | | | | | | Taken from original qemu-kvm/kvm/kvm_stat. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Avi Kivity <avi@redhat.com>
* kvm: Add tool for querying VMX capabilitiesJan Kiszka2011-10-241-0/+224
Taken from original qemu-kvm/kvm/scripts/vmxcap. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Avi Kivity <avi@redhat.com>
OpenPOWER on IntegriCloud