-static inline void sh64_do_profile(struct pt_regs *regs)
-{
- extern int _stext;
- unsigned long pc;
-
- profile_hook(regs);
-
- if (user_mode(regs))
- return;
-
- /* Don't profile cpu_idle.. */
- if (!prof_buffer || !current->pid)
- return;
-
- pc = instruction_pointer(regs);
- 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;
-
- /* We could just be sloppy and not lock against a re-entry on this
- increment, but the profiling code won't always be linked in anyway. */
- atomic_inc((atomic_t *)&prof_buffer[pc]);
-}
-