This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: newbie question : how to access ptr->member.member->data?
- From: Srikar Dronamraju <srikar at linux dot vnet dot ibm dot com>
- To: Om Narasimhan <om dot turyx at gmail dot com>
- Cc: systemtap at sourceware dot org
- Date: Thu, 21 Aug 2008 12:36:54 +0530
- Subject: Re: newbie question : how to access ptr->member.member->data?
- References: <48AD0DE5.6080701@gmail.com>
- Reply-to: Srikar Dronamraju <srikar at linux dot vnet dot ibm dot com>
Hi Om,
Please do mention the kernel version when you are referring to a
problem. Because structures might have changed accordingly.
> Hi,
> Trying out systemtap. Running into this problem.
>
> --script begin--
> [om@testserv ~]$ cat /space/stap/inode-watch.stp
> # Usage:
> # taps the vfs_write and vfs_read
> #
>
> probe kernel.function ("vfs_read"), kernel.function("vfs_write")
> {
> inode = $file->f_dentry->d_inode->i_ino
> dev_nr = $file->f_dentry->d_inode->i_sb->s_dev
>
> }
> -- script end--
>
> I know why the error occur.
> From include/linux/fs.h,
> #define f_dentry f_path.dentry
>
> Apparently f_dentry cannot be used from systemtap.
> If I replace f_dentry with fpath.dentry, systemtap complains about string
> operations because `.` is string concatenation operator.
>
> Any idea? Any pointers?
Try f_path->dentry.
"." in stap language is a concatenation operator.
--
Thanks and Regards
Srikar