aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/kvm/svm.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2007-01-11 02:15:38 -0500
committerLinus Torvalds <torvalds@woody.osdl.org>2007-01-11 21:18:21 -0500
commit07031e14c1127fc7e1a5b98dfcc59f434e025104 (patch)
treebe4f545e674c529abb0f51c8b87e1f7137c9acb6 /drivers/kvm/svm.c
parente3881a6816b45668df60a426e5c3431ece1539a7 (diff)
[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 <mingo@elte.hu> Acked-by: Avi Kivity <avi@qumranet.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/kvm/svm.c')
-rw-r--r--drivers/kvm/svm.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/kvm/svm.c b/drivers/kvm/svm.c
index ccc06b1b91b5..714f6a7841cd 100644
--- a/drivers/kvm/svm.c
+++ b/drivers/kvm/svm.c
@@ -17,6 +17,7 @@
17#include <linux/module.h> 17#include <linux/module.h>
18#include <linux/vmalloc.h> 18#include <linux/vmalloc.h>
19#include <linux/highmem.h> 19#include <linux/highmem.h>
20#include <linux/profile.h>
20#include <asm/desc.h> 21#include <asm/desc.h>
21 22
22#include "kvm_svm.h" 23#include "kvm_svm.h"
@@ -1558,6 +1559,13 @@ again:
1558 1559
1559 reload_tss(vcpu); 1560 reload_tss(vcpu);
1560 1561
1562 /*
1563 * Profile KVM exit RIPs:
1564 */
1565 if (unlikely(prof_on == KVM_PROFILING))
1566 profile_hit(KVM_PROFILING,
1567 (void *)(unsigned long)vcpu->svm->vmcb->save.rip);
1568
1561 stgi(); 1569 stgi();
1562 1570
1563 kvm_reput_irq(vcpu); 1571 kvm_reput_irq(vcpu);