This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: [PATCH] filename in tapset nfs.proc.open and nfs.proc.release
- From: hai wu <haiwu dot us at gmail dot com>
- To: systemtap at sourceware dot org
- Date: Mon, 15 Dec 2014 13:11:44 -0600
- Subject: Re: [PATCH] filename in tapset nfs.proc.open and nfs.proc.release
- Authentication-results: sourceware.org; auth=none
- References: <CAJ1=nZcYtxopEs-XGj-Cs89dfzA2LF8oScnc_b+JE1zysg1T=Q at mail dot gmail dot com>
It turns out the above works fine in RHEL5.9 but not in RHEL6. In
RHEL6, the line needs to be changed to the following instead:
filename = task_dentry_path(task_current(), $filp->f_path->dentry,
$filp->f_path->mnt)
On Sat, Dec 13, 2014 at 10:35 PM, hai wu <haiwu.us@gmail.com> wrote:
> tapset nfs.proc.open and nfs.proc.release in nfs_proc.stp only records
> file's basename, which is not helpful when we use it to monitor NFS
> file access activities.
>
> The following patch would allow us to be able to see the full path for
> NFS file, along with its NFS mount information.
>
> diff --git a/tapset/linux/nfs_proc.stp b/tapset/linux/nfs_proc.stp
> index 1339aee..5a804e4 100644
> --- a/tapset/linux/nfs_proc.stp
> +++ b/tapset/linux/nfs_proc.stp
> @@ -1658,7 +1658,7 @@ probe nfs.proc.open = kernel.function("nfs_open") !,
> prot = get_prot_from_client(client)
> version = __nfs_version($inode)
>
> - filename = __file_filename($filp)
> + filename = task_dentry_path(task_current(), $filp->f_dentry, $filp->f_vfsmnt)
> flag = $filp->f_flags
> mode = $filp->f_mode
>
> @@ -1693,7 +1693,7 @@ probe nfs.proc.release = kernel.function("nfs_release") !,
> prot = get_prot_from_client(client)
> version = __nfs_version($inode)
>
> - filename = __file_filename($filp)
> + filename = task_dentry_path(task_current(), $filp->f_dentry, $filp->f_vfsmnt)
> flag = $filp->f_flags
> mode = $filp->f_mode