aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd/trace.h
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2018-03-27 10:52:43 -0400
committerJ. Bruce Fields <bfields@redhat.com>2018-04-03 15:08:13 -0400
commitafa720a0910bd0fe4a714ab9b902ff6e845900c3 (patch)
treeb76eace46040f90ffbc690ca2ca111c508bb7d33 /fs/nfsd/trace.h
parent55f5088c22cc83dbc64394abfbf76cd1ff5e7cd0 (diff)
nfsd: Fix NFSD trace points
nfsd-1915 [003] 77915.780959: write_opened: [FAILED TO PARSE] xid=3286130958 fh=0 offset=154624 len=1 nfsd-1915 [003] 77915.780960: write_io_done: [FAILED TO PARSE] xid=3286130958 fh=0 offset=154624 len=1 nfsd-1915 [003] 77915.780964: write_done: [FAILED TO PARSE] xid=3286130958 fh=0 offset=154624 len=1 Byte swapping and knfsd_fh_hash() are not available in "trace-cmd report", where the print format string is actually used. These data transformations have to be done during the TP_fast_assign step. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd/trace.h')
-rw-r--r--fs/nfsd/trace.h17
1 files changed, 11 insertions, 6 deletions
diff --git a/fs/nfsd/trace.h b/fs/nfsd/trace.h
index 8b2f1d92c579..3aa3f3b1eeaa 100644
--- a/fs/nfsd/trace.h
+++ b/fs/nfsd/trace.h
@@ -18,19 +18,24 @@ DECLARE_EVENT_CLASS(nfsd_io_class,
18 int len), 18 int len),
19 TP_ARGS(rqstp, fhp, offset, len), 19 TP_ARGS(rqstp, fhp, offset, len),
20 TP_STRUCT__entry( 20 TP_STRUCT__entry(
21 __field(__be32, xid) 21 __field(u32, xid)
22 __field_struct(struct knfsd_fh, fh) 22 __field(u32, fh_hash)
23 __field(loff_t, offset) 23 __field(loff_t, offset)
24 __field(int, len) 24 __field(int, len)
25 ), 25 ),
26 TP_fast_assign( 26 TP_fast_assign(
27 __entry->xid = rqstp->rq_xid, 27 __entry->xid = be32_to_cpu(rqstp->rq_xid);
28 fh_copy_shallow(&__entry->fh, &fhp->fh_handle); 28 do {
29 struct knfsd_fh fh;
30
31 fh_copy_shallow(&fh, &fhp->fh_handle);
32 __entry->fh_hash = knfsd_fh_hash(&fh);
33 } while (0);
29 __entry->offset = offset; 34 __entry->offset = offset;
30 __entry->len = len; 35 __entry->len = len;
31 ), 36 ),
32 TP_printk("xid=0x%x fh=0x%x offset=%lld len=%d", 37 TP_printk("xid=0x%08x fh_hash=0x%08x offset=%lld len=%d",
33 __be32_to_cpu(__entry->xid), knfsd_fh_hash(&__entry->fh), 38 __entry->xid, __entry->fh_hash,
34 __entry->offset, __entry->len) 39 __entry->offset, __entry->len)
35) 40)
36 41