From: Amir Goldstein Date: Fri, 5 Jun 2026 09:26:47 +0000 (+0200) Subject: fuse: add fuse_request_sent tracepoint X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e0dcd3f02c5b406b506b085ea41b14218c98b4a2;p=thirdparty%2Fkernel%2Flinux.git fuse: add fuse_request_sent tracepoint This new tracepoint complements fuse_request_send (enqueue) and fuse_request_end (completion). It fires after the request has been successfully copied to the daemon's buffer, just before the daemon can start to process it. fuse_request_sent does not fire if the copy of the request fails. It also does not fire for NOTIFY_REPLY, which fires the _end tracepoint at the end of copy. This is needed for tools tracking the in-flight state of user initiated fuse requests. Signed-off-by: Amir Goldstein Reviewed-by: Joanne Koong Signed-off-by: Miklos Szeredi --- diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c index 7e9bf358f0153..63a2898530232 100644 --- a/fs/fuse/dev.c +++ b/fs/fuse/dev.c @@ -1633,6 +1633,7 @@ static ssize_t fuse_dev_do_read(struct fuse_dev *fud, struct file *file, list_move_tail(&req->list, &fpq->processing[hash]); __fuse_get_request(req); set_bit(FR_SENT, &req->flags); + trace_fuse_request_sent(req); spin_unlock(&fpq->lock); /* matches barrier in request_wait_answer() */ smp_mb__after_atomic(); diff --git a/fs/fuse/dev_uring.c b/fs/fuse/dev_uring.c index 2901c7a5ff054..87f5f9eba5345 100644 --- a/fs/fuse/dev_uring.c +++ b/fs/fuse/dev_uring.c @@ -711,6 +711,7 @@ static int fuse_uring_prepare_send(struct fuse_ring_ent *ent, err = fuse_uring_copy_to_ring(ent, req); if (!err) { set_bit(FR_SENT, &req->flags); + trace_fuse_request_sent(req); } else { /* * Copying the request failed. Remove the entry from the diff --git a/fs/fuse/fuse_trace.h b/fs/fuse/fuse_trace.h index 4e34ddb172ed9..60baa10bbcb99 100644 --- a/fs/fuse/fuse_trace.h +++ b/fs/fuse/fuse_trace.h @@ -101,6 +101,28 @@ TRACE_EVENT(fuse_request_send, __print_symbolic(__entry->opcode, OPCODES), __entry->len) ); +TRACE_EVENT(fuse_request_sent, + TP_PROTO(const struct fuse_req *req), + + TP_ARGS(req), + + TP_STRUCT__entry( + __field(dev_t, connection) + __field(uint64_t, unique) + __field(enum fuse_opcode, opcode) + ), + + TP_fast_assign( + __entry->connection = req->chan->conn->dev; + __entry->unique = req->in.h.unique; + __entry->opcode = req->in.h.opcode; + ), + + TP_printk("connection %u req %llu opcode %u (%s)", + __entry->connection, __entry->unique, __entry->opcode, + __print_symbolic(__entry->opcode, OPCODES)) +); + TRACE_EVENT(fuse_request_end, TP_PROTO(const struct fuse_req *req),