access variables within functions
Ananth N Mavinakayanahalli
ananth@in.ibm.com
Mon Apr 14 12:45:00 GMT 2008
On Mon, Apr 14, 2008 at 01:30:48PM +0300, Rus-Rebreanu Alin-Florin wrote:
> Hi,
> I have a problem with accessing a variable using systemtap.
> Let's take for example vfs_read in fs/read_write.c:
> ssize_t vfs_read(file,buf,count,pos){
> ssize_t ret;
> ........more code.....
> return ret;
>
> }
>
> using stap i want to access "ret". Accessing the parameters of the
> function works just fine with "$var".
> I'm using:
> stap -vvv -e 'probe kernel.function("vfs_read@fs/read_write.c:270")
> {printf("%d",$ret)}'
> It doesn't work. Am I missing something?
Do you want $ret to capture the return value of the function or do you
want $ret as an intermediate return value (rw_verify_area() I presume).
If so, you could just do a
probe kernel.function("rw_verify_area").return
{
printf("%d\n", $return)
}
Ananth
More information about the Systemtap
mailing list