Skip to content

Commit

Permalink
Record additional ZIO fields in zevents
Browse files Browse the repository at this point in the history
Record the type, priority, and reexecute fields of a ZIO in the
zevent log.  This may provide helpful debugging information if
a ZIO is hung.

Signed-off-by: Ned Bass <bass6@llnl.gov>

Issue openzfs#1928
  • Loading branch information
nedbass authored and Tim Chase committed May 7, 2015
1 parent f0da4d1 commit b91d3f1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions include/sys/fm/fs/zfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ extern "C" {
#define FM_EREPORT_PAYLOAD_ZFS_ZIO_TIMESTAMP "zio_timestamp"
#define FM_EREPORT_PAYLOAD_ZFS_ZIO_DEADLINE "zio_deadline"
#define FM_EREPORT_PAYLOAD_ZFS_ZIO_DELTA "zio_delta"
#define FM_EREPORT_PAYLOAD_ZFS_ZIO_PRIORITY "zio_priority"
#define FM_EREPORT_PAYLOAD_ZFS_ZIO_REEXECUTE "zio_reexecute"
#define FM_EREPORT_PAYLOAD_ZFS_ZIO_TYPE "zio_type"
#define FM_EREPORT_PAYLOAD_ZFS_PREV_STATE "prev_state"
#define FM_EREPORT_PAYLOAD_ZFS_CKSUM_EXPECTED "cksum_expected"
#define FM_EREPORT_PAYLOAD_ZFS_CKSUM_ACTUAL "cksum_actual"
Expand Down
6 changes: 6 additions & 0 deletions module/zfs/zfs_fm.c
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,12 @@ zfs_ereport_start(nvlist_t **ereport_out, nvlist_t **detector_out,
DATA_TYPE_UINT64, zio->io_timestamp, NULL);
fm_payload_set(ereport, FM_EREPORT_PAYLOAD_ZFS_ZIO_DELTA,
DATA_TYPE_UINT64, zio->io_delta, NULL);
fm_payload_set(ereport, FM_EREPORT_PAYLOAD_ZFS_ZIO_PRIORITY,
DATA_TYPE_UINT32, zio->io_priority, NULL);
fm_payload_set(ereport, FM_EREPORT_PAYLOAD_ZFS_ZIO_REEXECUTE,
DATA_TYPE_UINT32, zio->io_reexecute, NULL);
fm_payload_set(ereport, FM_EREPORT_PAYLOAD_ZFS_ZIO_TYPE,
DATA_TYPE_UINT8, zio->io_type, NULL);

/*
* If the 'size' parameter is non-zero, it indicates this is a
Expand Down

0 comments on commit b91d3f1

Please sign in to comment.