X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=arch%2Fsh%2Fkernel%2Ftime.c;h=75ed2b870511370c9d999291d0322067149eacde;hb=c7b5ebbddf7bcd3651947760f423e3783bbe6573;hp=3bcdf4ca405d1b3a127604d608e5ab535689446b;hpb=a2c21200f1c81b08cb55e417b68150bba439b646;p=linux-2.6.git diff --git a/arch/sh/kernel/time.c b/arch/sh/kernel/time.c index 3bcdf4ca4..75ed2b870 100644 --- a/arch/sh/kernel/time.c +++ b/arch/sh/kernel/time.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include @@ -250,36 +251,6 @@ EXPORT_SYMBOL(do_settimeofday); /* last time the RTC clock got updated */ static long last_rtc_update; -/* Profiling definitions */ -extern unsigned long prof_cpu_mask; -extern unsigned int * prof_buffer; -extern unsigned long prof_len; -extern unsigned long prof_shift; -extern char _stext; - -static inline void sh_do_profile(unsigned long pc) -{ - /* Don't profile cpu_idle.. */ - if (!prof_buffer || !current->pid) - return; - - if (pc >= 0xa0000000UL && pc < 0xc0000000UL) - pc -= 0x20000000; - - pc -= (unsigned long)&_stext; - pc >>= prof_shift; - - /* - * Don't 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]); -} - /* * timer_interrupt() needs to keep up the real-time clock, * as well as call the "do_timer()" routine every clocktick @@ -287,9 +258,7 @@ static inline void sh_do_profile(unsigned long pc) static inline void do_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) { do_timer(regs); - - if (!user_mode(regs)) - sh_do_profile(regs->pc); + profile_tick(CPU_PROFILING, regs); #ifdef CONFIG_HEARTBEAT if (sh_mv.mv_heartbeat != NULL)