fix: block: don't call blk_status_to_errno in blk_update_request (v5.16)
authorMichael Jeanson <mjeanson@efficios.com>
Tue, 14 Dec 2021 20:13:20 +0000 (15:13 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 4 Jan 2022 14:23:56 +0000 (09:23 -0500)
See upstream commit :

  commit 8a7d267b4a2c71a5ff5dd9046abea7117c7d0ac2
  Author: Christoph Hellwig <hch@lst.de>
  Date:   Mon Oct 18 10:45:18 2021 +0200

    block: don't call blk_status_to_errno in blk_update_request

    We only need to call it to resolve the blk_status_t -> errno mapping for
    tracing, so move the conversion into the tracepoints that are not called
    at all when tracing isn't enabled.

Change-Id: Ic556cee1d82e44a93a1467f55d45b6e17a48d387
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
include/instrumentation/events/block.h

index 3895c9d481f010acb1d3b35463692d39bb78e5d0..6782c36f8d2925619426dbe3d6048b39aa5ad8ad 100644 (file)
@@ -380,7 +380,24 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(block_rq_with_error, block_rq_requeue,
  * do for the request. If @rq->bio is non-NULL then there is
  * additional work required to complete the request.
  */
-#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,12,0))
+#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,16,0))
+LTTNG_TRACEPOINT_EVENT(block_rq_complete,
+
+       TP_PROTO(struct request *rq, blk_status_t error, unsigned int nr_bytes),
+
+       TP_ARGS(rq, error, nr_bytes),
+
+       TP_FIELDS(
+               ctf_integer(dev_t, dev,
+                       rq->rq_disk ? disk_devt(rq->rq_disk) : 0)
+               ctf_integer(sector_t, sector, blk_rq_pos(rq))
+               ctf_integer(unsigned int, nr_sector, nr_bytes >> 9)
+               ctf_integer(int, error, blk_status_to_errno(error))
+               blk_rwbs_ctf_integer(unsigned int, rwbs,
+                       lttng_req_op(rq), lttng_req_rw(rq), nr_bytes)
+       )
+)
+#elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,12,0))
 LTTNG_TRACEPOINT_EVENT(block_rq_complete,
 
        TP_PROTO(struct request *rq, int error, unsigned int nr_bytes),
This page took 0.02684 seconds and 4 git commands to generate.