]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
io_uring: improve trace_io_uring_defer() trace point
authorJens Axboe <axboe@kernel.dk>
Thu, 21 Nov 2019 16:01:20 +0000 (09:01 -0700)
committerJens Axboe <axboe@kernel.dk>
Tue, 26 Nov 2019 02:56:10 +0000 (19:56 -0700)
We don't have shadow requests anymore, so get rid of the shadow
argument. Add the user_data argument, as that's often useful to easily
match up requests, instead of having to look at request pointers.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c
include/trace/events/io_uring.h

index ca980c5878e97da876faa656ff8b96dea7355b87..736f27808f99b1b8661aace9291f8ab5f3c309a9 100644 (file)
@@ -2588,7 +2588,7 @@ static int io_req_defer(struct io_kiocb *req)
        req->flags |= REQ_F_FREE_SQE;
        req->submit.sqe = sqe_copy;
 
-       trace_io_uring_defer(ctx, req, false);
+       trace_io_uring_defer(ctx, req, req->user_data);
        list_add_tail(&req->list, &ctx->defer_list);
        spin_unlock_irq(&ctx->completion_lock);
        return -EIOCBQUEUED;
index 72a4d0174b02bc256f916d08860f3c6f7a9b747c..b352d66b5d5170181cfd81e2b77f87c22ed18f40 100644 (file)
@@ -163,35 +163,35 @@ TRACE_EVENT(io_uring_queue_async_work,
 );
 
 /**
- * io_uring_defer_list - called before the io_uring work added into defer_list
+ * io_uring_defer - called when an io_uring request is deferred
  *
  * @ctx:       pointer to a ring context structure
  * @req:       pointer to a deferred request
- * @shadow: whether request is shadow or not
+ * @user_data: user data associated with the request
  *
  * Allows to track deferred requests, to get an insight about what requests are
  * not started immediately.
  */
 TRACE_EVENT(io_uring_defer,
 
-       TP_PROTO(void *ctx, void *req, bool shadow),
+       TP_PROTO(void *ctx, void *req, unsigned long long user_data),
 
-       TP_ARGS(ctx, req, shadow),
+       TP_ARGS(ctx, req, user_data),
 
        TP_STRUCT__entry (
                __field(  void *,       ctx             )
                __field(  void *,       req             )
-               __field(  bool,         shadow  )
+               __field(  unsigned long long, data      )
        ),
 
        TP_fast_assign(
                __entry->ctx    = ctx;
                __entry->req    = req;
-               __entry->shadow = shadow;
+               __entry->data   = user_data;
        ),
 
-       TP_printk("ring %p, request %p%s", __entry->ctx, __entry->req,
-                         __entry->shadow ? ", shadow": "")
+       TP_printk("ring %p, request %p user_data %llu", __entry->ctx,
+                       __entry->req, __entry->data)
 );
 
 /**