This is the mail archive of the
systemtap@sources.redhat.com
mailing list for the systemtap project.
Re: How does jprobes/kprobes work ?
- From: Ananth N Mavinakayanahalli <ananth at in dot ibm dot com>
- To: Badari Pulavarty <pbadari at us dot ibm dot com>
- Cc: SystemTAP <systemtap at sources dot redhat dot com>
- Date: Wed, 16 Mar 2005 10:05:32 +0530
- Subject: Re: How does jprobes/kprobes work ?
- References: <42361E87.70105@us.ibm.com>
- Reply-to: ananth at in dot ibm dot com
On Mon, Mar 14, 2005 at 03:30:15PM -0800, Badari Pulavarty wrote:
> Hi,
>
> I am just wondering how does jprobes provide the arguments
> to the function if I enable IRQ_STACKS on PPC64 or
> 4KSTACKS on i386 ? This forces the interrupt to be taken
> on a per-processor stacks, there by loosing original stack.
CONFIG_IRQSTACKS is default on in pSeries defconfig.
> Does the code go thro the trouble of finding out the original
> stack and copy it for arguments ?
When the kprobe (which is what lies underneath, even if its a jprobe
hit), will "trap" and the pt_regs snapshot at the time of the probe hit
is captured. Since, on ppc64, all args are passed in registers, we still
have access to the function arguments necessary and we don't need to
play with the stack at all. Upon a jprobe_return(), which again will
"trap", we recognize that we are here due to a jprobe_return() and then
restore back the original pt_regs and continue.
Thanks,
Ananth