]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
blktrace: add zoned block commands to blk_fill_rwbs
authorJohannes Thumshirn <johannes.thumshirn@wdc.com>
Tue, 15 Jul 2025 11:53:20 +0000 (13:53 +0200)
committerJens Axboe <axboe@kernel.dk>
Tue, 15 Jul 2025 14:03:48 +0000 (08:03 -0600)
Add zoned block commands to blk_fill_rwbs:

- ZONE APPEND will be decoded as 'ZA'
- ZONE RESET will be decoded as 'ZR'
- ZONE RESET ALL will be decoded as 'ZRA'
- ZONE FINISH will be decoded as 'ZF'
- ZONE OPEN will be decoded as 'ZO'
- ZONE CLOSE will be decoded as 'ZC'

Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Link: https://lore.kernel.org/r/20250715115324.53308-2-johannes.thumshirn@wdc.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
include/trace/events/block.h
kernel/trace/blktrace.c

index 14a924c0e3037ff5092222fba39decff5cbdaa12..d88669b3ce0258759f77c2f864b4fa4c6e207c59 100644 (file)
@@ -11,7 +11,7 @@
 #include <linux/tracepoint.h>
 #include <uapi/linux/ioprio.h>
 
-#define RWBS_LEN       9
+#define RWBS_LEN       10
 
 #define IOPRIO_CLASS_STRINGS \
        { IOPRIO_CLASS_NONE,    "none" }, \
index 3f6a7bdc6edf68a8a36c77c974ed9346cb770a60..47168d2afbf1567f40e6507c8867249af4e89f96 100644 (file)
@@ -1875,6 +1875,29 @@ void blk_fill_rwbs(char *rwbs, blk_opf_t opf)
        case REQ_OP_READ:
                rwbs[i++] = 'R';
                break;
+       case REQ_OP_ZONE_APPEND:
+               rwbs[i++] = 'Z';
+               rwbs[i++] = 'A';
+               break;
+       case REQ_OP_ZONE_RESET:
+       case REQ_OP_ZONE_RESET_ALL:
+               rwbs[i++] = 'Z';
+               rwbs[i++] = 'R';
+               if ((opf & REQ_OP_MASK) == REQ_OP_ZONE_RESET_ALL)
+                       rwbs[i++] = 'A';
+               break;
+       case REQ_OP_ZONE_FINISH:
+               rwbs[i++] = 'Z';
+               rwbs[i++] = 'F';
+               break;
+       case REQ_OP_ZONE_OPEN:
+               rwbs[i++] = 'Z';
+               rwbs[i++] = 'O';
+               break;
+       case REQ_OP_ZONE_CLOSE:
+               rwbs[i++] = 'Z';
+               rwbs[i++] = 'C';
+               break;
        default:
                rwbs[i++] = 'N';
        }
@@ -1890,6 +1913,8 @@ void blk_fill_rwbs(char *rwbs, blk_opf_t opf)
        if (opf & REQ_ATOMIC)
                rwbs[i++] = 'U';
 
+       WARN_ON_ONCE(i >= RWBS_LEN);
+
        rwbs[i] = '\0';
 }
 EXPORT_SYMBOL_GPL(blk_fill_rwbs);