From 77d8fd9bb3f38693e1cda1bec687b4eb3f849190 Mon Sep 17 00:00:00 2001 From: Neel Natu Date: Sun, 31 Mar 2013 03:56:48 +0000 Subject: [PATCH] Add counter to keep track of the number of timer interrupts generated by the local apic for each virtual cpu. --- sys/amd64/vmm/io/vlapic.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/amd64/vmm/io/vlapic.c b/sys/amd64/vmm/io/vlapic.c index 15fc6c2e219a..cc2e09cd7b1f 100644 --- a/sys/amd64/vmm/io/vlapic.c +++ b/sys/amd64/vmm/io/vlapic.c @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include +#include "vmm_stat.h" #include "vmm_lapic.h" #include "vmm_ktr.h" #include "vdev.h" @@ -410,6 +411,8 @@ vlapic_periodic_timer(struct vlapic *vlapic) return (vlapic_get_lvt_field(lvt, APIC_LVTT_TM_PERIODIC)); } +static VMM_STAT(VLAPIC_INTR_TIMER, "timer interrupts generated by vlapic"); + static void vlapic_fire_timer(struct vlapic *vlapic) { @@ -419,6 +422,7 @@ vlapic_fire_timer(struct vlapic *vlapic) lvt = vlapic_get_lvt(vlapic, APIC_OFFSET_TIMER_LVT); if (!vlapic_get_lvt_field(lvt, APIC_LVTT_M)) { + vmm_stat_incr(vlapic->vm, vlapic->vcpuid, VLAPIC_INTR_TIMER, 1); vector = vlapic_get_lvt_field(lvt,APIC_LVTT_VECTOR); vlapic_set_intr_ready(vlapic, vector); }