summaryrefslogtreecommitdiffstats
path: root/arch/mips/kernel
diff options
context:
space:
mode:
authorThomas Bogendoerfer <tsbogend@alpha.franken.de>1998-08-28 23:29:33 +0000
committerThomas Bogendoerfer <tsbogend@alpha.franken.de>1998-08-28 23:29:33 +0000
commit3c1ee244e6bf987a10bdcb6224757a8b651c88fb (patch)
treeaecd7e2fe26126b93cde000530b90a0c74f7aed3 /arch/mips/kernel
parent83a7a5e5e1adeeaa9c405ad9a14808bca5ed6bb8 (diff)
added profiling again.
Diffstat (limited to 'arch/mips/kernel')
-rw-r--r--arch/mips/kernel/time.c21
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);
/*