This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: jprobe question
- From: Keshavamurthy Anil S <anil dot s dot keshavamurthy at intel dot com>
- To: "Zhang, Yanmin" <yanmin dot zhang at intel dot com>
- Cc: systemtap at sources dot redhat dot com, "Keshavamurthy, Anil S" <anil dot s dot keshavamurthy at intel dot com>, "Mao, Bibo" <bibo dot mao at intel dot com>
- Date: Tue, 29 Nov 2005 10:54:07 -0800
- Subject: Re: jprobe question
- References: <8126E4F969BA254AB43EA03C59F44E8404056CCD@pdsmsx404>
- Reply-to: Keshavamurthy Anil S <anil dot s dot keshavamurthy at intel dot com>
On Mon, Nov 28, 2005 at 07:53:12PM -0800, Zhang, Yanmin wrote:
>
> Mostly, jprobe handler has parameters. If the parameters are changed
> in the jprobe handler, should the original function use the changed
> values?
Good question.
> My answer is no. Because c compiler might change the parameter values
> even though we don't change them in c codes sometimes.
>
> What's your idea?
>
You are correct, gcc assumes that the callee owns the argument space and
could overwrite it. If you see the code in function setjmp_pre_handler()
(for i386 & x86_64), we are saving this area and restoring it back before
passing the control back to the probed(original) function.
For Ia64, I was under the assumption that this might not be the case, but
you proved it wrong. So for Ia64 also we need to implement the similar logic of
saving and restoring the register stack space.
Will open a bugzilla entry for this to track this bug.
Patch welcome.
Thanks,
-Anil Keshavamurthy