This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: accessing args from return probe
- From: Keshavamurthy Anil S <anil dot s dot keshavamurthy at intel dot com>
- To: Kevin Stafford <kevinrs at us dot ibm dot com>
- Cc: systemtap at sources dot redhat dot com
- Date: Wed, 21 Sep 2005 16:46:04 -0700
- Subject: Re: accessing args from return probe
- References: <4331DD78.6040205@us.ibm.com>
- Reply-to: Keshavamurthy Anil S <anil dot s dot keshavamurthy at intel dot com>
On Wed, Sep 21, 2005 at 03:23:52PM -0700, Kevin Stafford wrote:
> This is a problem that must be addressed as this type of behavior is
> prevalent in system calls.
>
> Here is a workaround using two probes and a global as a record keeper:
Keep in mind that the proposed workaround won;t work for recursive functions :-)
>
> global time_tloc_addr
>
> probe kernel.syscall.time = kernel.function("sys_time") {
> /* save the addr of the arg while I can */
> time_tloc_addr[pid()] = $tloc
The second call to the same function recursively will
overwrite first instance data.
> }
>
> probe kernel.syscall.time.return =
> kernel.function("sys_time").return {
> time = get_uint_ptr(time_tloc_addr[pid()]);
> retval = get_eax();
> }
>
Cheers,
Anil S Keshavamurthy