From 4f3991c14166f7bda2baedff85dd3859b668fb84 Mon Sep 17 00:00:00 2001 From: William Cohen Date: Wed, 25 Sep 2019 10:58:11 -0400 Subject: [PATCH] Revise inodewatch2.stp to work on a wider range of kernels and filesystems The inodewatch2.stp instrumented specific functions that actually changed the the mode of the inode. Depending on the file system used the orginally instrumented functions would miss chmod operations on some file systems. Moved the instrumentation to the common notify_change function that all the operations go through. --- testsuite/systemtap.examples/io/inodewatch2.stp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/testsuite/systemtap.examples/io/inodewatch2.stp b/testsuite/systemtap.examples/io/inodewatch2.stp index 0c5f810c4..0c549a900 100755 --- a/testsuite/systemtap.examples/io/inodewatch2.stp +++ b/testsuite/systemtap.examples/io/inodewatch2.stp @@ -2,11 +2,9 @@ global ATTR_MODE = 1 -probe kernel.{function("setattr_copy")!, - function("generic_setattr")!, - function("inode_setattr")} { - dev_nr = $inode->i_sb->s_dev - inode_nr = $inode->i_ino +probe kernel.function("notify_change") { + dev_nr = $dentry->d_inode->i_sb->s_dev + inode_nr = $dentry->d_inode->i_ino if (dev_nr == MKDEV($1,$2) # major/minor device && inode_nr == $3 -- 2.43.5