This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: How to get write/read offset?
- From: David Smith <dsmith at redhat dot com>
- To: "Olausson, Bjoern" <contactme at olausson dot de>
- Cc: systemtap at sourceware dot org
- Date: Fri, 11 Mar 2016 09:04:46 -0600
- Subject: Re: How to get write/read offset?
- Authentication-results: sourceware.org; auth=none
- References: <CAE7O3Tc5T8UfZgJegQ8H6mZ7r+fd+kSMtPUd9EmLvVS=S2ZyVQ at mail dot gmail dot com> <56E1C72B dot 1080402 at redhat dot com> <CAE7O3TcesOmUyt1ohGTu+7BwV2c+q43=wxYPbR0T44JPVeCN3w at mail dot gmail dot com>
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)