nfsd: observability improvements
Subsystems (3)
Jeff Layton
maintainerv3 cover nfsd: observability improvements
Sorry these took a while! This version moves the new tracepoints closer to the vfs layer, into the non-version specific common vfs helpers.
I've also made separate patches that remove the dprintks. Since the new tracepoints aren't in the same places as the old dprintk's, there could be an argument for keeping them. I'm fine with either.
---
Changes in v3:
- move most of the tracepoints into non-version specific nfsd/vfs.c calls
- rename them with a nfsd_vfs_* prefix
- remove the dprintks in separate patches
- Link to v2: https://lore.kernel.org/r/[email protected]
Changes in v2:
- Break tracepoints out into multiple patches
- Flesh out the tracepoints in these locations to display the same info
as legacy dprintks.
- have all the tracepoints SVC_XPRT_ENDPOINT_* info
- update svc_xprt_dequeue tracepoint to show how long xprt was on queue
- Link to v1: https://lore.kernel.org/r/[email protected]
---
Jeff Layton (17):
sunrpc: move the SVC_RQST_EVENT_*() macros to common header
nfsd: add a tracepoint for nfsd_setattr
nfsd: add a tracepoint to nfsd_lookup_dentry
nfsd: add nfsd_vfs_create tracepoints
nfsd: add tracepoint to nfsd_symlink
nfsd: add tracepoint to nfsd_link()
nfsd: add tracepoints for unlink events
nfsd: add tracepoint to nfsd_rename
nfsd: add tracepoint to nfsd_readdir
nfsd: add tracepoint for getattr and statfs events
nfsd: remove old v2/3 create path dprintks
nfsd: remove old v2/3 SYMLINK dprintks
nfsd: remove old LINK dprintks
nfsd: remove REMOVE/RMDIR dprintks
nfsd: remove dprintks for v2/3 RENAME events
nfsd: remove legacy READDIR dprintks
nfsd: remove legacy dprintks from GETATTR and STATFS codepaths
fs/nfsd/nfs3proc.c | 63 +----------- fs/nfsd/nfs4proc.c | 2 + fs/nfsd/nfsproc.c | 35 +------ fs/nfsd/trace.h | 218 ++++++++++++++++++++++++++++++++++++++++++ fs/nfsd/vfs.c | 18 +++- include/trace/events/sunrpc.h | 23 ----- include/trace/misc/fs.h | 21 ++++ include/trace/misc/sunrpc.h | 23 +++++ 8 files changed, 287 insertions(+), 116 deletions(-)
---
base-commit: d417fc0a03710ea5ed4c50d8eff3cf29cd86c87f
change-id: 20250303-nfsd-tracepoints-c82add9155a6
Best regards,
Signature · 1 line
Jeff Layton <[email protected]>
Jeff Layton
maintainerPATCH v3 1/17 sunrpc: move the SVC_RQST_EVENT_*() macros to common header
We need this for some of the nfsd tracepoints, so move them to the common misc/sunrpc.h infrastructure.
--- include/trace/events/sunrpc.h | 23 ----------------------- include/trace/misc/sunrpc.h | 23 +++++++++++++++++++++++ 2 files changed, 23 insertions(+), 23 deletions(-)
include/trace/events/sunrpc.h +0 -23
@@ -1716,29 +1716,6 @@ TRACE_DEFINE_ENUM(SVC_COMPLETE); { SVC_PENDING, "SVC_PENDING" }, \ { SVC_COMPLETE, "SVC_COMPLETE" }) -#define SVC_RQST_ENDPOINT_FIELDS (r) \ - __sockaddr(server, (r)->rq_xprt->xpt_locallen) \ - __sockaddr(client, (r)->rq_xprt->xpt_remotelen) \ - __field(unsigned int, netns_ino) \ - __field(u32, xid) - -#define SVC_RQST_ENDPOINT_ASSIGNMENTS (r) \ - do { \ - struct svc_xprt *xprt = (r)->rq_xprt; \ - __assign_sockaddr(server, &xprt->xpt_local, \ - xprt->xpt_locallen); \ - __assign_sockaddr(client, &xprt->xpt_remote, \ - xprt->xpt_remotelen); \ - __entry->netns_ino = xprt->xpt_net->ns.inum; \ - __entry->xid = be32_to_cpu((r)->rq_xid); \ - } while (0) - -#define SVC_RQST_ENDPOINT_FORMAT \ - "xid=0x%08x server=%pISpc client=%pISpc" - -#define SVC_RQST_ENDPOINT_VARARGS \ - __entry->xid, __get_sockaddr(server), __get_sockaddr(client) - TRACE_EVENT_CONDITION(svc_authenticate, TP_PROTO( const struct svc_rqst *rqst,
include/trace/misc/sunrpc.h +23 -0
@@ -15,4 +15,27 @@#define SUNRPC_TRACE_TASK_SPECIFIER \ "task:" SUNRPC_TRACE_PID_SPECIFIER "@" SUNRPC_TRACE_CLID_SPECIFIER +#define SVC_RQST_ENDPOINT_FIELDS (r) \ + __sockaddr(server, (r)->rq_xprt->xpt_locallen) \ + __sockaddr(client, (r)->rq_xprt->xpt_remotelen) \ + __field(unsigned int, netns_ino) \ + __field(u32, xid) + +#define SVC_RQST_ENDPOINT_ASSIGNMENTS (r) \ + do { \ + struct svc_xprt *xprt = (r)->rq_xprt; \ + __assign_sockaddr(server, &xprt->xpt_local, \ + xprt->xpt_locallen); \ + __assign_sockaddr(client, &xprt->xpt_remote, \ + xprt->xpt_remotelen); \ + __entry->netns_ino = xprt->xpt_net->ns.inum; \ + __entry->xid = be32_to_cpu((r)->rq_xid); \ + } while (0) + +#define SVC_RQST_ENDPOINT_FORMAT \ + "xid=0x%08x server=%pISpc client=%pISpc" + +#define SVC_RQST_ENDPOINT_VARARGS \ + __entry->xid, __get_sockaddr(server), __get_sockaddr(client) +#endif /* _TRACE_SUNRPC_BASE_H */
Signature · 1 line
2.49.0
Jeff Layton
maintainerPATCH v3 2/17 nfsd: add a tracepoint for nfsd_setattr
In reply to Jeff LaytonTurn Sargun's internal kprobe based implementation of this into a normal static tracepoint. Also, remove the dprintk's that got added recently with the fix for zero-length ACLs.
--- fs/nfsd/trace.h | 35 +++++++++++++++++++++++++++++++++++ fs/nfsd/vfs.c | 2 ++ include/trace/misc/fs.h | 21 +++++++++++++++++++++ 3 files changed, 58 insertions(+)
fs/nfsd/trace.h +35 -0
@@ -11,6 +11,7 @@#include <linux/tracepoint.h> #include <linux/sunrpc/clnt.h> #include <linux/sunrpc/xprt.h> +#include <trace/misc/fs.h> #include <trace/misc/nfs.h> #include <trace/misc/sunrpc.h>
@@ -2337,6 +2338,40 @@ DEFINE_EVENT(nfsd_copy_async_done_class, \DEFINE_COPY_ASYNC_DONE_EVENT (done);DEFINE_COPY_ASYNC_DONE_EVENT (cancel); +TRACE_EVENT (nfsd_setattr, + TP_PROTO(const struct svc_rqst *rqstp, const struct svc_fh *fhp, + const struct iattr *iap, const struct timespec64 *guardtime), +TP_ARGS (rqstp, fhp, iap, guardtime), +TP_STRUCT__entry ( + SVC_RQST_ENDPOINT_FIELDS(rqstp) + __field(u32, fh_hash) + __field(s64, gtime_tv_sec) + __field(u32, gtime_tv_nsec) + __field(unsigned int, ia_valid) + __field(loff_t, ia_size) + __field(uid_t, ia_uid) + __field(gid_t, ia_gid) +__field (umode_t, ia_mode) + ), + TP_fast_assign(__entry->xid = be32_to_cpu(rqstp->rq_xid); + SVC_RQST_ENDPOINT_ASSIGNMENTS(rqstp); + __entry->fh_hash = knfsd_fh_hash(&fhp->fh_handle); + __entry->gtime_tv_sec = guardtime ? guardtime->tv_sec : 0; + __entry->gtime_tv_nsec = guardtime ? guardtime->tv_nsec : 0; + __entry->ia_valid = iap->ia_valid; + __entry->ia_size = iap->ia_size; + __entry->ia_uid = __kuid_val(iap->ia_uid); + __entry->ia_gid = __kgid_val(iap->ia_gid); + __entry->ia_mode = iap->ia_mode; + ), +TP_printk ( +"xid=0x%08x fh_hash=0x%08x ia_valid=%s ia_size=%llu ia_mode=0%o ia_uid=%u ia_gid=%u guard_time=%lld.%u" , + __entry->xid, __entry->fh_hash,show_ia_valid_flags (__entry->ia_valid), + __entry->ia_size, __entry->ia_mode, __entry->ia_uid, __entry->ia_gid, + __entry->gtime_tv_sec, __entry->gtime_tv_nsec + ) +) +#endif /* _NFSD_TRACE_H */ #undef TRACE_INCLUDE_PATH
fs/nfsd/vfs.c +2 -0
@@ -502,6 +502,8 @@ nfsd_setattr(struct svc_rqst *rqstp, struct svc_fh *fhp,int retries;dprintk ("nfsd_setattr pacl=%p valid=0x%x\n" , attr->na_pacl, iap->ia_valid); +trace_nfsd_setattr (rqstp, fhp, iap, guardtime); +if (iap->ia_valid &ATTR_SIZE ) { accmode |=NFSD_MAY_WRITE |NFSD_MAY_OWNER_OVERRIDE ; ftype =S_IFREG ;
include/trace/misc/fs.h +21 -0
@@ -120,3 +120,24 @@ { LOOKUP_BENEATH, "BENEATH" }, \ { LOOKUP_IN_ROOT, "IN_ROOT" }, \ { LOOKUP_CACHED, "CACHED" }) + +#define show_ia_valid_flags (flags) \ + __print_flags(flags, "|", \ + { ATTR_MODE, "MODE" }, \ + { ATTR_UID, "UID" }, \ + { ATTR_GID, "GID" }, \ + { ATTR_SIZE, "SIZE" }, \ + { ATTR_ATIME, "ATIME" }, \ + { ATTR_MTIME, "MTIME" }, \ + { ATTR_CTIME, "CTIME" }, \ + { ATTR_ATIME_SET, "ATIME_SET" }, \ + { ATTR_MTIME_SET, "MTIME_SET" }, \ + { ATTR_FORCE, "FORCE" }, \ + { ATTR_KILL_SUID, "KILL_SUID" }, \ + { ATTR_KILL_SGID, "KILL_SGID" }, \ + { ATTR_FILE, "FILE" }, \ + { ATTR_KILL_PRIV, "KILL_PRIV" }, \ + { ATTR_OPEN, "OPEN" }, \ + { ATTR_TIMES_SET, "TIMES_SET" }, \ + { ATTR_TOUCH, "TOUCH"}, \ + { ATTR_DELEG, "DELEG"})
Signature · 1 line
2.49.0
Jeff Layton
maintainerPATCH v3 3/17 nfsd: add a tracepoint to nfsd_lookup_dentry
In reply to Jeff Layton...and drop the dprintk.
--- fs/nfsd/trace.h | 19 +++++++++++++++++++ fs/nfsd/vfs.c | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-)
fs/nfsd/trace.h +19 -0
@@ -2372,6 +2372,25 @@ TRACE_EVENT(nfsd_setattr, ) ) +TRACE_EVENT (nfsd_lookup_dentry, + TP_PROTO(struct svc_rqst *rqstp, + struct svc_fh *fhp, + const char *name, + unsigned int len), +TP_ARGS (rqstp, fhp, name, len), +TP_STRUCT__entry ( + SVC_RQST_ENDPOINT_FIELDS(rqstp) + __field(u32, fh_hash) +__string_len (name, name, len) + ), +TP_fast_assign ( + SVC_RQST_ENDPOINT_ASSIGNMENTS(rqstp); + __entry->fh_hash = knfsd_fh_hash(&fhp->fh_handle); + __assign_str(name); + ), +TP_printk ("xid=0x%08x fh_hash=0x%08x name=%s" , + __entry->xid, __entry->fh_hash,__get_str (name)) +);#endif /* _NFSD_TRACE_H */ #undef TRACE_INCLUDE_PATH
fs/nfsd/vfs.c +1 -1
@@ -246,7 +246,7 @@ nfsd_lookup_dentry(struct svc_rqst *rqstp, struct svc_fh *fhp,struct dentry *dentry;int host_err; -dprintk ("nfsd: nfsd_lookup(fh %s, %.*s)\n" ,SVCFH_fmt (fhp), len,name); +trace_nfsd_lookup_dentry (rqstp, fhp, name, len); dparent = fhp->fh_dentry; exp =exp_get (fhp->fh_export);
Signature · 1 line
2.49.0
Jeff Layton
maintainerPATCH v3 4/17 nfsd: add nfsd_vfs_create tracepoints
In reply to Jeff Layton--- fs/nfsd/nfs3proc.c | 3 +++ fs/nfsd/trace.h | 25 +++++++++++++++++++++++++ fs/nfsd/vfs.c | 2 ++ 3 files changed, 30 insertions(+)
fs/nfsd/nfs3proc.c +3 -0
@@ -14,6 +14,7 @@#include "xdr3.h" #include "vfs.h" #include "filecache.h" +#include "trace.h" #define NFSDDBG_FACILITY NFSDDBG_PROC
@@ -266,6 +267,8 @@ nfsd3_create_file(struct svc_rqst *rqstp, struct svc_fh *fhp,__be32 status;int host_err; +trace_nfsd_vfs_create (rqstp, fhp,S_IFREG , argp->name, argp->len); +if (isdotent (argp->name, argp->len))return nfserr_exist;if (!(iap->ia_valid &ATTR_MODE ))
fs/nfsd/trace.h +25 -0
@@ -2391,6 +2391,31 @@ TRACE_EVENT(nfsd_lookup_dentry,TP_printk ("xid=0x%08x fh_hash=0x%08x name=%s" , __entry->xid, __entry->fh_hash,__get_str (name)) ); + +TRACE_EVENT (nfsd_vfs_create, + TP_PROTO(struct svc_rqst *rqstp, + struct svc_fh *fhp, + umode_t type, + const char *name, + unsigned int len), +TP_ARGS (rqstp, fhp, type, name, len), +TP_STRUCT__entry ( + SVC_RQST_ENDPOINT_FIELDS(rqstp) + __field(u32, fh_hash) + __field(umode_t, type) +__string_len (name, name, len) + ), +TP_fast_assign ( + SVC_RQST_ENDPOINT_ASSIGNMENTS(rqstp); + __entry->fh_hash = knfsd_fh_hash(&fhp->fh_handle); + __entry->type = type; + __assign_str(name); + ), +TP_printk ("xid=0x%08x fh_hash=0x%08x type=%s name=%s" , + __entry->xid, __entry->fh_hash, +show_fs_file_type (__entry->type),__get_str (name)) +); +#endif /* _NFSD_TRACE_H */ #undef TRACE_INCLUDE_PATH
fs/nfsd/vfs.c +2 -0
@@ -1574,6 +1574,8 @@ nfsd_create(struct svc_rqst *rqstp, struct svc_fh *fhp,__be32 err;int host_err; +trace_nfsd_vfs_create (rqstp, fhp, type, fname, flen); +if (isdotent (fname, flen))return nfserr_exist;
Signature · 1 line
2.49.0
Jeff Layton
maintainerPATCH v3 5/17 nfsd: add tracepoint to nfsd_symlink
In reply to Jeff Layton--- fs/nfsd/trace.h | 23 +++++++++++++++++++++++ fs/nfsd/vfs.c | 2 ++ 2 files changed, 25 insertions(+)
fs/nfsd/trace.h +23 -0
@@ -2416,6 +2416,29 @@ TRACE_EVENT(nfsd_vfs_create, show_fs_file_type(__entry->type), __get_str(name)) ); +TRACE_EVENT (nfsd_vfs_symlink, + TP_PROTO(struct svc_rqst *rqstp, + struct svc_fh *fhp, + const char *name, + unsigned int namelen, + const char *tgt), +TP_ARGS (rqstp, fhp, name, namelen, tgt), +TP_STRUCT__entry ( + SVC_RQST_ENDPOINT_FIELDS(rqstp) + __field(u32, fh_hash) + __string_len(name, name, namelen) +__string (tgt, tgt) + ), +TP_fast_assign ( + SVC_RQST_ENDPOINT_ASSIGNMENTS(rqstp); + __entry->fh_hash = knfsd_fh_hash(&fhp->fh_handle); + __assign_str(name); + __assign_str(tgt); + ), +TP_printk ("xid=0x%08x fh_hash=0x%08x name=%s target=%s" , + __entry->xid, __entry->fh_hash, +__get_str (name),__get_str (tgt)) +);#endif /* _NFSD_TRACE_H */ #undef TRACE_INCLUDE_PATH
fs/nfsd/vfs.c +2 -0
@@ -1676,6 +1676,8 @@ nfsd_symlink(struct svc_rqst *rqstp, struct svc_fh *fhp,__be32 err, cerr;int host_err; +trace_nfsd_vfs_symlink (rqstp, fhp, fname, flen, path); + err = nfserr_noent;if (!flen || path[0 ] =='\0' ) goto out;
Signature · 1 line
2.49.0
Jeff Layton
maintainerPATCH v3 6/17 nfsd: add tracepoint to nfsd_link()
In reply to Jeff Layton--- fs/nfsd/trace.h | 24 ++++++++++++++++++++++++ fs/nfsd/vfs.c | 2 ++ 2 files changed, 26 insertions(+)
fs/nfsd/trace.h +24 -0
@@ -2439,6 +2439,30 @@ TRACE_EVENT(nfsd_vfs_symlink, __entry->xid, __entry->fh_hash, __get_str(name), __get_str(tgt)) ); + +TRACE_EVENT (nfsd_vfs_link, + TP_PROTO(struct svc_rqst *rqstp, + struct svc_fh *sfhp, + struct svc_fh *tfhp, + const char *name, + unsigned int namelen), +TP_ARGS (rqstp, sfhp, tfhp, name, namelen), +TP_STRUCT__entry ( + SVC_RQST_ENDPOINT_FIELDS(rqstp) + __field(u32, sfh_hash) + __field(u32, tfh_hash) +__string_len (name, name, namelen) + ), +TP_fast_assign ( + SVC_RQST_ENDPOINT_ASSIGNMENTS(rqstp); + __entry->sfh_hash = knfsd_fh_hash(&sfhp->fh_handle); + __entry->tfh_hash = knfsd_fh_hash(&tfhp->fh_handle); + __assign_str(name); + ), +TP_printk ("xid=0x%08x src_fh=0x%08x tgt_fh=0x%08x name=%s" , + __entry->xid, __entry->sfh_hash, __entry->tfh_hash, +__get_str (name)) +);#endif /* _NFSD_TRACE_H */ #undef TRACE_INCLUDE_PATH
fs/nfsd/vfs.c +2 -0
@@ -1746,6 +1746,8 @@ nfsd_link(struct svc_rqst *rqstp, struct svc_fh *ffhp,__be32 err;int host_err; +trace_nfsd_vfs_link (rqstp, ffhp, tfhp, name, len); + err =fh_verify (rqstp, ffhp,S_IFDIR ,NFSD_MAY_CREATE );if (err) goto out;
Signature · 1 line
2.49.0
Jeff Layton
maintainerPATCH v3 7/17 nfsd: add tracepoints for unlink events
In reply to Jeff Layton--- fs/nfsd/trace.h | 21 +++++++++++++++++++++ fs/nfsd/vfs.c | 2 ++ 2 files changed, 23 insertions(+)
fs/nfsd/trace.h +21 -0
@@ -2463,6 +2463,27 @@ TRACE_EVENT(nfsd_vfs_link, __entry->xid, __entry->sfh_hash, __entry->tfh_hash, __get_str(name)) ); + +TRACE_EVENT (nfsd_vfs_unlink, + TP_PROTO(struct svc_rqst *rqstp, + struct svc_fh *fhp, + const char *name, + unsigned int len), +TP_ARGS (rqstp, fhp, name, len), +TP_STRUCT__entry ( + SVC_RQST_ENDPOINT_FIELDS(rqstp) + __field(u32, fh_hash) +__string_len (name, name, len) + ), +TP_fast_assign ( + SVC_RQST_ENDPOINT_ASSIGNMENTS(rqstp); + __entry->fh_hash = knfsd_fh_hash(&fhp->fh_handle); + __assign_str(name); + ), +TP_printk ("xid=0x%08x fh_hash=0x%08x name=%s" , + __entry->xid, __entry->fh_hash, +__get_str (name)) +);#endif /* _NFSD_TRACE_H */ #undef TRACE_INCLUDE_PATH
fs/nfsd/vfs.c +2 -0
@@ -2023,6 +2023,8 @@ nfsd_unlink(struct svc_rqst *rqstp, struct svc_fh *fhp, int type,__be32 err;int host_err; +trace_nfsd_vfs_unlink (rqstp, fhp, fname, flen); + err = nfserr_acces;if (!flen ||isdotent (fname, flen)) goto out;
Signature · 1 line
2.49.0
Jeff Layton
maintainerPATCH v3 8/17 nfsd: add tracepoint to nfsd_rename
In reply to Jeff Layton--- fs/nfsd/trace.h | 28 ++++++++++++++++++++++++++++ fs/nfsd/vfs.c | 2 ++ 2 files changed, 30 insertions(+)
fs/nfsd/trace.h +28 -0
@@ -2484,6 +2484,34 @@ TRACE_EVENT(nfsd_vfs_unlink, __entry->xid, __entry->fh_hash, __get_str(name)) ); + +TRACE_EVENT (nfsd_vfs_rename, + TP_PROTO(struct svc_rqst *rqstp, + struct svc_fh *sfhp, + struct svc_fh *tfhp, + const char *name, + unsigned int namelen, + const char *tgt, + unsigned int tgtlen), +TP_ARGS (rqstp, sfhp, tfhp, name, namelen, tgt, tgtlen), +TP_STRUCT__entry ( + SVC_RQST_ENDPOINT_FIELDS(rqstp) + __field(u32, sfh_hash) + __field(u32, tfh_hash) + __string_len(name, name, namelen) +__string_len (tgt, tgt, tgtlen) + ), +TP_fast_assign ( + SVC_RQST_ENDPOINT_ASSIGNMENTS(rqstp); + __entry->sfh_hash = knfsd_fh_hash(&sfhp->fh_handle); + __entry->tfh_hash = knfsd_fh_hash(&tfhp->fh_handle); + __assign_str(name); + __assign_str(tgt); + ), +TP_printk ("xid=0x%08x sfh_hash=0x%08x tfh_hash=0x%08x name=%s target=%s" , + __entry->xid, __entry->sfh_hash, __entry->tfh_hash, +__get_str (name),__get_str (tgt)) +);#endif /* _NFSD_TRACE_H */ #undef TRACE_INCLUDE_PATH
fs/nfsd/vfs.c +2 -0
@@ -1865,6 +1865,8 @@ nfsd_rename(struct svc_rqst *rqstp, struct svc_fh *ffhp, char *fname, int flen,int host_err;bool close_cached = false; +trace_nfsd_vfs_rename (rqstp, ffhp, tfhp, fname, flen, tname, tlen); + err =fh_verify (rqstp, ffhp,S_IFDIR ,NFSD_MAY_REMOVE );if (err) goto out;
Signature · 1 line
2.49.0
Jeff Layton
maintainerPATCH v3 9/17 nfsd: add tracepoint to nfsd_readdir
In reply to Jeff Layton--- fs/nfsd/trace.h | 19 +++++++++++++++++++ fs/nfsd/vfs.c | 2 ++ 2 files changed, 21 insertions(+)
fs/nfsd/trace.h +19 -0
@@ -2512,6 +2512,25 @@ TRACE_EVENT(nfsd_vfs_rename, __entry->xid, __entry->sfh_hash, __entry->tfh_hash, __get_str(name), __get_str(tgt)) ); + +TRACE_EVENT (nfsd_vfs_readdir, + TP_PROTO(struct svc_rqst *rqstp, + struct svc_fh *fhp, + u64 offset), +TP_ARGS (rqstp, fhp, offset), +TP_STRUCT__entry ( + SVC_RQST_ENDPOINT_FIELDS(rqstp) + __field(u32, fh_hash) +__field (u64, offset) + ), +TP_fast_assign ( + SVC_RQST_ENDPOINT_ASSIGNMENTS(rqstp); + __entry->fh_hash = knfsd_fh_hash(&fhp->fh_handle); + __entry->offset = offset; + ), +TP_printk ("xid=0x%08x fh_hash=0x%08x offset=0x%llx" , + __entry->xid, __entry->fh_hash, __entry->offset) +);#endif /* _NFSD_TRACE_H */ #undef TRACE_INCLUDE_PATH
fs/nfsd/vfs.c +2 -0
@@ -2249,6 +2249,8 @@ nfsd_readdir(struct svc_rqst *rqstp, struct svc_fh *fhp, loff_t *offsetp,loff_t offset = *offsetp;int may_flags =NFSD_MAY_READ ; +trace_nfsd_vfs_readdir (rqstp, fhp, *offsetp); + err =nfsd_open (rqstp, fhp,S_IFDIR , may_flags, &file);if (err) goto out;
Signature · 1 line
2.49.0
Jeff Layton
maintainerPATCH v3 10/17 nfsd: add tracepoint for getattr and statfs events
In reply to Jeff LaytonThere isn't a common helper for getattrs, so add these into the protocol-spefici helpers.
--- fs/nfsd/nfs3proc.c | 2 ++ fs/nfsd/nfs4proc.c | 2 ++ fs/nfsd/nfsproc.c | 3 +++ fs/nfsd/trace.h | 24 ++++++++++++++++++++++++ fs/nfsd/vfs.c | 2 ++ 5 files changed, 33 insertions(+)
fs/nfsd/nfs3proc.c +2 -0
@@ -70,6 +70,8 @@ nfsd3_proc_getattr(struct svc_rqst *rqstp)struct nfsd_fhandle *argp = rqstp->rq_argp;struct nfsd3_attrstat *resp = rqstp->rq_resp; +trace_nfsd_vfs_getattr (rqstp, &argp->fh); +dprintk ("nfsd: GETATTR(3) %s\n" ,SVCFH_fmt (&argp->fh));
fs/nfsd/nfs4proc.c +2 -0
@@ -923,6 +923,8 @@ nfsd4_getattr(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,struct nfsd4_getattr *getattr = &u->getattr;__be32 status; +trace_nfsd_vfs_getattr (rqstp, &cstate->current_fh); + status =fh_verify (rqstp, &cstate->current_fh,0 ,NFSD_MAY_NOP );if (status)return status;
fs/nfsd/nfsproc.c +3 -0
@@ -10,6 +10,7 @@#include "cache.h" #include "xdr.h" #include "vfs.h" +#include "trace.h" #define NFSDDBG_FACILITY NFSDDBG_PROC
@@ -54,6 +55,8 @@ nfsd_proc_getattr(struct svc_rqst *rqstp)struct nfsd_fhandle *argp = rqstp->rq_argp;struct nfsd_attrstat *resp = rqstp->rq_resp; +trace_nfsd_vfs_getattr (rqstp, &argp->fh); +dprintk ("nfsd: GETATTR %s\n" ,SVCFH_fmt (&argp->fh));fh_copy (&resp->fh, &argp->fh);
fs/nfsd/trace.h +24 -0
@@ -2531,6 +2531,30 @@ TRACE_EVENT(nfsd_vfs_readdir,TP_printk ("xid=0x%08x fh_hash=0x%08x offset=0x%llx" , __entry->xid, __entry->fh_hash, __entry->offset) ); + +DECLARE_EVENT_CLASS (nfsd_vfs_getattr_class, + TP_PROTO(struct svc_rqst *rqstp, + struct svc_fh *fhp), +TP_ARGS (rqstp, fhp), +TP_STRUCT__entry ( + SVC_RQST_ENDPOINT_FIELDS(rqstp) +__field (u32, fh_hash) + ), +TP_fast_assign ( + SVC_RQST_ENDPOINT_ASSIGNMENTS(rqstp); + __entry->fh_hash = knfsd_fh_hash(&fhp->fh_handle); + ), +TP_printk ("xid=0x%08x fh_hash=0x%08x" , + __entry->xid, __entry->fh_hash) +); + +#define DEFINE_NFSD_VFS_GETATTR_EVENT (__name) \ + DEFINE_EVENT(nfsd_vfs_getattr_class, __name, \ + TP_PROTO(struct svc_rqst *rqstp, struct svc_fh *fhp), \ + TP_ARGS(rqstp, fhp)) + +DEFINE_NFSD_VFS_GETATTR_EVENT (nfsd_vfs_getattr); +DEFINE_NFSD_VFS_GETATTR_EVENT (nfsd_vfs_statfs);#endif /* _NFSD_TRACE_H */ #undef TRACE_INCLUDE_PATH
fs/nfsd/vfs.c +2 -0
@@ -2317,6 +2317,8 @@ nfsd_statfs(struct svc_rqst *rqstp, struct svc_fh *fhp, struct kstatfs *stat, in {__be32 err; +trace_nfsd_vfs_statfs (rqstp, fhp); + err =fh_verify (rqstp, fhp,0 ,NFSD_MAY_NOP | access);if (!err) { struct path path = {
Signature · 1 line
2.49.0
Jeff Layton
maintainerPATCH v3 11/17 nfsd: remove old v2/3 create path dprintks
In reply to Jeff Layton--- fs/nfsd/nfs3proc.c | 15 --------------- fs/nfsd/nfsproc.c | 5 ----- 2 files changed, 20 deletions(-)
fs/nfsd/nfs3proc.c +0 -15
@@ -385,11 +385,6 @@ nfsd3_proc_create(struct svc_rqst *rqstp)struct nfsd3_diropres *resp = rqstp->rq_resp;svc_fh *dirfhp, *newfhp; -dprintk ("nfsd: CREATE(3) %s %.*s\n" , -SVCFH_fmt (&argp->fh), - argp->len, - argp->name); - dirfhp =fh_copy (&resp->dirfh, &argp->fh); newfhp =fh_init (&resp->fh,NFS3_FHSIZE );
@@ -410,11 +405,6 @@ nfsd3_proc_mkdir(struct svc_rqst *rqstp) .na_iattr = &argp->attrs, }; -dprintk ("nfsd: MKDIR(3) %s %.*s\n" , -SVCFH_fmt (&argp->fh), - argp->len, - argp->name); - argp->attrs.ia_valid &= ~ATTR_SIZE ;fh_copy (&resp->dirfh, &argp->fh);fh_init (&resp->fh,NFS3_FHSIZE );
@@ -479,11 +469,6 @@ nfsd3_proc_mknod(struct svc_rqst *rqstp)int type;dev_t rdev =0 ; -dprintk ("nfsd: MKNOD(3) %s %.*s\n" , -SVCFH_fmt (&argp->fh), - argp->len, - argp->name); -fh_copy (&resp->dirfh, &argp->fh);fh_init (&resp->fh,NFS3_FHSIZE );
fs/nfsd/nfsproc.c +0 -5
@@ -295,9 +295,6 @@ nfsd_proc_create(struct svc_rqst *rqstp)int hosterr;dev_t rdev =0 , wanted =new_decode_dev (attr->ia_size); -dprintk ("nfsd: CREATE %s %.*s\n" , -SVCFH_fmt (dirfhp), argp->len, argp->name); -/* First verify the parent file handle */ resp->status =fh_verify (rqstp, dirfhp,S_IFDIR ,NFSD_MAY_EXEC );if (resp->status != nfs_ok)
@@ -551,8 +548,6 @@ nfsd_proc_mkdir(struct svc_rqst *rqstp) .na_iattr = &argp->attrs, }; -dprintk ("nfsd: MKDIR %s %.*s\n" ,SVCFH_fmt (&argp->fh), argp->len, argp->name); -if (resp->fh.fh_dentry) {printk (KERN_WARNING "nfsd_proc_mkdir: response already verified??\n" );
Signature · 1 line
2.49.0
Jeff Layton
maintainerPATCH v3 12/17 nfsd: remove old v2/3 SYMLINK dprintks
In reply to Jeff Layton--- fs/nfsd/nfs3proc.c | 5 ----- fs/nfsd/nfsproc.c | 4 ---- 2 files changed, 9 deletions(-)
fs/nfsd/nfs3proc.c +0 -5
@@ -440,11 +440,6 @@ nfsd3_proc_symlink(struct svc_rqst *rqstp) goto out; } -dprintk ("nfsd: SYMLINK(3) %s %.*s -> %.*s\n" , -SVCFH_fmt (&argp->ffh), - argp->flen, argp->fname, - argp->tlen, argp->tname); -fh_copy (&resp->dirfh, &argp->ffh);fh_init (&resp->fh,NFS3_FHSIZE ); resp->status = nfsd_symlink(rqstp, &resp->dirfh, argp->fname,
fs/nfsd/nfsproc.c +0 -4
@@ -519,10 +519,6 @@ nfsd_proc_symlink(struct svc_rqst *rqstp) goto out; } -dprintk ("nfsd: SYMLINK %s %.*s -> %.*s\n" , -SVCFH_fmt (&argp->ffh), argp->flen, argp->fname, - argp->tlen, argp->tname); -fh_init (&newfh,NFS_FHSIZE ); resp->status =nfsd_symlink (rqstp, &argp->ffh, argp->fname, argp->flen, argp->tname, &attrs, &newfh);
Signature · 1 line
2.49.0
Jeff Layton
maintainerPATCH v3 13/17 nfsd: remove old LINK dprintks
In reply to Jeff Layton--- fs/nfsd/nfs3proc.c | 7 ------- fs/nfsd/nfsproc.c | 7 ------- 2 files changed, 14 deletions(-)
fs/nfsd/nfs3proc.c +0 -7
@@ -559,13 +559,6 @@ nfsd3_proc_link(struct svc_rqst *rqstp)struct nfsd3_linkargs *argp = rqstp->rq_argp;struct nfsd3_linkres *resp = rqstp->rq_resp; -dprintk ("nfsd: LINK(3) %s ->\n" , -SVCFH_fmt (&argp->ffh)); -dprintk ("nfsd: -> %s %.*s\n" , -SVCFH_fmt (&argp->tfh), - argp->tlen, - argp->tname); -fh_copy (&resp->fh, &argp->ffh);fh_copy (&resp->tfh, &argp->tfh); resp->status = nfsd_link(rqstp, &resp->tfh, argp->tname, argp->tlen,
fs/nfsd/nfsproc.c +0 -7
@@ -481,13 +481,6 @@ nfsd_proc_link(struct svc_rqst *rqstp)struct nfsd_linkargs *argp = rqstp->rq_argp;struct nfsd_stat *resp = rqstp->rq_resp; -dprintk ("nfsd: LINK %s ->\n" , -SVCFH_fmt (&argp->ffh)); -dprintk ("nfsd: %s %.*s\n" , -SVCFH_fmt (&argp->tfh), - argp->tlen, - argp->tname); - resp->status =nfsd_link (rqstp, &argp->tfh, argp->tname, argp->tlen, &argp->ffh);fh_put (&argp->ffh);
Signature · 1 line
2.49.0
Jeff Layton
maintainerPATCH v3 14/17 nfsd: remove REMOVE/RMDIR dprintks
In reply to Jeff Layton--- fs/nfsd/nfs3proc.c | 10 ---------- fs/nfsd/nfsproc.c | 5 ----- 2 files changed, 15 deletions(-)
fs/nfsd/nfs3proc.c +0 -10
@@ -496,11 +496,6 @@ nfsd3_proc_remove(struct svc_rqst *rqstp)struct nfsd3_diropargs *argp = rqstp->rq_argp;struct nfsd3_attrstat *resp = rqstp->rq_resp; -dprintk ("nfsd: REMOVE(3) %s %.*s\n" , -SVCFH_fmt (&argp->fh), - argp->len, - argp->name); -/* Unlink. -S_IFDIR means file must not be a directory */ fh_copy (&resp->fh, &argp->fh); resp->status = nfsd_unlink(rqstp, &resp->fh, -S_IFDIR,
@@ -518,11 +513,6 @@ nfsd3_proc_rmdir(struct svc_rqst *rqstp)struct nfsd3_diropargs *argp = rqstp->rq_argp;struct nfsd3_attrstat *resp = rqstp->rq_resp; -dprintk ("nfsd: RMDIR(3) %s %.*s\n" , -SVCFH_fmt (&argp->fh), - argp->len, - argp->name); -fh_copy (&resp->fh, &argp->fh); resp->status =nfsd_unlink (rqstp, &resp->fh,S_IFDIR , argp->name, argp->len);
fs/nfsd/nfsproc.c +0 -5
@@ -445,9 +445,6 @@ nfsd_proc_remove(struct svc_rqst *rqstp)struct nfsd_diropargs *argp = rqstp->rq_argp;struct nfsd_stat *resp = rqstp->rq_resp; -dprintk ("nfsd: REMOVE %s %.*s\n" ,SVCFH_fmt (&argp->fh), - argp->len, argp->name); -/* Unlink. -SIFDIR means file must not be a directory */ resp->status =nfsd_unlink (rqstp, &argp->fh, -S_IFDIR , argp->name, argp->len);
@@ -565,8 +562,6 @@ nfsd_proc_rmdir(struct svc_rqst *rqstp)struct nfsd_diropargs *argp = rqstp->rq_argp;struct nfsd_stat *resp = rqstp->rq_resp; -dprintk ("nfsd: RMDIR %s %.*s\n" ,SVCFH_fmt (&argp->fh), argp->len, argp->name); - resp->status =nfsd_unlink (rqstp, &argp->fh,S_IFDIR , argp->name, argp->len);fh_put (&argp->fh);
Signature · 1 line
2.49.0
Jeff Layton
maintainerPATCH v3 15/17 nfsd: remove dprintks for v2/3 RENAME events
In reply to Jeff Layton--- fs/nfsd/nfs3proc.c | 9 --------- fs/nfsd/nfsproc.c | 5 ----- 2 files changed, 14 deletions(-)
fs/nfsd/nfs3proc.c +0 -9
@@ -526,15 +526,6 @@ nfsd3_proc_rename(struct svc_rqst *rqstp)struct nfsd3_renameargs *argp = rqstp->rq_argp;struct nfsd3_renameres *resp = rqstp->rq_resp; -dprintk ("nfsd: RENAME(3) %s %.*s ->\n" , -SVCFH_fmt (&argp->ffh), - argp->flen, - argp->fname); -dprintk ("nfsd: -> %s %.*s\n" , -SVCFH_fmt (&argp->tfh), - argp->tlen, - argp->tname); -fh_copy (&resp->ffh, &argp->ffh);fh_copy (&resp->tfh, &argp->tfh); resp->status = nfsd_rename(rqstp, &resp->ffh, argp->fname, argp->flen,
fs/nfsd/nfsproc.c +0 -5
@@ -459,11 +459,6 @@ nfsd_proc_rename(struct svc_rqst *rqstp)struct nfsd_renameargs *argp = rqstp->rq_argp;struct nfsd_stat *resp = rqstp->rq_resp; -dprintk ("nfsd: RENAME %s %.*s -> \n" , -SVCFH_fmt (&argp->ffh), argp->flen, argp->fname); -dprintk ("nfsd: -> %s %.*s\n" , -SVCFH_fmt (&argp->tfh), argp->tlen, argp->tname); - resp->status =nfsd_rename (rqstp, &argp->ffh, argp->fname, argp->flen, &argp->tfh, argp->tname, argp->tlen);fh_put (&argp->ffh);
Signature · 1 line
2.49.0
Jeff Layton
maintainerPATCH v3 16/17 nfsd: remove legacy READDIR dprintks
In reply to Jeff Layton--- fs/nfsd/nfs3proc.c | 8 -------- fs/nfsd/nfsproc.c | 4 ---- 2 files changed, 12 deletions(-)
fs/nfsd/nfs3proc.c +0 -8
@@ -578,10 +578,6 @@ nfsd3_proc_readdir(struct svc_rqst *rqstp)struct nfsd3_readdirres *resp = rqstp->rq_resp;loff_t offset; -dprintk ("nfsd: READDIR(3) %s %d bytes at %d\n" , -SVCFH_fmt (&argp->fh), - argp->count, (u32 ) argp->cookie); -nfsd3_init_dirlist_pages (rqstp, resp, argp->count);fh_copy (&resp->fh, &argp->fh);
@@ -612,10 +608,6 @@ nfsd3_proc_readdirplus(struct svc_rqst *rqstp)struct nfsd3_readdirres *resp = rqstp->rq_resp;loff_t offset; -dprintk ("nfsd: READDIR+(3) %s %d bytes at %d\n" , -SVCFH_fmt (&argp->fh), - argp->count, (u32 ) argp->cookie); -nfsd3_init_dirlist_pages (rqstp, resp, argp->count);fh_copy (&resp->fh, &argp->fh);
fs/nfsd/nfsproc.c +0 -4
@@ -592,10 +592,6 @@ nfsd_proc_readdir(struct svc_rqst *rqstp)struct nfsd_readdirres *resp = rqstp->rq_resp;loff_t offset; -dprintk ("nfsd: READDIR %s %d bytes at %d\n" , -SVCFH_fmt (&argp->fh), - argp->count, argp->cookie); -nfsd_init_dirlist_pages (rqstp, resp, argp->count); resp->common.err = nfs_ok;
Signature · 1 line
2.49.0
Jeff Layton
maintainerPATCH v3 17/17 nfsd: remove legacy dprintks from GETATTR and STATFS codepaths
In reply to Jeff Layton--- fs/nfsd/nfs3proc.c | 6 ------ fs/nfsd/nfsproc.c | 4 ---- 2 files changed, 10 deletions(-)
fs/nfsd/nfs3proc.c +0 -6
@@ -72,9 +72,6 @@ nfsd3_proc_getattr(struct svc_rqst *rqstp)trace_nfsd_vfs_getattr (rqstp, &argp->fh); -dprintk ("nfsd: GETATTR(3) %s\n" , -SVCFH_fmt (&argp->fh)); -fh_copy (&resp->fh, &argp->fh); resp->status =fh_verify (rqstp, &resp->fh,0 ,NFSD_MAY_NOP |NFSD_MAY_BYPASS_GSS_ON_ROOT );
@@ -647,9 +644,6 @@ nfsd3_proc_fsstat(struct svc_rqst *rqstp)struct nfsd_fhandle *argp = rqstp->rq_argp;struct nfsd3_fsstatres *resp = rqstp->rq_resp; -dprintk ("nfsd: FSSTAT(3) %s\n" , -SVCFH_fmt (&argp->fh)); - resp->status =nfsd_statfs (rqstp, &argp->fh, &resp->stats,0 );fh_put (&argp->fh); resp->status =nfsd3_map_status (resp->status);
fs/nfsd/nfsproc.c +0 -4
@@ -57,8 +57,6 @@ nfsd_proc_getattr(struct svc_rqst *rqstp)trace_nfsd_vfs_getattr (rqstp, &argp->fh); -dprintk ("nfsd: GETATTR %s\n" ,SVCFH_fmt (&argp->fh)); -fh_copy (&resp->fh, &argp->fh); resp->status =fh_verify (rqstp, &resp->fh,0 ,NFSD_MAY_NOP |NFSD_MAY_BYPASS_GSS_ON_ROOT );
@@ -615,8 +613,6 @@ nfsd_proc_statfs(struct svc_rqst *rqstp)struct nfsd_fhandle *argp = rqstp->rq_argp;struct nfsd_statfsres *resp = rqstp->rq_resp; -dprintk ("nfsd: STATFS %s\n" ,SVCFH_fmt (&argp->fh)); - resp->status =nfsd_statfs (rqstp, &argp->fh, &resp->stats,NFSD_MAY_BYPASS_GSS_ON_ROOT );fh_put (&argp->fh);
Signature · 1 line
2.49.0