Add counter to keep track of the number of timer interrupts generated by

the local apic for each virtual cpu.
This commit is contained in:
neel 2013-03-31 03:56:48 +00:00
parent 0e1ccb44c5
commit 39fb54304e

View File

@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$");
#include <machine/vmm.h>
#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);
}