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: newbie question : how to access ptr->member.member->data?


Srikar Dronamraju wrote:
Hi Om,

Please do mention the kernel version when you are referring to a
problem. Because structures might have changed accordingly.
Yes. Now onwards I will.
operator -> solved it.
thanks,
Om.



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




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