1.\"
2.\" CDDL HEADER START
3.\"
4.\" The contents of this file are subject to the terms of the
5.\" Common Development and Distribution License (the "License").
6.\" You may not use this file except in compliance with the License.
7.\"
8.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9.\" or https://opensource.org/licenses/CDDL-1.0.
10.\" See the License for the specific language governing permissions
11.\" and limitations under the License.
12.\"
13.\" When distributing Covered Code, include this CDDL HEADER in each
14.\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15.\" If applicable, add the following below this CDDL HEADER, with the
16.\" fields enclosed by brackets "[]" replaced with your own identifying
17.\" information: Portions Copyright [yyyy] [name of copyright owner]
18.\"
19.\" CDDL HEADER END
20.\"
21.\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved.
22.\" Copyright (c) 2012, 2018 by Delphix. All rights reserved.
23.\" Copyright (c) 2012 Cyril Plisko. All Rights Reserved.
24.\" Copyright (c) 2017 Datto Inc.
25.\" Copyright (c) 2018 George Melikov. All Rights Reserved.
26.\" Copyright 2017 Nexenta Systems, Inc.
27.\" Copyright (c) 2017 Open-E, Inc. All Rights Reserved.
28.\"
29.Dd May 27, 2021
30.Dt ZPOOL-EVENTS 8
31.Os
32.
33.Sh NAME
34.Nm zpool-events
35.Nd list recent events generated by kernel
36.Sh SYNOPSIS
37.Nm zpool
38.Cm events
39.Op Fl vHf
40.Op Ar pool
41.Nm zpool
42.Cm events
43.Fl c
44.
45.Sh DESCRIPTION
46Lists all recent events generated by the ZFS kernel modules.
47These events are consumed by the
48.Xr zed 8
49and used to automate administrative tasks such as replacing a failed device
50with a hot spare.
51For more information about the subclasses and event payloads
52that can be generated see
53.Sx EVENTS
54and the following sections.
55.
56.Sh OPTIONS
57.Bl -tag -compact -width Ds
58.It Fl c
59Clear all previous events.
60.It Fl f
61Follow mode.
62.It Fl H
63Scripted mode.
64Do not display headers, and separate fields by a
65single tab instead of arbitrary space.
66.It Fl v
67Print the entire payload for each event.
68.El
69.
70.Sh EVENTS
71These are the different event subclasses.
72The full event name would be
73.Sy ereport.fs.zfs.\& Ns Em SUBCLASS ,
74but only the last part is listed here.
75.Pp
76.Bl -tag -compact -width "vdev.bad_guid_sum"
77.It Sy checksum
78Issued when a checksum error has been detected.
79.It Sy io
80Issued when there is an I/O error in a vdev in the pool.
81.It Sy data
82Issued when there have been data errors in the pool.
83.It Sy deadman
84Issued when an I/O request is determined to be "hung", this can be caused
85by lost completion events due to flaky hardware or drivers.
86See
87.Sy zfs_deadman_failmode
88in
89.Xr zfs 4
90for additional information regarding "hung" I/O detection and configuration.
91.It Sy delay
92Issued when a completed I/O request exceeds the maximum allowed time
93specified by the
94.Sy zio_slow_io_ms
95module parameter.
96This can be an indicator of problems with the underlying storage device.
97The number of delay events is ratelimited by the
98.Sy zfs_slow_io_events_per_second
99module parameter.
100.It Sy config
101Issued every time a vdev change have been done to the pool.
102.It Sy zpool
103Issued when a pool cannot be imported.
104.It Sy zpool.destroy
105Issued when a pool is destroyed.
106.It Sy zpool.export
107Issued when a pool is exported.
108.It Sy zpool.import
109Issued when a pool is imported.
110.It Sy zpool.reguid
111Issued when a REGUID (new unique identifier for the pool have been regenerated)
112have been detected.
113.It Sy vdev.unknown
114Issued when the vdev is unknown.
115Such as trying to clear device errors on a vdev that have failed/been kicked
116from the system/pool and is no longer available.
117.It Sy vdev.open_failed
118Issued when a vdev could not be opened (because it didn't exist for example).
119.It Sy vdev.corrupt_data
120Issued when corrupt data have been detected on a vdev.
121.It Sy vdev.no_replicas
122Issued when there are no more replicas to sustain the pool.
123This would lead to the pool being
124.Em DEGRADED .
125.It Sy vdev.bad_guid_sum
126Issued when a missing device in the pool have been detected.
127.It Sy vdev.too_small
128Issued when the system (kernel) have removed a device, and ZFS
129notices that the device isn't there any more.
130This is usually followed by a
131.Sy probe_failure
132event.
133.It Sy vdev.bad_label
134Issued when the label is OK but invalid.
135.It Sy vdev.bad_ashift
136Issued when the ashift alignment requirement has increased.
137.It Sy vdev.remove
138Issued when a vdev is detached from a mirror (or a spare detached from a
139vdev where it have been used to replace a failed drive - only works if
140the original drive have been re-added).
141.It Sy vdev.clear
142Issued when clearing device errors in a pool.
143Such as running
144.Nm zpool Cm clear
145on a device in the pool.
146.It Sy vdev.check
147Issued when a check to see if a given vdev could be opened is started.
148.It Sy vdev.spare
149Issued when a spare have kicked in to replace a failed device.
150.It Sy vdev.autoexpand
151Issued when a vdev can be automatically expanded.
152.It Sy io_failure
153Issued when there is an I/O failure in a vdev in the pool.
154.It Sy probe_failure
155Issued when a probe fails on a vdev.
156This would occur if a vdev
157have been kicked from the system outside of ZFS (such as the kernel
158have removed the device).
159.It Sy log_replay
160Issued when the intent log cannot be replayed.
161The can occur in the case of a missing or damaged log device.
162.It Sy resilver.start
163Issued when a resilver is started.
164.It Sy resilver.finish
165Issued when the running resilver have finished.
166.It Sy scrub.start
167Issued when a scrub is started on a pool.
168.It Sy scrub.finish
169Issued when a pool has finished scrubbing.
170.It Sy scrub.abort
171Issued when a scrub is aborted on a pool.
172.It Sy scrub.resume
173Issued when a scrub is resumed on a pool.
174.It Sy scrub.paused
175Issued when a scrub is paused on a pool.
176.It Sy bootfs.vdev.attach
177.El
178.
179.Sh PAYLOADS
180This is the payload (data, information) that accompanies an
181event.
182.Pp
183For
184.Xr zed 8 ,
185these are set to uppercase and prefixed with
186.Sy ZEVENT_ .
187.Pp
188.Bl -tag -compact -width "vdev_cksum_errors"
189.It Sy pool
190Pool name.
191.It Sy pool_failmode
192Failmode -
193.Sy wait ,
194.Sy continue ,
195or
196.Sy panic .
197See the
198.Sy failmode
199property in
200.Xr zpoolprops 7
201for more information.
202.It Sy pool_guid
203The GUID of the pool.
204.It Sy pool_context
205The load state for the pool (0=none, 1=open, 2=import, 3=tryimport, 4=recover
2065=error).
207.It Sy vdev_guid
208The GUID of the vdev in question (the vdev failing or operated upon with
209.Nm zpool Cm clear ,
210etc.).
211.It Sy vdev_type
212Type of vdev -
213.Sy disk ,
214.Sy file ,
215.Sy mirror ,
216etc.
217See the
218.Sy Virtual Devices
219section of
220.Xr zpoolconcepts 7
221for more information on possible values.
222.It Sy vdev_path
223Full path of the vdev, including any
224.Em -partX .
225.It Sy vdev_devid
226ID of vdev (if any).
227.It Sy vdev_fru
228Physical FRU location.
229.It Sy vdev_state
230State of vdev (0=uninitialized, 1=closed, 2=offline, 3=removed, 4=failed to
231open, 5=faulted, 6=degraded, 7=healthy).
232.It Sy vdev_ashift
233The ashift value of the vdev.
234.It Sy vdev_complete_ts
235The time the last I/O request completed for the specified vdev.
236.It Sy vdev_delta_ts
237The time since the last I/O request completed for the specified vdev.
238.It Sy vdev_spare_paths
239List of spares, including full path and any
240.Em -partX .
241.It Sy vdev_spare_guids
242GUID(s) of spares.
243.It Sy vdev_read_errors
244How many read errors that have been detected on the vdev.
245.It Sy vdev_write_errors
246How many write errors that have been detected on the vdev.
247.It Sy vdev_cksum_errors
248How many checksum errors that have been detected on the vdev.
249.It Sy parent_guid
250GUID of the vdev parent.
251.It Sy parent_type
252Type of parent.
253See
254.Sy vdev_type .
255.It Sy parent_path
256Path of the vdev parent (if any).
257.It Sy parent_devid
258ID of the vdev parent (if any).
259.It Sy zio_objset
260The object set number for a given I/O request.
261.It Sy zio_object
262The object number for a given I/O request.
263.It Sy zio_level
264The indirect level for the block.
265Level 0 is the lowest level and includes data blocks.
266Values > 0 indicate metadata blocks at the appropriate level.
267.It Sy zio_blkid
268The block ID for a given I/O request.
269.It Sy zio_err
270The error number for a failure when handling a given I/O request,
271compatible with
272.Xr errno 3
273with the value of
274.Sy EBADE
275used to indicate a ZFS checksum error.
276.It Sy zio_offset
277The offset in bytes of where to write the I/O request for the specified vdev.
278.It Sy zio_size
279The size in bytes of the I/O request.
280.It Sy zio_flags
281The current flags describing how the I/O request should be handled.
282See the
283.Sy I/O FLAGS
284section for the full list of I/O flags.
285.It Sy zio_stage
286The current stage of the I/O in the pipeline.
287See the
288.Sy I/O STAGES
289section for a full list of all the I/O stages.
290.It Sy zio_pipeline
291The valid pipeline stages for the I/O.
292See the
293.Sy I/O STAGES
294section for a full list of all the I/O stages.
295.It Sy zio_delay
296The time elapsed (in nanoseconds) waiting for the block layer to complete the
297I/O request.
298Unlike
299.Sy zio_delta ,
300this does not include any vdev queuing time and is
301therefore solely a measure of the block layer performance.
302.It Sy zio_timestamp
303The time when a given I/O request was submitted.
304.It Sy zio_delta
305The time required to service a given I/O request.
306.It Sy prev_state
307The previous state of the vdev.
308.It Sy cksum_expected
309The expected checksum value for the block.
310.It Sy cksum_actual
311The actual checksum value for an errant block.
312.It Sy cksum_algorithm
313Checksum algorithm used.
314See
315.Xr zfsprops 7
316for more information on the available checksum algorithms.
317.It Sy cksum_byteswap
318Whether or not the data is byteswapped.
319.It Sy bad_ranges
320.No [\& Ns Ar start , end )
321pairs of corruption offsets.
322Offsets are always aligned on a 64-bit boundary,
323and can include some gaps of non-corruption.
324(See
325.Sy bad_ranges_min_gap )
326.It Sy bad_ranges_min_gap
327In order to bound the size of the
328.Sy bad_ranges
329array, gaps of non-corruption
330less than or equal to
331.Sy bad_ranges_min_gap
332bytes have been merged with
333adjacent corruption.
334Always at least 8 bytes, since corruption is detected on a 64-bit word basis.
335.It Sy bad_range_sets
336This array has one element per range in
337.Sy bad_ranges .
338Each element contains
339the count of bits in that range which were clear in the good data and set
340in the bad data.
341.It Sy bad_range_clears
342This array has one element per range in
343.Sy bad_ranges .
344Each element contains
345the count of bits for that range which were set in the good data and clear in
346the bad data.
347.It Sy bad_set_bits
348If this field exists, it is an array of
349.Pq Ar bad data No & ~( Ns Ar good data ) ;
350that is, the bits set in the bad data which are cleared in the good data.
351Each element corresponds a byte whose offset is in a range in
352.Sy bad_ranges ,
353and the array is ordered by offset.
354Thus, the first element is the first byte in the first
355.Sy bad_ranges
356range, and the last element is the last byte in the last
357.Sy bad_ranges
358range.
359.It Sy bad_cleared_bits
360Like
361.Sy bad_set_bits ,
362but contains
363.Pq Ar good data No & ~( Ns Ar bad data ) ;
364that is, the bits set in the good data which are cleared in the bad data.
365.It Sy bad_set_histogram
366If this field exists, it is an array of counters.
367Each entry counts bits set in a particular bit of a big-endian uint64 type.
368The first entry counts bits
369set in the high-order bit of the first byte, the 9th byte, etc, and the last
370entry counts bits set of the low-order bit of the 8th byte, the 16th byte, etc.
371This information is useful for observing a stuck bit in a parallel data path,
372such as IDE or parallel SCSI.
373.It Sy bad_cleared_histogram
374If this field exists, it is an array of counters.
375Each entry counts bit clears in a particular bit of a big-endian uint64 type.
376The first entry counts bits
377clears of the high-order bit of the first byte, the 9th byte, etc, and the
378last entry counts clears of the low-order bit of the 8th byte, the 16th byte,
379etc.
380This information is useful for observing a stuck bit in a parallel data
381path, such as IDE or parallel SCSI.
382.El
383.
384.Sh I/O STAGES
385The ZFS I/O pipeline is comprised of various stages which are defined below.
386The individual stages are used to construct these basic I/O
387operations: Read, Write, Free, Claim, and Ioctl.
388These stages may be
389set on an event to describe the life cycle of a given I/O request.
390.Pp
391.TS
392tab(:);
393l l l .
394Stage:Bit Mask:Operations
395_:_:_
396ZIO_STAGE_OPEN:0x00000001:RWFCI
397
398ZIO_STAGE_READ_BP_INIT:0x00000002:R----
399ZIO_STAGE_WRITE_BP_INIT:0x00000004:-W---
400ZIO_STAGE_FREE_BP_INIT:0x00000008:--F--
401ZIO_STAGE_ISSUE_ASYNC:0x00000010:RWF--
402ZIO_STAGE_WRITE_COMPRESS:0x00000020:-W---
403
404ZIO_STAGE_ENCRYPT:0x00000040:-W---
405ZIO_STAGE_CHECKSUM_GENERATE:0x00000080:-W---
406
407ZIO_STAGE_NOP_WRITE:0x00000100:-W---
408
409ZIO_STAGE_BRT_FREE:0x00000200:--F--
410
411ZIO_STAGE_DDT_READ_START:0x00000400:R----
412ZIO_STAGE_DDT_READ_DONE:0x00000800:R----
413ZIO_STAGE_DDT_WRITE:0x00001000:-W---
414ZIO_STAGE_DDT_FREE:0x00002000:--F--
415
416ZIO_STAGE_GANG_ASSEMBLE:0x00004000:RWFC-
417ZIO_STAGE_GANG_ISSUE:0x00008000:RWFC-
418
419ZIO_STAGE_DVA_THROTTLE:0x00010000:-W---
420ZIO_STAGE_DVA_ALLOCATE:0x00020000:-W---
421ZIO_STAGE_DVA_FREE:0x00040000:--F--
422ZIO_STAGE_DVA_CLAIM:0x00080000:---C-
423
424ZIO_STAGE_READY:0x00100000:RWFCI
425
426ZIO_STAGE_VDEV_IO_START:0x00200000:RW--I
427ZIO_STAGE_VDEV_IO_DONE:0x00400000:RW--I
428ZIO_STAGE_VDEV_IO_ASSESS:0x00800000:RW--I
429
430ZIO_STAGE_CHECKSUM_VERIFY:0x01000000:R----
431
432ZIO_STAGE_DONE:0x02000000:RWFCI
433.TE
434.
435.Sh I/O FLAGS
436Every I/O request in the pipeline contains a set of flags which describe its
437function and are used to govern its behavior.
438These flags will be set in an event as a
439.Sy zio_flags
440payload entry.
441.Pp
442.TS
443tab(:);
444l l .
445Flag:Bit Mask
446_:_
447ZIO_FLAG_DONT_AGGREGATE:0x00000001
448ZIO_FLAG_IO_REPAIR:0x00000002
449ZIO_FLAG_SELF_HEAL:0x00000004
450ZIO_FLAG_RESILVER:0x00000008
451ZIO_FLAG_SCRUB:0x00000010
452ZIO_FLAG_SCAN_THREAD:0x00000020
453ZIO_FLAG_PHYSICAL:0x00000040
454
455ZIO_FLAG_CANFAIL:0x00000080
456ZIO_FLAG_SPECULATIVE:0x00000100
457ZIO_FLAG_CONFIG_WRITER:0x00000200
458ZIO_FLAG_DONT_RETRY:0x00000400
459ZIO_FLAG_NODATA:0x00001000
460ZIO_FLAG_INDUCE_DAMAGE:0x00002000
461
462ZIO_FLAG_IO_ALLOCATING:0x00004000
463ZIO_FLAG_IO_RETRY:0x00008000
464ZIO_FLAG_PROBE:0x00010000
465ZIO_FLAG_TRYHARD:0x00020000
466ZIO_FLAG_OPTIONAL:0x00040000
467
468ZIO_FLAG_DONT_QUEUE:0x00080000
469ZIO_FLAG_DONT_PROPAGATE:0x00100000
470ZIO_FLAG_IO_BYPASS:0x00200000
471ZIO_FLAG_IO_REWRITE:0x00400000
472ZIO_FLAG_RAW_COMPRESS:0x00800000
473ZIO_FLAG_RAW_ENCRYPT:0x01000000
474
475ZIO_FLAG_GANG_CHILD:0x02000000
476ZIO_FLAG_DDT_CHILD:0x04000000
477ZIO_FLAG_GODFATHER:0x08000000
478ZIO_FLAG_NOPWRITE:0x10000000
479ZIO_FLAG_REEXECUTED:0x20000000
480ZIO_FLAG_DELEGATED:0x40000000
481ZIO_FLAG_FASTWRITE:0x80000000
482.TE
483.
484.Sh SEE ALSO
485.Xr zfs 4 ,
486.Xr zed 8 ,
487.Xr zpool-wait 8
488