This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: access variables within functions
- From: Srikar Dronamraju <srikar at linux dot vnet dot ibm dot com>
- To: "Rus-Rebreanu Alin-Florin" <netblock at gmail dot com>
- Cc: systemtap at sourceware dot org
- Date: Mon, 14 Apr 2008 16:21:26 +0530
- Subject: Re: access variables within functions
- References: <88ac2f010804140330y21ab3f2crdeaed08a55b66f7@mail.gmail.com>
- Reply-to: Srikar Dronamraju <srikar at linux dot vnet dot ibm dot com>
* Rus-Rebreanu Alin-Florin <netblock@gmail.com> [2008-04-14 13:30:48]:
> 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?
>
I guess you get an output of all zeros. (If not please let us know the
output you are seeing. )
When using kernel.function() the probe will be place at the start of the
function definition. If you want to place a probe at a particular
statement in code, please use kernel.statement instead.
-Srikar