summaryrefslogtreecommitdiffstats
path: root/sys/amd64
diff options
context:
space:
mode:
authorneel <neel@FreeBSD.org>2013-03-31 03:56:48 +0000
committerneel <neel@FreeBSD.org>2013-03-31 03:56:48 +0000
commit39fb54304e42db767ce96f78211a3ce4d3a018b5 (patch)
tree1b48bb11f5c07f3b0334004c0a54012893fd09ba /sys/amd64
parent0e1ccb44c5da7e180fb05c8e7eac0aeee41cb7f6 (diff)
downloadFreeBSD-src-39fb54304e42db767ce96f78211a3ce4d3a018b5.zip
FreeBSD-src-39fb54304e42db767ce96f78211a3ce4d3a018b5.tar.gz
Add counter to keep track of the number of timer interrupts generated by
the local apic for each virtual cpu.
Diffstat (limited to 'sys/amd64')
-rw-r--r--sys/amd64/vmm/io/vlapic.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/amd64/vmm/io/vlapic.c b/sys/amd64/vmm/io/vlapic.c
index 15fc6c2..cc2e09c 100644
--- a/sys/amd64/vmm/io/vlapic.c
+++ b/sys/amd64/vmm/io/vlapic.c
@@ -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);
}
OpenPOWER on IntegriCloud