Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Chuck Lever and committed by
J. Bruce Fields
fff4080b 87c5942e

+42 -6
+3 -6
fs/nfsd/nfs4proc.c
··· 1721 1721 goto encode_op; 1722 1722 } 1723 1723 1724 + trace_nfsd_compound(rqstp, args->opcnt); 1724 1725 while (!status && resp->opcnt < args->opcnt) { 1725 1726 op = &args->ops[resp->opcnt++]; 1726 1727 1727 - dprintk("nfsv4 compound op #%d/%d: %d (%s)\n", 1728 - resp->opcnt, args->opcnt, op->opnum, 1729 - nfsd4_op_name(op->opnum)); 1730 1728 /* 1731 1729 * The XDR decode routines may have pre-set op->status; 1732 1730 * for example, if there is a miscellaneous XDR error ··· 1798 1800 status = op->status; 1799 1801 } 1800 1802 1801 - dprintk("nfsv4 compound op %p opcnt %d #%d: %d: status %d\n", 1802 - args->ops, args->opcnt, resp->opcnt, op->opnum, 1803 - be32_to_cpu(status)); 1803 + trace_nfsd_compound_status(args->opcnt, resp->opcnt, status, 1804 + nfsd4_op_name(op->opnum)); 1804 1805 1805 1806 nfsd4_cstate_clear_replay(cstate); 1806 1807 nfsd4_increment_op_stats(op->opnum);
+39
fs/nfsd/trace.h
··· 11 11 #include <linux/tracepoint.h> 12 12 #include "nfsfh.h" 13 13 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 + 14 53 DECLARE_EVENT_CLASS(nfsd_io_class, 15 54 TP_PROTO(struct svc_rqst *rqstp, 16 55 struct svc_fh *fhp,