Re: systemtap question..

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <kernelnewbies@...>
Date: Saturday, August 23, 2008 - 6:58 pm

Peter Teoh wrote:

I think my code snippet was wrong. Actually, it should be something like,
$ cat /space/stap/inode-watch.stp
# input device number and inode number, this prints out who accesses the 
file
#
  probe kernel.function ("vfs_read"), kernel.function("vfs_write")
{
        inode = $file->f_path->dentry->d_inode->i_ino
        dev_nr = $file->f_path->dentry->d_inode->i_sb->s_dev

        if(inode == $1 && (dev_nr == ($2 << 20 | $3))){
                printf("%s(%d) -> %s\n", execname(), pid(), probefunc())
        }
}

When I took out the f_dentry, (which is #defined in fs.h) and replaced 
it with f_path->dentry (in C, it would be f_path.dentry), it started 
working fine.

So, it may not be a bug with systemtap after all.
But if f_dentry is supposed to work, it would be a  bug. I don't know 
about this.

Thanks,
Om.

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@nl.linux.org
Please read the FAQ at http://kernelnewbies.org/FAQ
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
systemtap question.., Om Narasimhan, (Thu Aug 21, 1:24 am)
Re: systemtap question.., Peter Teoh, (Fri Aug 22, 11:46 pm)
Re: systemtap question.., Om Narasimhan, (Sat Aug 23, 6:58 pm)