diff options
author | avg <avg@FreeBSD.org> | 2015-09-28 12:14:16 +0000 |
---|---|---|
committer | avg <avg@FreeBSD.org> | 2015-09-28 12:14:16 +0000 |
commit | 425c0bb0881d8c41e5d8292de87c15b38472045c (patch) | |
tree | 7cbb4c63806f8c7246034b6254eee513f36ea37e /sys/kern/vfs_cache.c | |
parent | 0f2211c30ded7871b441bfaa1647843f1b4fd0c2 (diff) | |
download | FreeBSD-src-425c0bb0881d8c41e5d8292de87c15b38472045c.zip FreeBSD-src-425c0bb0881d8c41e5d8292de87c15b38472045c.tar.gz |
save some bytes by using more concise SDT_PROBE<n> instead of SDT_PROBE
SDT_PROBE requires 5 parameters whereas SDT_PROBE<n> requires n parameters
where n is typically smaller than 5.
Perhaps SDT_PROBE should be made a private implementation detail.
MFC after: 20 days
Diffstat (limited to 'sys/kern/vfs_cache.c')
-rw-r--r-- | sys/kern/vfs_cache.c | 85 |
1 files changed, 40 insertions, 45 deletions
diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index 5fe0382..ca9f054 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -419,11 +419,11 @@ cache_zap(ncp) CTR2(KTR_VFS, "cache_zap(%p) vp %p", ncp, ncp->nc_vp); #ifdef KDTRACE_HOOKS if (ncp->nc_vp != NULL) { - SDT_PROBE(vfs, namecache, zap, done, ncp->nc_dvp, - nc_get_name(ncp), ncp->nc_vp, 0, 0); + SDT_PROBE3(vfs, namecache, zap, done, ncp->nc_dvp, + nc_get_name(ncp), ncp->nc_vp); } else { - SDT_PROBE(vfs, namecache, zap_negative, done, ncp->nc_dvp, - nc_get_name(ncp), 0, 0, 0); + SDT_PROBE2(vfs, namecache, zap_negative, done, ncp->nc_dvp, + nc_get_name(ncp)); } #endif vp = NULL; @@ -498,8 +498,7 @@ retry_wlocked: CTR2(KTR_VFS, "cache_lookup(%p, %s) found via .", dvp, cnp->cn_nameptr); dothits++; - SDT_PROBE(vfs, namecache, lookup, hit, dvp, ".", - *vpp, 0, 0); + SDT_PROBE3(vfs, namecache, lookup, hit, dvp, ".", *vpp); if (tsp != NULL) timespecclear(tsp); if (ticksp != NULL) @@ -509,8 +508,8 @@ retry_wlocked: if (cnp->cn_namelen == 2 && cnp->cn_nameptr[1] == '.') { dotdothits++; if (dvp->v_cache_dd == NULL) { - SDT_PROBE(vfs, namecache, lookup, miss, dvp, - "..", NULL, 0, 0); + SDT_PROBE3(vfs, namecache, lookup, miss, dvp, + "..", NULL); goto unlock; } if ((cnp->cn_flags & MAKEENTRY) == 0) { @@ -532,8 +531,8 @@ retry_wlocked: goto negative_success; CTR3(KTR_VFS, "cache_lookup(%p, %s) found %p via ..", dvp, cnp->cn_nameptr, *vpp); - SDT_PROBE(vfs, namecache, lookup, hit, dvp, "..", - *vpp, 0, 0); + SDT_PROBE3(vfs, namecache, lookup, hit, dvp, "..", + *vpp); cache_out_ts(ncp, tsp, ticksp); if ((ncp->nc_flag & (NCF_ISDOTDOT | NCF_DTS)) == NCF_DTS && tsp != NULL) @@ -554,8 +553,8 @@ retry_wlocked: /* We failed to find an entry */ if (ncp == NULL) { - SDT_PROBE(vfs, namecache, lookup, miss, dvp, cnp->cn_nameptr, - NULL, 0, 0); + SDT_PROBE3(vfs, namecache, lookup, miss, dvp, cnp->cn_nameptr, + NULL); if ((cnp->cn_flags & MAKEENTRY) == 0) { nummisszap++; } else { @@ -583,8 +582,8 @@ retry_wlocked: *vpp = ncp->nc_vp; CTR4(KTR_VFS, "cache_lookup(%p, %s) found %p via ncp %p", dvp, cnp->cn_nameptr, *vpp, ncp); - SDT_PROBE(vfs, namecache, lookup, hit, dvp, nc_get_name(ncp), - *vpp, 0, 0); + SDT_PROBE3(vfs, namecache, lookup, hit, dvp, nc_get_name(ncp), + *vpp); cache_out_ts(ncp, tsp, ticksp); goto success; } @@ -615,8 +614,8 @@ negative_success: nchstats.ncs_neghits++; if (ncp->nc_flag & NCF_WHITE) cnp->cn_flags |= ISWHITEOUT; - SDT_PROBE(vfs, namecache, lookup, hit__negative, dvp, nc_get_name(ncp), - 0, 0, 0); + SDT_PROBE2(vfs, namecache, lookup, hit__negative, dvp, + nc_get_name(ncp)); cache_out_ts(ncp, tsp, ticksp); CACHE_WUNLOCK(); return (ENOENT); @@ -769,8 +768,7 @@ cache_enter_time(dvp, vp, cnp, tsp, dtsp) return; } dvp->v_cache_dd = NULL; - SDT_PROBE(vfs, namecache, enter, done, dvp, "..", vp, - 0, 0); + SDT_PROBE3(vfs, namecache, enter, done, dvp, "..", vp); CACHE_WUNLOCK(); flag = NCF_ISDOTDOT; } @@ -890,12 +888,12 @@ cache_enter_time(dvp, vp, cnp, tsp, dtsp) */ if (vp) { TAILQ_INSERT_HEAD(&vp->v_cache_dst, ncp, nc_dst); - SDT_PROBE(vfs, namecache, enter, done, dvp, nc_get_name(ncp), - vp, 0, 0); + SDT_PROBE3(vfs, namecache, enter, done, dvp, nc_get_name(ncp), + vp); } else { TAILQ_INSERT_TAIL(&ncneg, ncp, nc_dst); - SDT_PROBE(vfs, namecache, enter_negative, done, dvp, - nc_get_name(ncp), 0, 0, 0); + SDT_PROBE2(vfs, namecache, enter_negative, done, dvp, + nc_get_name(ncp)); } if (numneg * ncnegfactor > numcache) { ncp = TAILQ_FIRST(&ncneg); @@ -984,7 +982,7 @@ cache_purge(vp) { CTR1(KTR_VFS, "cache_purge(%p)", vp); - SDT_PROBE(vfs, namecache, purge, done, vp, 0, 0, 0, 0); + SDT_PROBE1(vfs, namecache, purge, done, vp); CACHE_WLOCK(); while (!LIST_EMPTY(&vp->v_cache_src)) cache_zap(LIST_FIRST(&vp->v_cache_src)); @@ -1009,7 +1007,7 @@ cache_purge_negative(vp) struct namecache *cp, *ncp; CTR1(KTR_VFS, "cache_purge_negative(%p)", vp); - SDT_PROBE(vfs, namecache, purge_negative, done, vp, 0, 0, 0, 0); + SDT_PROBE1(vfs, namecache, purge_negative, done, vp); CACHE_WLOCK(); LIST_FOREACH_SAFE(cp, &vp->v_cache_src, nc_src, ncp) { if (cp->nc_vp == NULL) @@ -1029,7 +1027,7 @@ cache_purgevfs(mp) struct namecache *ncp, *nnp; /* Scan hash tables for applicable entries */ - SDT_PROBE(vfs, namecache, purgevfs, done, mp, 0, 0, 0, 0); + SDT_PROBE1(vfs, namecache, purgevfs, done, mp); CACHE_WLOCK(); for (ncpp = &nchashtbl[nchash]; ncpp >= nchashtbl; ncpp--) { LIST_FOREACH_SAFE(ncp, ncpp, nc_hash, nnp) { @@ -1253,14 +1251,14 @@ vn_vptocnp_locked(struct vnode **vp, struct ucred *cred, char *buf, vrele(*vp); numfullpathfail4++; error = ENOMEM; - SDT_PROBE(vfs, namecache, fullpath, return, error, - vp, NULL, 0, 0); + SDT_PROBE3(vfs, namecache, fullpath, return, error, + vp, NULL); return (error); } *buflen -= ncp->nc_nlen; memcpy(buf + *buflen, nc_get_name(ncp), ncp->nc_nlen); - SDT_PROBE(vfs, namecache, fullpath, hit, ncp->nc_dvp, - nc_get_name(ncp), vp, 0, 0); + SDT_PROBE3(vfs, namecache, fullpath, hit, ncp->nc_dvp, + nc_get_name(ncp), vp); dvp = *vp; *vp = ncp->nc_dvp; vref(*vp); @@ -1269,7 +1267,7 @@ vn_vptocnp_locked(struct vnode **vp, struct ucred *cred, char *buf, CACHE_RLOCK(); return (0); } - SDT_PROBE(vfs, namecache, fullpath, miss, vp, 0, 0, 0, 0); + SDT_PROBE1(vfs, namecache, fullpath, miss, vp); CACHE_RUNLOCK(); vn_lock(*vp, LK_SHARED | LK_RETRY); @@ -1277,8 +1275,7 @@ vn_vptocnp_locked(struct vnode **vp, struct ucred *cred, char *buf, vput(*vp); if (error) { numfullpathfail2++; - SDT_PROBE(vfs, namecache, fullpath, return, error, vp, - NULL, 0, 0); + SDT_PROBE3(vfs, namecache, fullpath, return, error, vp, NULL); return (error); } @@ -1289,8 +1286,7 @@ vn_vptocnp_locked(struct vnode **vp, struct ucred *cred, char *buf, CACHE_RUNLOCK(); vrele(dvp); error = ENOENT; - SDT_PROBE(vfs, namecache, fullpath, return, error, vp, - NULL, 0, 0); + SDT_PROBE3(vfs, namecache, fullpath, return, error, vp, NULL); return (error); } /* @@ -1318,7 +1314,7 @@ vn_fullpath1(struct thread *td, struct vnode *vp, struct vnode *rdir, error = 0; slash_prefixed = 0; - SDT_PROBE(vfs, namecache, fullpath, entry, vp, 0, 0, 0, 0); + SDT_PROBE1(vfs, namecache, fullpath, entry, vp); numfullpathcalls++; vref(vp); CACHE_RLOCK(); @@ -1340,8 +1336,8 @@ vn_fullpath1(struct thread *td, struct vnode *vp, struct vnode *rdir, CACHE_RUNLOCK(); vrele(vp); error = ENOENT; - SDT_PROBE(vfs, namecache, fullpath, return, - error, vp, NULL, 0, 0); + SDT_PROBE3(vfs, namecache, fullpath, return, + error, vp, NULL); break; } vp1 = vp->v_mount->mnt_vnodecovered; @@ -1357,8 +1353,8 @@ vn_fullpath1(struct thread *td, struct vnode *vp, struct vnode *rdir, vrele(vp); numfullpathfail1++; error = ENOTDIR; - SDT_PROBE(vfs, namecache, fullpath, return, - error, vp, NULL, 0, 0); + SDT_PROBE3(vfs, namecache, fullpath, return, + error, vp, NULL); break; } error = vn_vptocnp_locked(&vp, td->td_ucred, buf, &buflen); @@ -1368,8 +1364,8 @@ vn_fullpath1(struct thread *td, struct vnode *vp, struct vnode *rdir, CACHE_RUNLOCK(); vrele(vp); error = ENOMEM; - SDT_PROBE(vfs, namecache, fullpath, return, error, - startvp, NULL, 0, 0); + SDT_PROBE3(vfs, namecache, fullpath, return, error, + startvp, NULL); break; } buf[--buflen] = '/'; @@ -1382,8 +1378,8 @@ vn_fullpath1(struct thread *td, struct vnode *vp, struct vnode *rdir, CACHE_RUNLOCK(); vrele(vp); numfullpathfail4++; - SDT_PROBE(vfs, namecache, fullpath, return, ENOMEM, - startvp, NULL, 0, 0); + SDT_PROBE3(vfs, namecache, fullpath, return, ENOMEM, + startvp, NULL); return (ENOMEM); } buf[--buflen] = '/'; @@ -1392,8 +1388,7 @@ vn_fullpath1(struct thread *td, struct vnode *vp, struct vnode *rdir, CACHE_RUNLOCK(); vrele(vp); - SDT_PROBE(vfs, namecache, fullpath, return, 0, startvp, buf + buflen, - 0, 0); + SDT_PROBE3(vfs, namecache, fullpath, return, 0, startvp, buf + buflen); *retbuf = buf + buflen; return (0); } |