Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

NFS: Refactor trace_nfs4_offload_cancel

Add a trace_nfs4_offload_status trace point that looks just like
trace_nfs4_offload_cancel. Promote that event to an event class to
avoid duplicating code.

An alternative approach would be to expand trace_nfs4_offload_status
to report more of the actual OFFLOAD_STATUS result.

Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Reviewed-by: Benjamin Coddington <bcodding@redhat.com>
Link: https://lore.kernel.org/r/20250113153235.48706-16-cel@kernel.org
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>

authored by

Chuck Lever and committed by
Trond Myklebust
2d6a194f adcc0aef

+11 -1
+1
fs/nfs/nfs42proc.c
··· 648 648 status = nfs4_call_sync(server->client, server, &msg, 649 649 &data->args.osa_seq_args, 650 650 &data->res.osr_seq_res, 1); 651 + trace_nfs4_offload_status(&data->args, status); 651 652 switch (status) { 652 653 case 0: 653 654 break;
+10 -1
fs/nfs/nfs4trace.h
··· 2608 2608 ) 2609 2609 ); 2610 2610 2611 - TRACE_EVENT(nfs4_offload_cancel, 2611 + DECLARE_EVENT_CLASS(nfs4_offload_class, 2612 2612 TP_PROTO( 2613 2613 const struct nfs42_offload_status_args *args, 2614 2614 int error ··· 2640 2640 __entry->stateid_seq, __entry->stateid_hash 2641 2641 ) 2642 2642 ); 2643 + #define DEFINE_NFS4_OFFLOAD_EVENT(name) \ 2644 + DEFINE_EVENT(nfs4_offload_class, name, \ 2645 + TP_PROTO( \ 2646 + const struct nfs42_offload_status_args *args, \ 2647 + int error \ 2648 + ), \ 2649 + TP_ARGS(args, error)) 2650 + DEFINE_NFS4_OFFLOAD_EVENT(nfs4_offload_cancel); 2651 + DEFINE_NFS4_OFFLOAD_EVENT(nfs4_offload_status); 2643 2652 2644 2653 DECLARE_EVENT_CLASS(nfs4_xattr_event, 2645 2654 TP_PROTO(