Skip to content

Commit 127beca

Browse files
olgakorn1Trond Myklebust
authored andcommitted
NFSv4.2 add tracepoint to OFFLOAD_CANCEL
Add tracepoint to OFFLOAD_CANCEL operation. Signed-off-by: Olga Kornievskaia <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
1 parent 488b170 commit 127beca

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

fs/nfs/nfs42proc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,7 @@ static void nfs42_offload_cancel_done(struct rpc_task *task, void *calldata)
509509
{
510510
struct nfs42_offloadcancel_data *data = calldata;
511511

512+
trace_nfs4_offload_cancel(&data->args, task->tk_status);
512513
nfs41_sequence_done(task, &data->res.osr_seq_res);
513514
if (task->tk_status &&
514515
nfs4_async_handle_error(task, data->seq_server, NULL,

fs/nfs/nfs4trace.h

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2463,6 +2463,39 @@ TRACE_EVENT(nfs4_copy_notify,
24632463
__entry->res_stateid_seq, __entry->res_stateid_hash
24642464
)
24652465
);
2466+
2467+
TRACE_EVENT(nfs4_offload_cancel,
2468+
TP_PROTO(
2469+
const struct nfs42_offload_status_args *args,
2470+
int error
2471+
),
2472+
2473+
TP_ARGS(args, error),
2474+
2475+
TP_STRUCT__entry(
2476+
__field(unsigned long, error)
2477+
__field(u32, fhandle)
2478+
__field(int, stateid_seq)
2479+
__field(u32, stateid_hash)
2480+
),
2481+
2482+
TP_fast_assign(
2483+
__entry->fhandle = nfs_fhandle_hash(args->osa_src_fh);
2484+
__entry->error = error < 0 ? -error : 0;
2485+
__entry->stateid_seq =
2486+
be32_to_cpu(args->osa_stateid.seqid);
2487+
__entry->stateid_hash =
2488+
nfs_stateid_hash(&args->osa_stateid);
2489+
),
2490+
2491+
TP_printk(
2492+
"error=%ld (%s) fhandle=0x%08x stateid=%d:0x%08x",
2493+
-__entry->error,
2494+
show_nfs4_status(__entry->error),
2495+
__entry->fhandle,
2496+
__entry->stateid_seq, __entry->stateid_hash
2497+
)
2498+
);
24662499
#endif /* CONFIG_NFS_V4_2 */
24672500

24682501
#endif /* CONFIG_NFS_V4_1 */

0 commit comments

Comments
 (0)