mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
[PATCH] KVM: add VM-exit profiling
This adds the profile=kvm boot option, which enables KVM to profile VM exits. Use: "readprofile -m ./System.map | sort -n" to see the resulting output: [...] 18246 serial_out 148.3415 18945 native_flush_tlb 378.9000 23618 serial_in 212.7748 29279 __spin_unlock_irq 622.9574 43447 native_apic_write 2068.9048 52702 enable_8259A_irq 742.2817 54250 vgacon_scroll 89.3740 67394 ide_inb 6126.7273 79514 copy_page_range 98.1654 84868 do_wp_page 86.6000 140266 pit_read 783.6089 151436 ide_outb 25239.3333 152668 native_io_delay 21809.7143 174783 mask_and_ack_8259A 783.7803 362404 native_set_pte_at 36240.4000 1688747 total 0.5009 Signed-off-by: Ingo Molnar <[email protected]> Acked-by: Avi Kivity <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
e3881a6816
commit
07031e14c1
4 changed files with 30 additions and 0 deletions
|
|
@ -17,6 +17,7 @@
|
|||
#include <linux/module.h>
|
||||
#include <linux/vmalloc.h>
|
||||
#include <linux/highmem.h>
|
||||
#include <linux/profile.h>
|
||||
#include <asm/desc.h>
|
||||
|
||||
#include "kvm_svm.h"
|
||||
|
|
@ -1558,6 +1559,13 @@ again:
|
|||
|
||||
reload_tss(vcpu);
|
||||
|
||||
/*
|
||||
* Profile KVM exit RIPs:
|
||||
*/
|
||||
if (unlikely(prof_on == KVM_PROFILING))
|
||||
profile_hit(KVM_PROFILING,
|
||||
(void *)(unsigned long)vcpu->svm->vmcb->save.rip);
|
||||
|
||||
stgi();
|
||||
|
||||
kvm_reput_irq(vcpu);
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@
|
|||
#include <linux/module.h>
|
||||
#include <linux/mm.h>
|
||||
#include <linux/highmem.h>
|
||||
#include <linux/profile.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/desc.h>
|
||||
|
||||
|
|
@ -1859,6 +1860,12 @@ again:
|
|||
asm ("mov %0, %%ds; mov %0, %%es" : : "r"(__USER_DS));
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Profile KVM exit RIPs:
|
||||
*/
|
||||
if (unlikely(prof_on == KVM_PROFILING))
|
||||
profile_hit(KVM_PROFILING, (void *)vmcs_readl(GUEST_RIP));
|
||||
|
||||
kvm_run->exit_type = 0;
|
||||
if (fail) {
|
||||
kvm_run->exit_type = KVM_EXIT_TYPE_FAIL_ENTRY;
|
||||
|
|
|
|||
Loading…
Reference in a new issue