diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/mips/kernel/time.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/arch/mips/kernel/time.c b/arch/mips/kernel/time.c index 9c51d1eb7..bf056a122 100644 --- a/arch/mips/kernel/time.c +++ b/arch/mips/kernel/time.c @@ -6,7 +6,7 @@ * This file contains the time handling details for PC-style clocks as * found in some MIPS systems. * - * $Id: time.c,v 1.5 1998/06/06 12:41:48 tsbogend Exp $ + * $Id: time.c,v 1.6 1998/08/25 09:14:43 ralf Exp $ */ #include <linux/errno.h> #include <linux/init.h> @@ -329,6 +329,25 @@ static long last_rtc_update = 0; static void inline timer_interrupt(int irq, void *dev_id, struct pt_regs * regs) { +#ifdef CONFIG_PROFILE + if(!user_mode(regs)) { + if (prof_buffer && current->pid) { + extern int _stext; + unsigned long pc = regs->cp0_epc; + + pc -= (unsigned long) &_stext; + pc >>= prof_shift; + /* + * Dont ignore out-of-bounds pc values silently, + * put them into the last histogram slot, so if + * present, they will show up as a sharp peak. + */ + if (pc > prof_len-1) + pc = prof_len-1; + atomic_inc((atomic_t *)&prof_buffer[pc]); + } + } +#endif do_timer(regs); /* |