How does jprobes/kprobes work ?

Prasanna S Panchamukhi prasanna@in.ibm.com
Mon Mar 14 23:55:00 GMT 2005


Hi Badari,

>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.

It works with 4KSTACK enabled on i386.

>Does the code go thro the trouble of finding out the original
>stack and copy it for arguments ?

The way it works is that when the probe is hit, the breakpoint
handler simply irets to the probe handler's eip while retaining
register and stack state corresponding to the function entry.
After it is done, the probe handler calls jprobe_return() which
traps again to restore processor state and switch back to the
probed function.

Thanks
Prasanna
-- 

Prasanna S Panchamukhi
Linux Technology Center
India Software Labs, IBM Bangalore
Ph: 91-80-25044636
<prasanna@in.ibm.com>



More information about the Systemtap mailing list