summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2006-12-24 20:29:46 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2006-12-24 20:29:46 +0000
commit40edd12a0c0296733c9c321bece20217e47c0dc5 (patch)
tree7a68b6c1e29b6a600375ed5f819fe203c97574c6 /sys/kern
parent0330d467c5d5654526bf0e8d6141cf8d59a148ed (diff)
If <machine/cpu.h> defines PROC_PC to compute the userland pc from an exception
frame, use it to report profiling information via addupc_intr().
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/kern_clock.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/kern/kern_clock.c b/sys/kern/kern_clock.c
index 30140b0688d..024bc6cc2ae 100644
--- a/sys/kern/kern_clock.c
+++ b/sys/kern/kern_clock.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_clock.c,v 1.59 2006/06/14 19:52:07 otto Exp $ */
+/* $OpenBSD: kern_clock.c,v 1.60 2006/12/24 20:29:45 miod Exp $ */
/* $NetBSD: kern_clock.c,v 1.34 1996/06/09 04:51:03 briggs Exp $ */
/*-
@@ -44,6 +44,7 @@
#include <sys/kernel.h>
#include <sys/limits.h>
#include <sys/proc.h>
+#include <sys/user.h>
#include <sys/resourcevar.h>
#include <sys/signalvar.h>
#include <uvm/uvm_extern.h>
@@ -541,6 +542,10 @@ statclock(struct clockframe *frame)
}
}
#endif
+#if defined(PROC_PC)
+ if (p != NULL && p->p_flag & P_PROFIL)
+ addupc_intr(p, PROC_PC(p));
+#endif
if (--pscnt > 0)
return;
/*