This is the mail archive of the
systemtap@sources.redhat.com
mailing list for the systemtap project.
Re: [Fwd: Re: [PATCH] Return probe]
> Here's the new retprobe patch, this patch should apply to
> linix-2.6.12-rc2-mm2 + Anandth's multihadler (the one posted on LKML).
>
Jim, Hien,
This patch looks good to me, just one more comment.
>--- linux-2.6.12-rc2-mm2-mpapr15.org/arch/i386/kernel/entry.S 2005-04-11 13:54:37.000000000 -0700
>+++ linux-2.6.12-rc2-mm2-mprobe15apr/arch/i386/kernel/entry.S 2005-04-27 16:02:52.970687262 -0700
>@@ -997,3 +997,31 @@
> .long sys_vperfctr_read
>
> syscall_table_size=(.-sys_call_table)
>+
>+#ifdef CONFIG_KPROBES
>+/*
>+ * For function-return probes, init_kprobes() establishes a probepoint
>+ * here. When a retprobed function returns, this probe is hit and
>+ * trampoline_probe_handler() runs, calling the kretprobe's handler.
>+ * 16 nop since we copy MAX_INSN_SIZE into p->ainsn.insn.
>+ */
>+ENTRY(kretprobe_trampoline)
>+ nop
>+ nop
>+ nop
>+ nop
>+ nop
>+ nop
>+ nop
>+ nop
>+ nop
>+ nop
>+ nop
>+ nop
>+ nop
>+ nop
>+ nop
>+ nop
>+/* NOT REACHED */
>+#endif
>+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
You need not modify entry.S file. You can use inline assembly and
move this kretprobe_trampoline() to arch/i386/kernel/kprobes.c file.
Also there are lots of references to __builtin_return_address() in the kernel.
If a kretprobe is placed on some routine() and that routine calls
__builtin_return_address(), then __builtin_return_address() will return
incorrect value, since kretprobe modifies the retaddress stored on the stack.
Is this limitation acceptable ?
Thanks
Prasanna
--
Prasanna S Panchamukhi
Linux Technology Center
India Software Labs, IBM Bangalore
Ph: 91-80-25044636
<prasanna@in.ibm.com>