-/* 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]);
-}
-