This is the mail archive of the systemtap@sources.redhat.com mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: How does jprobes/kprobes work ?


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]