This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: How to get write/read offset?


On 03/11/2016 04:05 AM, Olausson, Bjoern wrote:
> One more think I am curious about:
> 
> How can I get a full, non truncated list of all variables I can access
> in a tapset? Like traversing everything shown by $$parms$
> printf("%s\n", $$parms$)
> 
> like:
> printf("%s\n", $file->f_inode$)
> printf("%s\n", $file->f_inode->f_uid)
> 
> because of the string length limitation I can't figure out all vars
> stored in $file->f_inode$ for example
> 
> I am not very familiar with the syntax :-(

Off the top of my head, you've got a couple of choices:

1) Increase MAXSTRINGLEN, so you'll see more of $$params$ output. You do
it like this:

# stap -DMAXSTRINGLEN=2048 ...

2) Use stap to figure out the type name, then look up that type in the
kernel source. For instance:

# # stap -L 'kernel.function("vfs_read")'
kernel.function("vfs_read@fs/read_write.c:408") $file:struct file*
$buf:char* $count:size_t $pos:loff_t*

So, based on that, $file is a 'struct file' pointer. Grep'ing around the
kernel source will lead you to include/linux/fs.h, where 'struct file'
is defined.

-- 
David Smith
dsmith@redhat.com
Red Hat
http://www.redhat.com
256.217.0141 (direct)
256.837.0057 (fax)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]