summaryrefslogtreecommitdiffstats
path: root/doc/tutorial/inode-watch.stp
diff options
context:
space:
mode:
authorWilliam Cohen <wcohen@redhat.com>2010-03-12 17:44:28 -0500
committerWilliam Cohen <wcohen@redhat.com>2010-03-12 17:44:28 -0500
commitf5afe1607cb8fdd84a8d3593aaeb0c191e7013a1 (patch)
tree69933ae39cef05d44120afa5abfa9089dbf0d0fc /doc/tutorial/inode-watch.stp
parent7024cad88e9f95cb6215510d7088cbc44ff70d9b (diff)
downloadsystemtap-steved-f5afe1607cb8fdd84a8d3593aaeb0c191e7013a1.tar.gz
systemtap-steved-f5afe1607cb8fdd84a8d3593aaeb0c191e7013a1.tar.xz
systemtap-steved-f5afe1607cb8fdd84a8d3593aaeb0c191e7013a1.zip
Use the @defined rather than kernel_v in the inode-watch.stp
Diffstat (limited to 'doc/tutorial/inode-watch.stp')
-rw-r--r--doc/tutorial/inode-watch.stp14
1 files changed, 7 insertions, 7 deletions
diff --git a/doc/tutorial/inode-watch.stp b/doc/tutorial/inode-watch.stp
index 2209f309..dd06c1fb 100644
--- a/doc/tutorial/inode-watch.stp
+++ b/doc/tutorial/inode-watch.stp
@@ -1,13 +1,13 @@
probe kernel.function ("vfs_write"),
kernel.function ("vfs_read")
{
-%( kernel_v >= "2.6.20" %?
- dev_nr = $file->f_path->dentry->d_inode->i_sb->s_dev
- inode_nr = $file->f_path->dentry->d_inode->i_ino
-%:
- dev_nr = $file->f_dentry->d_inode->i_sb->s_dev
- inode_nr = $file->f_dentry->d_inode->i_ino
-%)
+ if (@defined($file->f_path->dentry)) {
+ dev_nr = $file->f_path->dentry->d_inode->i_sb->s_dev
+ inode_nr = $file->f_path->dentry->d_inode->i_ino
+ } else {
+ dev_nr = $file->f_dentry->d_inode->i_sb->s_dev
+ inode_nr = $file->f_dentry->d_inode->i_ino
+ }
if (dev_nr == ($1 << 20 | $2) # major/minor device
&& inode_nr == $3)