]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
NFSD: Trace NFSv4 COMPOUND tags
authorChuck Lever <chuck.lever@oracle.com>
Thu, 8 Sep 2022 22:13:48 +0000 (18:13 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 10 Apr 2024 14:19:16 +0000 (16:19 +0200)
[ Upstream commit de29cf7e6cbbe236c3a51999c188fcd467762899 ]

The Linux NFSv4 client implementation does not use COMPOUND tags,
but the Solaris and MacOS implementations do, and so does pynfs.
Record these eye-catchers in the server's trace buffer to annotate
client requests while troubleshooting.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
fs/nfsd/nfs4proc.c
fs/nfsd/trace.h

index 69d3013fb1b26f89f4aa3a1d0ff47c38a1194bd3..e4c0dc577fe3579b57af1510e802bac5d82553c5 100644 (file)
@@ -2637,7 +2637,7 @@ nfsd4_proc_compound(struct svc_rqst *rqstp)
 
        rqstp->rq_lease_breaker = (void **)&cstate->clp;
 
-       trace_nfsd_compound(rqstp, args->client_opcnt);
+       trace_nfsd_compound(rqstp, args->tag, args->taglen, args->client_opcnt);
        while (!status && resp->opcnt < args->opcnt) {
                op = &args->ops[resp->opcnt++];
 
index 297bf9ddc50902774bfcdde5b2d1bd2506fa7f3e..c5d4a258680c34944dd555077aee31bac98abddc 100644 (file)
@@ -84,19 +84,26 @@ DEFINE_NFSD_XDR_ERR_EVENT(cant_encode);
                { NFSD_MAY_64BIT_COOKIE,        "64BIT_COOKIE" })
 
 TRACE_EVENT(nfsd_compound,
-       TP_PROTO(const struct svc_rqst *rqst,
-                u32 args_opcnt),
-       TP_ARGS(rqst, args_opcnt),
+       TP_PROTO(
+               const struct svc_rqst *rqst,
+               const char *tag,
+               u32 taglen,
+               u32 opcnt
+       ),
+       TP_ARGS(rqst, tag, taglen, opcnt),
        TP_STRUCT__entry(
                __field(u32, xid)
-               __field(u32, args_opcnt)
+               __field(u32, opcnt)
+               __string_len(tag, tag, taglen)
        ),
        TP_fast_assign(
                __entry->xid = be32_to_cpu(rqst->rq_xid);
-               __entry->args_opcnt = args_opcnt;
+               __entry->opcnt = opcnt;
+               __assign_str_len(tag, tag, taglen);
        ),
-       TP_printk("xid=0x%08x opcnt=%u",
-               __entry->xid, __entry->args_opcnt)
+       TP_printk("xid=0x%08x opcnt=%u tag=%s",
+               __entry->xid, __entry->opcnt, __get_str(tag)
+       )
 )
 
 TRACE_EVENT(nfsd_compound_status,