diff options
author | Michael Shalayeff <mickey@cvs.openbsd.org> | 2006-03-10 21:09:23 +0000 |
---|---|---|
committer | Michael Shalayeff <mickey@cvs.openbsd.org> | 2006-03-10 21:09:23 +0000 |
commit | ad19342fd2b93425a4ec3f37d2a8ce89aa9ba0dc (patch) | |
tree | 02ec437c98f91f780d2c636f3e1dc08dad3f6177 /sys/arch | |
parent | b7b429537cca734cfd5ea274b078e5001e3ea01a (diff) |
provide a counter for ipis
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/amd64/amd64/ipi.c | 4 | ||||
-rw-r--r-- | sys/arch/amd64/amd64/lapic.c | 5 | ||||
-rw-r--r-- | sys/arch/i386/i386/ipifuncs.c | 4 | ||||
-rw-r--r-- | sys/arch/i386/i386/lapic.c | 5 |
4 files changed, 14 insertions, 4 deletions
diff --git a/sys/arch/amd64/amd64/ipi.c b/sys/arch/amd64/amd64/ipi.c index 3bee6bfd3dd..bc0a3df27ed 100644 --- a/sys/arch/amd64/amd64/ipi.c +++ b/sys/arch/amd64/amd64/ipi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ipi.c,v 1.2 2005/09/25 20:48:18 miod Exp $ */ +/* $OpenBSD: ipi.c,v 1.3 2006/03/10 21:09:22 mickey Exp $ */ /* $NetBSD: ipi.c,v 1.2 2003/03/01 13:05:37 fvdl Exp $ */ /*- @@ -126,6 +126,7 @@ x86_multicast_ipi(int cpumask, int ipimask) void x86_ipi_handler(void) { + extern struct evcount clk_count; struct cpu_info *ci = curcpu(); u_int32_t pending; int bit; @@ -137,6 +138,7 @@ x86_ipi_handler(void) pending &= ~(1<<bit); ci->ci_ipi_events[bit].ev_count++; (*ipifunc[bit])(ci); + ipi_count.ec_count++; } } } diff --git a/sys/arch/amd64/amd64/lapic.c b/sys/arch/amd64/amd64/lapic.c index 664593722ab..69adb4ca073 100644 --- a/sys/arch/amd64/amd64/lapic.c +++ b/sys/arch/amd64/amd64/lapic.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lapic.c,v 1.4 2005/12/13 23:33:25 mickey Exp $ */ +/* $OpenBSD: lapic.c,v 1.5 2006/03/10 21:09:22 mickey Exp $ */ /* $NetBSD: lapic.c,v 1.2 2003/05/08 01:04:35 fvdl Exp $ */ /*- @@ -64,6 +64,7 @@ #include <machine/i82489var.h> struct evcount clk_count; +struct evcount ipi_count; void lapic_delay(int); void lapic_microtime(struct timeval *); @@ -197,6 +198,7 @@ lapic_boot_init(lapic_base) paddr_t lapic_base; { static u_int64_t clk_irq = 0; + static u_int64_t ipi_irq = 0; lapic_map(lapic_base); @@ -211,6 +213,7 @@ lapic_boot_init(lapic_base) idt_vec_set(LAPIC_TIMER_VECTOR, Xintr_lapic_ltimer); evcount_attach(&clk_count, "clock", (void *)&clk_irq, &evcount_intr); + evcount_attach(&ipi_count, "ipi", (void *)&ipi_irq, &evcount_intr); } static inline u_int32_t lapic_gettick() diff --git a/sys/arch/i386/i386/ipifuncs.c b/sys/arch/i386/i386/ipifuncs.c index 6cfaca14352..4428f6f2ff1 100644 --- a/sys/arch/i386/i386/ipifuncs.c +++ b/sys/arch/i386/i386/ipifuncs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ipifuncs.c,v 1.3 2004/06/16 18:24:23 grange Exp $ */ +/* $OpenBSD: ipifuncs.c,v 1.4 2006/03/10 21:09:22 mickey Exp $ */ /* $NetBSD: ipifuncs.c,v 1.1.2.3 2000/06/26 02:04:06 sommerfeld Exp $ */ /*- @@ -164,6 +164,7 @@ i386_broadcast_ipi(int ipimask) void i386_ipi_handler(void) { + extern struct evcount ipi_count; struct cpu_info *ci = curcpu(); u_int32_t pending; int bit; @@ -174,6 +175,7 @@ i386_ipi_handler(void) if (pending & (1<<bit)) { pending &= ~(1<<bit); (*ipifunc[bit])(ci); + ipi_count.ec_count++; } } } diff --git a/sys/arch/i386/i386/lapic.c b/sys/arch/i386/i386/lapic.c index 99e9ad57bdf..4053df12805 100644 --- a/sys/arch/i386/i386/lapic.c +++ b/sys/arch/i386/i386/lapic.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lapic.c,v 1.5 2004/06/28 02:00:20 deraadt Exp $ */ +/* $OpenBSD: lapic.c,v 1.6 2006/03/10 21:09:22 mickey Exp $ */ /* $NetBSD: lapic.c,v 1.1.2.8 2000/02/23 06:10:50 sommerfeld Exp $ */ /*- @@ -64,6 +64,7 @@ #include <i386/isa/timerreg.h> /* XXX for TIMER_FREQ */ struct evcount clk_count; +struct evcount ipi_count; void lapic_delay(int); void lapic_microtime(struct timeval *); @@ -165,6 +166,7 @@ lapic_boot_init(lapic_base) paddr_t lapic_base; { static int clk_irq = 0; + static int ipi_irq = 0; lapic_map(lapic_base); @@ -175,6 +177,7 @@ lapic_boot_init(lapic_base) idt_vec_set(LAPIC_TIMER_VECTOR, Xintrltimer); evcount_attach(&clk_count, "clock", (void *)&clk_irq, &evcount_intr); + evcount_attach(&ipi_count, "ipi", (void *)&ipi_irq, &evcount_intr); } static __inline u_int32_t |