Messages in this thread | | | Date | Fri, 3 Sep 2004 10:04:56 +0100 | From | Russell King <> | Subject | Re: [PATCH][6/8] Arch agnostic completely out of line locks / arm |
| |
On Thu, Sep 02, 2004 at 08:02:55PM -0400, Zwane Mwaikambo wrote: > --- linux-2.6.9-rc1-mm1-stage/arch/arm/kernel/time.c 26 Aug 2004 13:13:04 -0000 1.1.1.1 > +++ linux-2.6.9-rc1-mm1-stage/arch/arm/kernel/time.c 2 Sep 2004 15:51:37 -0000 > @@ -52,6 +52,18 @@ EXPORT_SYMBOL(rtc_lock); > /* change this if you have some constant time drift */ > #define USECS_PER_JIFFY (1000000/HZ) > > +#ifdef CONFIG_SMP > +unsigned long profile_pc(struct pt_regs *regs) > +{ > + unsigned long pc = instruction_pointer(regs); > + > + if (pc >= (unsigned long)&__lock_text_start && > + pc <= (unsigned long)&__lock_text_end) > + return regs->ARM_lr; > + return pc; > +} > +EXPORT_SYMBOL(profile_pc); > +#endif
Looks good apart from this. There's no guarantee that LR will be the return address inside one of these lock functions - indeed the compiler may have saved it onto the stack and decided to use the register for something else.
Your best bet is to look at the get_wchan() code which walks the stack frames (if present.)
-- Russell King Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/ maintainer of: 2.6 PCMCIA - http://pcmcia.arm.linux.org.uk/ 2.6 Serial core - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |