aboutsummaryrefslogtreecommitdiff
path: root/arch/arm/kvm/arm.c
diff options
context:
space:
mode:
authorMarc Zyngier <marc.zyngier@arm.com>2013-03-05 03:18:00 +0000
committerChristoffer Dall <cdall@cs.columbia.edu>2013-04-28 21:44:01 -0700
commit210552c1bfe83122a480673660d5ca9821c944ae (patch)
tree713137a46a8d462e107e56ecf767773f15d37903 /arch/arm/kvm/arm.c
parent5a2892ce72e010e3cb96b438d7cdddce0c88e0e6 (diff)
ARM: KVM: add support for minimal host vs guest profiling
In order to be able to correctly profile what is happening on the host, we need to be able to identify when we're running on the guest, and log these events differently. Perf offers a simple way to register callbacks into KVM. Mimic what x86 does and enjoy being able to profile your KVM host. Signed-off-by: Marc Zyngier <marc.zyngier@arm.com> Signed-off-by: Christoffer Dall <cdall@cs.columbia.edu>
Diffstat (limited to 'arch/arm/kvm/arm.c')
-rw-r--r--arch/arm/kvm/arm.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c
index 1497e18a9e2..7403f884a54 100644
--- a/arch/arm/kvm/arm.c
+++ b/arch/arm/kvm/arm.c
@@ -920,7 +920,10 @@ static int init_hyp_mode(void)
if (err)
goto out_free_mappings;
+ kvm_perf_init();
+
kvm_info("Hyp mode initialized successfully\n");
+
return 0;
out_free_vfp:
free_percpu(kvm_host_vfp_state);
@@ -964,6 +967,7 @@ out_err:
/* NOP: Compiling as a module not supported */
void kvm_arch_exit(void)
{
+ kvm_perf_teardown();
}
static int arm_init(void)