events: include zio type in IO error reports

Usually the IO type can be inferred from the other fields (in
particular, priority and flags) sometimes it's not easy to see. This is
just another little debug helper.

    May 27 2025 00:54:54.024110493 ereport.fs.zfs.data
            class = "ereport.fs.zfs.data"
            ena = 0x1f5ecfae600801
            ...
            zio_delta = 0x0
            zio_type = 0x2 [WRITE]
            zio_priority = 0x3 [ASYNC_WRITE]
            zio_objset = 0x0

Document zio_type and zio_priority.

Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: Rob Norris <rob.norris@klarasystems.com>
Closes #17381
This commit is contained in:
Rob Norris
2025-05-31 00:29:29 +10:00
committed by GitHub
parent 0c94d3838d
commit 44e3266894
8 changed files with 85 additions and 2 deletions
+57 -2
View File
@@ -26,9 +26,9 @@
.\" Copyright (c) 2018 George Melikov. All Rights Reserved.
.\" Copyright 2017 Nexenta Systems, Inc.
.\" Copyright (c) 2017 Open-E, Inc. All Rights Reserved.
.\" Copyright (c) 2024, Klara Inc.
.\" Copyright (c) 2024, 2025, Klara, Inc.
.\"
.Dd February 28, 2024
.Dd May 27, 2025
.Dt ZPOOL-EVENTS 8
.Os
.
@@ -308,6 +308,16 @@ The valid pipeline stages for the I/O.
See the
.Sy I/O STAGES
section for a full list of all the I/O stages.
.It Sy zio_priority
The queue priority of the I/O request.
See the
.Sy I/O PRIORITIES
section for a full list of all the I/O priorities.
.It Sy zio_tyoe
The type of the I/O request.
See the
.Sy I/O TYPES
section for a full list of all the I/O types.
.It Sy zio_delay
The time elapsed (in nanoseconds) waiting for the block layer to complete the
I/O request.
@@ -477,6 +487,51 @@ ZIO_FLAG_DELEGATED:0x40000000
ZIO_FLAG_FASTWRITE:0x80000000
.TE
.
.Sh I/O TYPES
Every I/O request in the pipeline has a single type value.
This value describes the kind of low-level work the I/O represents.
This value will be set in an event as a
.Sy zio_type
payload entry.
.Pp
.TS
tab(:);
l l l .
Type:Value:Description
_:_:_
ZIO_TYPE_NULL:0x0:internal I/O sync point
ZIO_TYPE_READ:0x1:data read
ZIO_TYPE_WRITE:0x2:data write
ZIO_TYPE_FREE:0x3:block free
ZIO_TYPE_CLAIM:0x4:block claim (ZIL replay)
ZIO_TYPE_FLUSH:0x5:disk cache flush request
ZIO_TYPE_TRIM:0x6:trim (discard)
.TE
.
.Sh I/O PRIORITIES
Every I/O request in the pipeline has a single priority value.
This value is used by the queuing code to decide which I/O to issue next.
This value will be set in an event as a
.Sy zio_priority
payload entry.
.Pp
.TS
tab(:);
l l l .
Type:Value:Description
_:_:_
ZIO_PRIORITY_SYNC_READ:0x0:
ZIO_PRIORITY_SYNC_WRITE:0x1:ZIL
ZIO_PRIORITY_ASYNC_READ:0x2:prefetch
ZIO_PRIORITY_ASYNC_WRITE:0x3:spa_sync()
ZIO_PRIORITY_SCRUB:0x4:asynchronous scrub/resilver reads
ZIO_PRIORITY_REMOVAL:0x5:reads/writes for vdev removal
ZIO_PRIORITY_INITIALIZING:0x6:initializing I/O
ZIO_PRIORITY_TRIM:0x7:trim I/O (discard)
ZIO_PRIORITY_REBUILD:0x8:reads/writes for vdev rebuild
ZIO_PRIORITY_NOW:0xa:non-queued i/os (e.g. free)
.TE
.
.Sh SEE ALSO
.Xr zfs 4 ,
.Xr zed 8 ,