Skip to content

Commit fff4080

Browse files
chuckleverJ. Bruce Fields
authored andcommitted
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: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
1 parent 87c5942 commit fff4080

File tree

2 files changed

+42
-6
lines changed

2 files changed

+42
-6
lines changed

fs/nfsd/nfs4proc.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1721,12 +1721,10 @@ nfsd4_proc_compound(struct svc_rqst *rqstp)
17211721
goto encode_op;
17221722
}
17231723

1724+
trace_nfsd_compound(rqstp, args->opcnt);
17241725
while (!status && resp->opcnt < args->opcnt) {
17251726
op = &args->ops[resp->opcnt++];
17261727

1727-
dprintk("nfsv4 compound op #%d/%d: %d (%s)\n",
1728-
resp->opcnt, args->opcnt, op->opnum,
1729-
nfsd4_op_name(op->opnum));
17301728
/*
17311729
* The XDR decode routines may have pre-set op->status;
17321730
* for example, if there is a miscellaneous XDR error
@@ -1800,9 +1798,8 @@ nfsd4_proc_compound(struct svc_rqst *rqstp)
18001798
status = op->status;
18011799
}
18021800

1803-
dprintk("nfsv4 compound op %p opcnt %d #%d: %d: status %d\n",
1804-
args->ops, args->opcnt, resp->opcnt, op->opnum,
1805-
be32_to_cpu(status));
1801+
trace_nfsd_compound_status(args->opcnt, resp->opcnt, status,
1802+
nfsd4_op_name(op->opnum));
18061803

18071804
nfsd4_cstate_clear_replay(cstate);
18081805
nfsd4_increment_op_stats(op->opnum);

fs/nfsd/trace.h

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,45 @@
1111
#include <linux/tracepoint.h>
1212
#include "nfsfh.h"
1313

14+
TRACE_EVENT(nfsd_compound,
15+
TP_PROTO(const struct svc_rqst *rqst,
16+
u32 args_opcnt),
17+
TP_ARGS(rqst, args_opcnt),
18+
TP_STRUCT__entry(
19+
__field(u32, xid)
20+
__field(u32, args_opcnt)
21+
),
22+
TP_fast_assign(
23+
__entry->xid = be32_to_cpu(rqst->rq_xid);
24+
__entry->args_opcnt = args_opcnt;
25+
),
26+
TP_printk("xid=0x%08x opcnt=%u",
27+
__entry->xid, __entry->args_opcnt)
28+
)
29+
30+
TRACE_EVENT(nfsd_compound_status,
31+
TP_PROTO(u32 args_opcnt,
32+
u32 resp_opcnt,
33+
__be32 status,
34+
const char *name),
35+
TP_ARGS(args_opcnt, resp_opcnt, status, name),
36+
TP_STRUCT__entry(
37+
__field(u32, args_opcnt)
38+
__field(u32, resp_opcnt)
39+
__field(int, status)
40+
__string(name, name)
41+
),
42+
TP_fast_assign(
43+
__entry->args_opcnt = args_opcnt;
44+
__entry->resp_opcnt = resp_opcnt;
45+
__entry->status = be32_to_cpu(status);
46+
__assign_str(name, name);
47+
),
48+
TP_printk("op=%u/%u %s status=%d",
49+
__entry->resp_opcnt, __entry->args_opcnt,
50+
__get_str(name), __entry->status)
51+
)
52+
1453
DECLARE_EVENT_CLASS(nfsd_io_class,
1554
TP_PROTO(struct svc_rqst *rqstp,
1655
struct svc_fh *fhp,

0 commit comments

Comments
 (0)