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

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: default avatarChuck Lever <chuck.lever@oracle.com>
Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
parent 55f5088c
...@@ -18,19 +18,24 @@ DECLARE_EVENT_CLASS(nfsd_io_class, ...@@ -18,19 +18,24 @@ DECLARE_EVENT_CLASS(nfsd_io_class,
int len), int len),
TP_ARGS(rqstp, fhp, offset, len), TP_ARGS(rqstp, fhp, offset, len),
TP_STRUCT__entry( TP_STRUCT__entry(
__field(__be32, xid) __field(u32, xid)
__field_struct(struct knfsd_fh, fh) __field(u32, fh_hash)
__field(loff_t, offset) __field(loff_t, offset)
__field(int, len) __field(int, len)
), ),
TP_fast_assign( TP_fast_assign(
__entry->xid = rqstp->rq_xid, __entry->xid = be32_to_cpu(rqstp->rq_xid);
fh_copy_shallow(&__entry->fh, &fhp->fh_handle); do {
struct knfsd_fh fh;
fh_copy_shallow(&fh, &fhp->fh_handle);
__entry->fh_hash = knfsd_fh_hash(&fh);
} while (0);
__entry->offset = offset; __entry->offset = offset;
__entry->len = len; __entry->len = len;
), ),
TP_printk("xid=0x%x fh=0x%x offset=%lld len=%d", TP_printk("xid=0x%08x fh_hash=0x%08x offset=%lld len=%d",
__be32_to_cpu(__entry->xid), knfsd_fh_hash(&__entry->fh), __entry->xid, __entry->fh_hash,
__entry->offset, __entry->len) __entry->offset, __entry->len)
) )
......
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