diff options
author | rwatson <rwatson@FreeBSD.org> | 2009-04-06 10:32:40 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2009-04-06 10:32:40 +0000 |
commit | f775cac2725ef7f9775e632a11f52710d749e0a3 (patch) | |
tree | ee419f94674f771c49119f892c3edaef45c45371 /sys/kern | |
parent | 75afcd06774489bf41511a140c131797f60eef87 (diff) | |
download | FreeBSD-src-f775cac2725ef7f9775e632a11f52710d749e0a3.zip FreeBSD-src-f775cac2725ef7f9775e632a11f52710d749e0a3.tar.gz |
Add SDT DTrace probes for namei():
vfs:namei:lookup:entry takes parent directory vnode pointer, path to
look up, and lookup flags.
vfs:namei:lookup:return takes an error value, and if successful, the
returned vnode pointer.
MFC after: 1 month
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/vfs_lookup.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c index 77c2e42..757e56e 100644 --- a/sys/kern/vfs_lookup.c +++ b/sys/kern/vfs_lookup.c @@ -37,6 +37,7 @@ #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); +#include "opt_kdtrace.h" #include "opt_ktrace.h" #include "opt_mac.h" @@ -51,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include <sys/mount.h> #include <sys/filedesc.h> #include <sys/proc.h> +#include <sys/sdt.h> #include <sys/syscallsubr.h> #include <sys/sysctl.h> #ifdef KTRACE @@ -65,6 +67,11 @@ __FBSDID("$FreeBSD$"); #define NAMEI_DIAGNOSTIC 1 #undef NAMEI_DIAGNOSTIC +SDT_PROVIDER_DECLARE(vfs); +SDT_PROBE_DEFINE3(vfs, namei, lookup, entry, "struct vnode *", "char *", + "unsigned long"); +SDT_PROBE_DEFINE2(vfs, namei, lookup, return, "int", "struct vnode *"); + /* * Allocation zone for namei */ @@ -181,7 +188,6 @@ namei(struct nameidata *ndp) ktrnamei(cnp->cn_pnbuf); } #endif - /* * Get starting point for the translation. */ @@ -224,6 +230,8 @@ namei(struct nameidata *ndp) VFS_UNLOCK_GIANT(vfslocked); } } + SDT_PROBE(vfs, namei, lookup, entry, dp, cnp->cn_pnbuf, + cnp->cn_flags, 0, 0); vfslocked = VFS_LOCK_GIANT(dp->v_mount); for (;;) { /* @@ -252,6 +260,8 @@ namei(struct nameidata *ndp) cnp->cn_pnbuf = NULL; cnp->cn_nameptr = NULL; #endif + SDT_PROBE(vfs, namei, lookup, return, error, NULL, 0, + 0, 0); return (error); } vfslocked = (ndp->ni_cnd.cn_flags & GIANTHELD) != 0; @@ -273,6 +283,8 @@ namei(struct nameidata *ndp) VFS_UNLOCK_GIANT(vfslocked); } else if (vfslocked) ndp->ni_cnd.cn_flags |= GIANTHELD; + SDT_PROBE(vfs, namei, lookup, return, 0, ndp->ni_vp, + 0, 0, 0); return (0); } if (ndp->ni_loopcnt++ >= MAXSYMLINKS) { @@ -338,6 +350,7 @@ namei(struct nameidata *ndp) ndp->ni_vp = NULL; vrele(ndp->ni_dvp); VFS_UNLOCK_GIANT(vfslocked); + SDT_PROBE(vfs, namei, lookup, return, error, NULL, 0, 0, 0); return (error); } |