Skip to content

Commit 3c49e52

Browse files
dhowellsbrauner
authored andcommitted
afs: Add a tracepoint for afs_read_receive()
Add a tracepoint for afs_read_receive() to allow potential missed wakeups to be debugged. Signed-off-by: David Howells <[email protected]> Link: https://lore.kernel.org/r/[email protected] cc: Marc Dionne <[email protected]> cc: [email protected] Signed-off-by: Christian Brauner <[email protected]>
1 parent 6698c02 commit 3c49e52

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

fs/afs/file.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,7 @@ static void afs_read_receive(struct afs_call *call)
274274
state = READ_ONCE(call->state);
275275
if (state == AFS_CALL_COMPLETE)
276276
return;
277+
trace_afs_read_recv(op, call);
277278

278279
while (state < AFS_CALL_COMPLETE && READ_ONCE(call->need_attention)) {
279280
WRITE_ONCE(call->need_attention, false);

include/trace/events/afs.h

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1775,6 +1775,36 @@ TRACE_EVENT(afs_make_call,
17751775
__entry->fid.unique)
17761776
);
17771777

1778+
TRACE_EVENT(afs_read_recv,
1779+
TP_PROTO(const struct afs_operation *op, const struct afs_call *call),
1780+
1781+
TP_ARGS(op, call),
1782+
1783+
TP_STRUCT__entry(
1784+
__field(unsigned int, rreq)
1785+
__field(unsigned int, sreq)
1786+
__field(unsigned int, op)
1787+
__field(unsigned int, op_flags)
1788+
__field(unsigned int, call)
1789+
__field(enum afs_call_state, call_state)
1790+
),
1791+
1792+
TP_fast_assign(
1793+
__entry->op = op->debug_id;
1794+
__entry->sreq = op->fetch.subreq->debug_index;
1795+
__entry->rreq = op->fetch.subreq->rreq->debug_id;
1796+
__entry->op_flags = op->flags;
1797+
__entry->call = call->debug_id;
1798+
__entry->call_state = call->state;
1799+
),
1800+
1801+
TP_printk("R=%08x[%x] OP=%08x c=%08x cs=%x of=%x",
1802+
__entry->rreq, __entry->sreq,
1803+
__entry->op,
1804+
__entry->call, __entry->call_state,
1805+
__entry->op_flags)
1806+
);
1807+
17781808
#endif /* _TRACE_AFS_H */
17791809

17801810
/* This part must be outside protection */

0 commit comments

Comments
 (0)