Skip to content

Commit

Permalink
SUNRPC: Make the svc_authenticate tracepoint conditional
Browse files Browse the repository at this point in the history
Clean up: Simplify the tracepoint's only call site.

Also, I noticed that when svc_authenticate() returns SVC_COMPLETE,
it leaves rq_auth_stat set to an error value. That doesn't need to
be recorded in the trace log.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
  • Loading branch information
Chuck Lever authored and Chuck Lever committed Dec 10, 2022
1 parent 9315564 commit c65d9df
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 3 additions & 1 deletion include/trace/events/sunrpc.h
Original file line number Diff line number Diff line change
Expand Up @@ -1666,11 +1666,13 @@ TRACE_DEFINE_ENUM(SVC_COMPLETE);
#define SVC_RQST_ENDPOINT_VARARGS \
__entry->xid, __get_sockaddr(server), __get_sockaddr(client)

TRACE_EVENT(svc_authenticate,
TRACE_EVENT_CONDITION(svc_authenticate,
TP_PROTO(const struct svc_rqst *rqst, int auth_res),

TP_ARGS(rqst, auth_res),

TP_CONDITION(auth_res != SVC_OK && auth_res != SVC_COMPLETE),

TP_STRUCT__entry(
SVC_RQST_ENDPOINT_FIELDS(rqst)

Expand Down
3 changes: 1 addition & 2 deletions net/sunrpc/svc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1280,8 +1280,7 @@ svc_process_common(struct svc_rqst *rqstp, struct kvec *argv, struct kvec *resv)
/* Also give the program a chance to reject this call: */
if (auth_res == SVC_OK && progp)
auth_res = progp->pg_authenticate(rqstp);
if (auth_res != SVC_OK)
trace_svc_authenticate(rqstp, auth_res);
trace_svc_authenticate(rqstp, auth_res);
switch (auth_res) {
case SVC_OK:
break;
Expand Down

0 comments on commit c65d9df

Please sign in to comment.