X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=arch%2Fppc%2Fkernel%2Ftime.c;h=cfeff0479c2e6a972839a19e39c6bd536b51e0ca;hb=9bf4aaab3e101692164d49b7ca357651eb691cb6;hp=96a6138e4109e734f05b84db0eb174349d8c03be;hpb=db216c3d5e4c040e557a50f8f5d35d5c415e8c1c;p=linux-2.6.git diff --git a/arch/ppc/kernel/time.c b/arch/ppc/kernel/time.c index 96a6138e4..cfeff0479 100644 --- a/arch/ppc/kernel/time.c +++ b/arch/ppc/kernel/time.c @@ -56,6 +56,7 @@ #include #include #include +#include #include #include @@ -107,17 +108,23 @@ static inline int tb_delta(unsigned *jiffy_stamp) { return delta; } -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 ppc_do_profile (unsigned long nip) +static inline void ppc_do_profile (struct pt_regs *regs) { + unsigned long nip; + extern unsigned long prof_cpu_mask; + + profile_hook(regs); + + if (user_mode(regs)) + return; + if (!prof_buffer) return; + nip = instruction_pointer(regs); + /* * Only measure the CPUs specified by /proc/irq/prof_cpu_mask. * (default is all CPUs.) @@ -156,8 +163,9 @@ void timer_interrupt(struct pt_regs * regs) while ((next_dec = tb_ticks_per_jiffy - tb_delta(&jiffy_stamp)) < 0) { jiffy_stamp += tb_ticks_per_jiffy; - if (!user_mode(regs)) - ppc_do_profile(instruction_pointer(regs)); + + ppc_do_profile(regs); + if (smp_processor_id()) continue;