[PATCH] Kprobes for ppc64
Ananth N Mavinakayanahalli
ananth at in.ibm.com
Tue Oct 26 18:47:38 EST 2004
On Sat, Oct 23, 2004 at 06:19:00PM +1000, Paul Mackerras wrote:
> Ananth N Mavinakayanahalli writes:
>
> > 2. arch_prepare_kprobe() now returns an int. I have made the necessary
> > changes to i386 and sparc64 kprobes files, but is untested.
>
> Are you going to send this upstream?
Prasanna has a set of changes which he will be pushing to akpm shortly.
This will be part of the set.
> > + * Interrupts are disabled on entry as trap3 is an interrupt gate and they
> > + * remain disabled thorough out this function.
> > + */
> > +static inline int kprobe_handler(struct pt_regs *regs)
>
> Comments about "trap3" and "interrupt gate" don't help me understand
> this function on ppc64. :) At present interrupts are enabled in a
> program check exception handler but disabled in a single-step handler.
> When does this function get called?
Ah, I missed the comment .. my bad :(
kprobe_handler() gets invoked from ProgramCheckException().
> > @@ -96,6 +97,9 @@ int do_page_fault(struct pt_regs *regs,
> > BUG_ON((trap == 0x380) || (trap == 0x480));
> >
> > if (trap == 0x300) {
> > + if (notify_die(DIE_PAGE_FAULT, "page_fault", regs, error_code,
> > + 11, SIGSEGV) == NOTIFY_STOP)
> > + return 0;
>
> Hmmm, this seems a bit heavyweight for adding to the page fault path.
> Have you done any benchmarks with vs. without kprobes?
Hmm no, not yet.
> On the whole the patch looks OK. I haven't checked the kprobe_handler
> code to see if I think it's all SMP- and preempt-safe, but I assume
> you have done it similarly on x86 and checked it there.
Yes - the port is based off the initial x86 code. It is SMP and
preempt safe.
Thanks for your comments! I will rework the patch a bit and post it
soon.
Thanks,
Ananth
More information about the Linuxppc64-dev
mailing list