2015-08-26 16 views
0

我使用probe syscall.open.return { } 看到SystemTap的例子脚本的I探头文件打开和关闭在VFS但也有一些应用程序不调用系统调用 所以,我怎么能探测打开文件在VFS如何使用SystemTap的

回答

2

如果您知道要探测VFS开放手术,这样做:

# stap -L 'kernel.function("vfs_*")' 
[...] 
kernel.function("[email protected]/open.c:862") $path:struct path const* $filp:struct file* $cred:struct cred const* 
[...] 

# stap -e 'probe kernel.function("vfs_open") { /* ... */ }' 

其中...可能包括印刷的环境变量,调用进程的标识,回溯,task_dentry_path(task_current(), $path->dentry, $path->mnt)