Skip to content

Commit 8db744c

Browse files
olgakorn1Trond Myklebust
authored andcommitted
NFSv4.2 add tracepoint to CB_OFFLOAD
Add a tracepoint to the CB_OFFLOAD operation. Signed-off-by: Olga Kornievskaia <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
1 parent 2a65ca8 commit 8db744c

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed

fs/nfs/callback_proc.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -739,6 +739,9 @@ __be32 nfs4_callback_offload(void *data, void *dummy,
739739
kfree(copy);
740740
spin_unlock(&cps->clp->cl_lock);
741741

742+
trace_nfs4_cb_offload(&args->coa_fh, &args->coa_stateid,
743+
args->wr_count, args->error,
744+
args->wr_writeverf.committed);
742745
return 0;
743746
}
744747
#endif /* CONFIG_NFS_V4_2 */

fs/nfs/nfs4trace.h

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,50 @@ TRACE_EVENT(nfs4_cb_seqid_err,
200200
)
201201
);
202202

203+
TRACE_EVENT(nfs4_cb_offload,
204+
TP_PROTO(
205+
const struct nfs_fh *cb_fh,
206+
const nfs4_stateid *cb_stateid,
207+
uint64_t cb_count,
208+
int cb_error,
209+
int cb_how_stable
210+
),
211+
212+
TP_ARGS(cb_fh, cb_stateid, cb_count, cb_error,
213+
cb_how_stable),
214+
215+
TP_STRUCT__entry(
216+
__field(unsigned long, error)
217+
__field(u32, fhandle)
218+
__field(loff_t, cb_count)
219+
__field(int, cb_how)
220+
__field(int, cb_stateid_seq)
221+
__field(u32, cb_stateid_hash)
222+
),
223+
224+
TP_fast_assign(
225+
__entry->error = cb_error < 0 ? -cb_error : 0;
226+
__entry->fhandle = nfs_fhandle_hash(cb_fh);
227+
__entry->cb_stateid_seq =
228+
be32_to_cpu(cb_stateid->seqid);
229+
__entry->cb_stateid_hash =
230+
nfs_stateid_hash(cb_stateid);
231+
__entry->cb_count = cb_count;
232+
__entry->cb_how = cb_how_stable;
233+
),
234+
235+
TP_printk(
236+
"error=%ld (%s) fhandle=0x%08x cb_stateid=%d:0x%08x "
237+
"cb_count=%llu cb_how=%s",
238+
-__entry->error,
239+
show_nfs4_status(__entry->error),
240+
__entry->fhandle,
241+
__entry->cb_stateid_seq, __entry->cb_stateid_hash,
242+
__entry->cb_count,
243+
show_nfs_stable_how(__entry->cb_how)
244+
)
245+
);
246+
203247
#endif /* CONFIG_NFS_V4_1 */
204248

205249
TRACE_EVENT(nfs4_setup_sequence,

0 commit comments

Comments
 (0)