summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormiod <miod@openbsd.org>2012-04-10 15:59:21 +0000
committermiod <miod@openbsd.org>2012-04-10 15:59:21 +0000
commit8b9de01a7bcc0af9dd39ee011d8b23c7d7a7740c (patch)
tree1a80e13ab2569b976a719a62b831d67654999e0f
parentDocument new KERN_NTHREADS and KERN_MAXTHREAD sysctls (diff)
downloadwireguard-openbsd-8b9de01a7bcc0af9dd39ee011d8b23c7d7a7740c.tar.xz
wireguard-openbsd-8b9de01a7bcc0af9dd39ee011d8b23c7d7a7740c.zip
Count traps and fpu context switches.
-rw-r--r--sys/arch/mips64/mips64/cpu.c3
-rw-r--r--sys/arch/mips64/mips64/softintr.c4
-rw-r--r--sys/arch/mips64/mips64/trap.c8
3 files changed, 9 insertions, 6 deletions
diff --git a/sys/arch/mips64/mips64/cpu.c b/sys/arch/mips64/mips64/cpu.c
index e7f27e55b25..f38bd7b5985 100644
--- a/sys/arch/mips64/mips64/cpu.c
+++ b/sys/arch/mips64/mips64/cpu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpu.c,v 1.41 2012/04/06 20:11:18 miod Exp $ */
+/* $OpenBSD: cpu.c,v 1.42 2012/04/10 15:59:21 miod Exp $ */
/*
* Copyright (c) 1997-2004 Opsycon AB (www.opsycon.se)
@@ -356,6 +356,7 @@ enable_fpu(struct proc *p)
MipsSwitchFPState(ci->ci_fpuproc, p->p_md.md_regs);
else
MipsSwitchFPState16(ci->ci_fpuproc, p->p_md.md_regs);
+ atomic_add_int(&uvmexp.fpswtch, 1);
ci->ci_fpuproc = p;
p->p_md.md_regs->sr |= SR_COP_1_BIT;
diff --git a/sys/arch/mips64/mips64/softintr.c b/sys/arch/mips64/mips64/softintr.c
index 8ed66087834..590dd62423f 100644
--- a/sys/arch/mips64/mips64/softintr.c
+++ b/sys/arch/mips64/mips64/softintr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: softintr.c,v 1.12 2010/12/21 14:56:24 claudio Exp $ */
+/* $OpenBSD: softintr.c,v 1.13 2012/04/10 15:59:21 miod Exp $ */
/* $NetBSD: softintr.c,v 1.2 2003/07/15 00:24:39 lukem Exp $ */
/*
@@ -87,7 +87,7 @@ softintr_dispatch(int si)
TAILQ_REMOVE(&siq->siq_list, sih, sih_list);
sih->sih_pending = 0;
- uvmexp.softs++;
+ atomic_add_int(&uvmexp.softs, 1);
mtx_leave(&siq->siq_mtx);
diff --git a/sys/arch/mips64/mips64/trap.c b/sys/arch/mips64/mips64/trap.c
index bddc051fd55..e72715c71f1 100644
--- a/sys/arch/mips64/mips64/trap.c
+++ b/sys/arch/mips64/mips64/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.79 2012/04/09 16:56:21 miod Exp $ */
+/* $OpenBSD: trap.c,v 1.80 2012/04/10 15:59:21 miod Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -150,7 +150,7 @@ ast()
struct cpu_info *ci = curcpu();
struct proc *p = ci->ci_curproc;
- uvmexp.softs++;
+ atomic_add_int(&uvmexp.softs, 1);
p->p_md.md_astpending = 0;
if (p->p_flag & P_OWEUPC) {
@@ -185,6 +185,8 @@ trap(struct trap_frame *trapframe)
trapdebug_enter(ci, trapframe, -1);
type = (trapframe->cause & CR_EXC_CODE) >> CR_EXC_CODE_SHIFT;
+ if (type != T_SYSCALL)
+ atomic_add_int(&uvmexp.traps, 1);
if (USERMODE(trapframe->sr)) {
type |= T_USER;
}
@@ -406,7 +408,7 @@ printf("SIG-BUSB @%p pc %p, ra %p\n", trapframe->badvaddr, trapframe->pc, trapfr
} args;
register_t rval[2];
- uvmexp.syscalls++;
+ atomic_add_int(&uvmexp.syscalls, 1);
/* compute next PC after syscall instruction */
tpc = trapframe->pc; /* Remember if restart */