diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2006-12-24 20:29:46 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2006-12-24 20:29:46 +0000 |
commit | 40edd12a0c0296733c9c321bece20217e47c0dc5 (patch) | |
tree | 7a68b6c1e29b6a600375ed5f819fe203c97574c6 /sys/kern | |
parent | 0330d467c5d5654526bf0e8d6141cf8d59a148ed (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.c | 7 |
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; /* |