summaryrefslogtreecommitdiffstats
path: root/arch/m68k/kernel/time.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1997-06-01 03:16:17 +0000
committerRalf Baechle <ralf@linux-mips.org>1997-06-01 03:16:17 +0000
commitd8d9b8f76f22b7a16a83e261e64f89ee611f49df (patch)
tree3067bc130b80d52808e6390c9fc7fc087ec1e33c /arch/m68k/kernel/time.c
parent19c9bba94152148523ba0f7ef7cffe3d45656b11 (diff)
Initial revision
Diffstat (limited to 'arch/m68k/kernel/time.c')
-rw-r--r--arch/m68k/kernel/time.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/arch/m68k/kernel/time.c b/arch/m68k/kernel/time.c
index dbff49276..7b3acdfa6 100644
--- a/arch/m68k/kernel/time.c
+++ b/arch/m68k/kernel/time.c
@@ -27,6 +27,24 @@ static inline int set_rtc_mmss(unsigned long nowtime)
return -1;
}
+static inline void do_profile (unsigned long pc)
+{
+ if (prof_buffer && current->pid) {
+ extern int _stext;
+ pc -= (unsigned long) &_stext;
+ pc >>= prof_shift;
+ if (pc < prof_len)
+ ++prof_buffer[pc];
+ else
+ /*
+ * 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.
+ */
+ ++prof_buffer[prof_len-1];
+ }
+}
+
/*
* timer_interrupt() needs to keep up the real-time clock,
* as well as call the "do_timer()" routine every clocktick
@@ -38,6 +56,9 @@ static void timer_interrupt(int irq, void *dummy, struct pt_regs * regs)
do_timer(regs);
+ if (!user_mode(regs))
+ do_profile(regs->pc);
+
/*
* If we have an externally synchronized Linux clock, then update
* CMOS clock accordingly every ~11 minutes. Set_rtc_mmss() has to be