diff options
author | Rob Norris <[email protected]> | 2024-02-29 11:25:24 +1100 |
---|---|---|
committer | Tony Hutter <[email protected]> | 2024-09-05 13:40:05 -0700 |
commit | 82ff9aafd687d4eebb6041c99fa822e0478a2024 (patch) | |
tree | 320aeb8b1ac6fbbdabcaf2e7be99b53626402292 /include/sys | |
parent | d4d79451cb87aa0d93f9068ce5844098a5ebe3b5 (diff) |
value strings: pretty printers for flags and enums
This adds zfs_valstr, a collection of pretty printers for bitfields and
enums. These are useful in debugging, logging and other display contexts
where raw values are difficult for the untrained (or even trained!) eye
to decipher.
Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
Signed-off-by: Rob Norris <[email protected]>
Diffstat (limited to 'include/sys')
-rw-r--r-- | include/sys/zio.h | 3 | ||||
-rw-r--r-- | include/sys/zio_impl.h | 3 | ||||
-rw-r--r-- | include/sys/zio_priority.h | 4 |
3 files changed, 10 insertions, 0 deletions
diff --git a/include/sys/zio.h b/include/sys/zio.h index 446b64ccd..3a756949a 100644 --- a/include/sys/zio.h +++ b/include/sys/zio.h @@ -167,6 +167,9 @@ typedef enum zio_suspend_reason { * This was originally an enum type. However, those are 32-bit and there is no * way to make a 64-bit enum type. Since we ran out of bits for flags, we were * forced to upgrade it to a uint64_t. + * + * NOTE: PLEASE UPDATE THE BITFIELD STRINGS IN zfs_valstr.c IF YOU ADD ANOTHER + * FLAG. */ typedef uint64_t zio_flag_t; /* diff --git a/include/sys/zio_impl.h b/include/sys/zio_impl.h index 2b026d486..2c846a5d4 100644 --- a/include/sys/zio_impl.h +++ b/include/sys/zio_impl.h @@ -120,6 +120,9 @@ extern "C" { /* * zio pipeline stage definitions + * + * NOTE: PLEASE UPDATE THE BITFIELD STRINGS IN zfs_valstr.c IF YOU ADD ANOTHER + * FLAG. */ enum zio_stage { ZIO_STAGE_OPEN = 1 << 0, /* RWFCXT */ diff --git a/include/sys/zio_priority.h b/include/sys/zio_priority.h index 2d8e7fc36..bdf5f9b8f 100644 --- a/include/sys/zio_priority.h +++ b/include/sys/zio_priority.h @@ -22,6 +22,10 @@ extern "C" { #endif +/* + * NOTE: PLEASE UPDATE THE ENUM STRINGS IN zfs_valstr.c IF YOU ADD ANOTHER + * VALUE. + */ typedef enum zio_priority { ZIO_PRIORITY_SYNC_READ, ZIO_PRIORITY_SYNC_WRITE, /* ZIL */ |