Skip to content

Commit

Permalink
NFS: Improve readpage/writepage tracing
Browse files Browse the repository at this point in the history
Switch formatting to better match that used by other NFS tracepoints.

Signed-off-by: Trond Myklebust <[email protected]>
  • Loading branch information
Trond Myklebust committed Aug 9, 2022
1 parent b313eb9 commit 3fa5cbd
Showing 1 changed file with 26 additions and 28 deletions.
54 changes: 26 additions & 28 deletions fs/nfs/nfstrace.h
Original file line number Diff line number Diff line change
Expand Up @@ -1137,7 +1137,7 @@ TRACE_EVENT(nfs_readpage_done,
__field(u32, arg_count)
__field(u32, res_count)
__field(bool, eof)
__field(int, status)
__field(int, error)
),

TP_fast_assign(
Expand All @@ -1146,7 +1146,7 @@ TRACE_EVENT(nfs_readpage_done,
const struct nfs_fh *fh = hdr->args.fh ?
hdr->args.fh : &nfsi->fh;

__entry->status = task->tk_status;
__entry->error = task->tk_status;
__entry->offset = hdr->args.offset;
__entry->arg_count = hdr->args.count;
__entry->res_count = hdr->res.count;
Expand All @@ -1157,14 +1157,13 @@ TRACE_EVENT(nfs_readpage_done,
),

TP_printk(
"fileid=%02x:%02x:%llu fhandle=0x%08x "
"offset=%lld count=%u res=%u status=%d%s",
"error=%d fileid=%02x:%02x:%llu fhandle=0x%08x "
"offset=%lld count=%u res=%u%s", __entry->error,
MAJOR(__entry->dev), MINOR(__entry->dev),
(unsigned long long)__entry->fileid,
__entry->fhandle,
(long long)__entry->offset, __entry->arg_count,
__entry->res_count, __entry->status,
__entry->eof ? " eof" : ""
__entry->res_count, __entry->eof ? " eof" : ""
)
);

Expand All @@ -1184,7 +1183,7 @@ TRACE_EVENT(nfs_readpage_short,
__field(u32, arg_count)
__field(u32, res_count)
__field(bool, eof)
__field(int, status)
__field(int, error)
),

TP_fast_assign(
Expand All @@ -1193,7 +1192,7 @@ TRACE_EVENT(nfs_readpage_short,
const struct nfs_fh *fh = hdr->args.fh ?
hdr->args.fh : &nfsi->fh;

__entry->status = task->tk_status;
__entry->error = task->tk_status;
__entry->offset = hdr->args.offset;
__entry->arg_count = hdr->args.count;
__entry->res_count = hdr->res.count;
Expand All @@ -1204,14 +1203,13 @@ TRACE_EVENT(nfs_readpage_short,
),

TP_printk(
"fileid=%02x:%02x:%llu fhandle=0x%08x "
"offset=%lld count=%u res=%u status=%d%s",
"error=%d fileid=%02x:%02x:%llu fhandle=0x%08x "
"offset=%lld count=%u res=%u%s", __entry->error,
MAJOR(__entry->dev), MINOR(__entry->dev),
(unsigned long long)__entry->fileid,
__entry->fhandle,
(long long)__entry->offset, __entry->arg_count,
__entry->res_count, __entry->status,
__entry->eof ? " eof" : ""
__entry->res_count, __entry->eof ? " eof" : ""
)
);

Expand Down Expand Up @@ -1323,7 +1321,7 @@ TRACE_EVENT(nfs_pgio_error,
__field(u32, arg_count)
__field(u32, res_count)
__field(loff_t, pos)
__field(int, status)
__field(int, error)
),

TP_fast_assign(
Expand All @@ -1332,7 +1330,7 @@ TRACE_EVENT(nfs_pgio_error,
const struct nfs_fh *fh = hdr->args.fh ?
hdr->args.fh : &nfsi->fh;

__entry->status = error;
__entry->error = error;
__entry->offset = hdr->args.offset;
__entry->arg_count = hdr->args.count;
__entry->res_count = hdr->res.count;
Expand All @@ -1341,12 +1339,12 @@ TRACE_EVENT(nfs_pgio_error,
__entry->fhandle = nfs_fhandle_hash(fh);
),

TP_printk("fileid=%02x:%02x:%llu fhandle=0x%08x "
"offset=%lld count=%u res=%u pos=%llu status=%d",
TP_printk("error=%d fileid=%02x:%02x:%llu fhandle=0x%08x "
"offset=%lld count=%u res=%u pos=%llu", __entry->error,
MAJOR(__entry->dev), MINOR(__entry->dev),
(unsigned long long)__entry->fileid, __entry->fhandle,
(long long)__entry->offset, __entry->arg_count, __entry->res_count,
__entry->pos, __entry->status
__entry->pos
)
);

Expand Down Expand Up @@ -1406,7 +1404,7 @@ TRACE_EVENT(nfs_writeback_done,
__field(loff_t, offset)
__field(u32, arg_count)
__field(u32, res_count)
__field(int, status)
__field(int, error)
__field(unsigned long, stable)
__array(char, verifier, NFS4_VERIFIER_SIZE)
),
Expand All @@ -1418,7 +1416,7 @@ TRACE_EVENT(nfs_writeback_done,
hdr->args.fh : &nfsi->fh;
const struct nfs_writeverf *verf = hdr->res.verf;

__entry->status = task->tk_status;
__entry->error = task->tk_status;
__entry->offset = hdr->args.offset;
__entry->arg_count = hdr->args.count;
__entry->res_count = hdr->res.count;
Expand All @@ -1432,14 +1430,14 @@ TRACE_EVENT(nfs_writeback_done,
),

TP_printk(
"fileid=%02x:%02x:%llu fhandle=0x%08x "
"offset=%lld count=%u res=%u status=%d stable=%s "
"verifier=%s",
"error=%d fileid=%02x:%02x:%llu fhandle=0x%08x "
"offset=%lld count=%u res=%u stable=%s "
"verifier=%s", __entry->error,
MAJOR(__entry->dev), MINOR(__entry->dev),
(unsigned long long)__entry->fileid,
__entry->fhandle,
(long long)__entry->offset, __entry->arg_count,
__entry->res_count, __entry->status,
__entry->res_count,
show_nfs_stable_how(__entry->stable),
show_nfs4_verifier(__entry->verifier)
)
Expand Down Expand Up @@ -1547,7 +1545,7 @@ TRACE_EVENT(nfs_commit_done,
__field(u32, fhandle)
__field(u64, fileid)
__field(loff_t, offset)
__field(int, status)
__field(int, error)
__field(unsigned long, stable)
__array(char, verifier, NFS4_VERIFIER_SIZE)
),
Expand All @@ -1559,7 +1557,7 @@ TRACE_EVENT(nfs_commit_done,
data->args.fh : &nfsi->fh;
const struct nfs_writeverf *verf = data->res.verf;

__entry->status = task->tk_status;
__entry->error = task->tk_status;
__entry->offset = data->args.offset;
__entry->stable = verf->committed;
memcpy(__entry->verifier,
Expand All @@ -1571,12 +1569,12 @@ TRACE_EVENT(nfs_commit_done,
),

TP_printk(
"fileid=%02x:%02x:%llu fhandle=0x%08x "
"offset=%lld status=%d stable=%s verifier=%s",
"error=%d fileid=%02x:%02x:%llu fhandle=0x%08x "
"offset=%lld stable=%s verifier=%s", __entry->error,
MAJOR(__entry->dev), MINOR(__entry->dev),
(unsigned long long)__entry->fileid,
__entry->fhandle,
(long long)__entry->offset, __entry->status,
(long long)__entry->offset,
show_nfs_stable_how(__entry->stable),
show_nfs4_verifier(__entry->verifier)
)
Expand Down

0 comments on commit 3fa5cbd

Please sign in to comment.