Commit fff4080b authored by Chuck Lever's avatar Chuck Lever Committed by J. Bruce Fields

nfsd: Trace NFSv4 COMPOUND execution

This helps record the identity and timing of the ops in each NFSv4
COMPOUND, replacing dprintk calls that did much the same thing.
Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
parent 87c5942e
...@@ -1721,12 +1721,10 @@ nfsd4_proc_compound(struct svc_rqst *rqstp) ...@@ -1721,12 +1721,10 @@ nfsd4_proc_compound(struct svc_rqst *rqstp)
goto encode_op; goto encode_op;
} }
trace_nfsd_compound(rqstp, args->opcnt);
while (!status && resp->opcnt < args->opcnt) { while (!status && resp->opcnt < args->opcnt) {
op = &args->ops[resp->opcnt++]; op = &args->ops[resp->opcnt++];
dprintk("nfsv4 compound op #%d/%d: %d (%s)\n",
resp->opcnt, args->opcnt, op->opnum,
nfsd4_op_name(op->opnum));
/* /*
* The XDR decode routines may have pre-set op->status; * The XDR decode routines may have pre-set op->status;
* for example, if there is a miscellaneous XDR error * for example, if there is a miscellaneous XDR error
...@@ -1800,9 +1798,8 @@ nfsd4_proc_compound(struct svc_rqst *rqstp) ...@@ -1800,9 +1798,8 @@ nfsd4_proc_compound(struct svc_rqst *rqstp)
status = op->status; status = op->status;
} }
dprintk("nfsv4 compound op %p opcnt %d #%d: %d: status %d\n", trace_nfsd_compound_status(args->opcnt, resp->opcnt, status,
args->ops, args->opcnt, resp->opcnt, op->opnum, nfsd4_op_name(op->opnum));
be32_to_cpu(status));
nfsd4_cstate_clear_replay(cstate); nfsd4_cstate_clear_replay(cstate);
nfsd4_increment_op_stats(op->opnum); nfsd4_increment_op_stats(op->opnum);
......
...@@ -11,6 +11,45 @@ ...@@ -11,6 +11,45 @@
#include <linux/tracepoint.h> #include <linux/tracepoint.h>
#include "nfsfh.h" #include "nfsfh.h"
TRACE_EVENT(nfsd_compound,
TP_PROTO(const struct svc_rqst *rqst,
u32 args_opcnt),
TP_ARGS(rqst, args_opcnt),
TP_STRUCT__entry(
__field(u32, xid)
__field(u32, args_opcnt)
),
TP_fast_assign(
__entry->xid = be32_to_cpu(rqst->rq_xid);
__entry->args_opcnt = args_opcnt;
),
TP_printk("xid=0x%08x opcnt=%u",
__entry->xid, __entry->args_opcnt)
)
TRACE_EVENT(nfsd_compound_status,
TP_PROTO(u32 args_opcnt,
u32 resp_opcnt,
__be32 status,
const char *name),
TP_ARGS(args_opcnt, resp_opcnt, status, name),
TP_STRUCT__entry(
__field(u32, args_opcnt)
__field(u32, resp_opcnt)
__field(int, status)
__string(name, name)
),
TP_fast_assign(
__entry->args_opcnt = args_opcnt;
__entry->resp_opcnt = resp_opcnt;
__entry->status = be32_to_cpu(status);
__assign_str(name, name);
),
TP_printk("op=%u/%u %s status=%d",
__entry->resp_opcnt, __entry->args_opcnt,
__get_str(name), __entry->status)
)
DECLARE_EVENT_CLASS(nfsd_io_class, DECLARE_EVENT_CLASS(nfsd_io_class,
TP_PROTO(struct svc_rqst *rqstp, TP_PROTO(struct svc_rqst *rqstp,
struct svc_fh *fhp, struct svc_fh *fhp,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment