Skip to content

Commit

Permalink
nfsd: new tracepoint for after op_func in compound processing
Browse files Browse the repository at this point in the history
Turn nfsd_compound_encode_err tracepoint into a class and add a new
nfsd_compound_op_err tracepoint.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
  • Loading branch information
Jeff Layton authored and Chuck Lever committed Nov 19, 2024
1 parent f6259e2 commit b9376c7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions fs/nfsd/nfs4proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2780,6 +2780,7 @@ nfsd4_proc_compound(struct svc_rqst *rqstp)
if (op->opdesc->op_get_currentstateid)
op->opdesc->op_get_currentstateid(cstate, &op->u);
op->status = op->opdesc->op_func(rqstp, cstate, &op->u);
trace_nfsd_compound_op_err(rqstp, op->opnum, op->status);

/* Only from SEQUENCE */
if (cstate->status == nfserr_replay_cache) {
Expand Down
14 changes: 13 additions & 1 deletion fs/nfsd/trace.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ TRACE_EVENT(nfsd_compound_decode_err,
__entry->opnum, __entry->status)
);

TRACE_EVENT(nfsd_compound_encode_err,
DECLARE_EVENT_CLASS(nfsd_compound_err_class,
TP_PROTO(
const struct svc_rqst *rqstp,
u32 opnum,
Expand All @@ -184,6 +184,18 @@ TRACE_EVENT(nfsd_compound_encode_err,
__entry->opnum, __entry->status)
);

#define DEFINE_NFSD_COMPOUND_ERR_EVENT(name) \
DEFINE_EVENT(nfsd_compound_err_class, nfsd_compound_##name##_err, \
TP_PROTO( \
const struct svc_rqst *rqstp, \
u32 opnum, \
__be32 status \
), \
TP_ARGS(rqstp, opnum, status))

DEFINE_NFSD_COMPOUND_ERR_EVENT(op);
DEFINE_NFSD_COMPOUND_ERR_EVENT(encode);

#define show_fs_file_type(x) \
__print_symbolic(x, \
{ S_IFLNK, "LNK" }, \
Expand Down

0 comments on commit b9376c7

Please sign in to comment.