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 <amir73il@gmail.com>
Reviewed-by: Joanne Koong <joannelkoong@gmail.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
This commit is contained in:
Amir Goldstein
2026-06-05 11:26:47 +02:00
committed by Miklos Szeredi
parent 9f3e7166aa
commit e0dcd3f02c
3 changed files with 24 additions and 0 deletions

View File

@@ -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();

View File

@@ -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

View File

@@ -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),