Skip to content

Commit a636ed1

Browse files
morbidrsakawasaki
authored andcommitted
blktrace: add zoned block commands to blk_fill_rwbs
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 <[email protected]> Signed-off-by: Johannes Thumshirn <[email protected]>
1 parent 81f31a4 commit a636ed1

2 files changed

Lines changed: 26 additions & 1 deletion

File tree

include/trace/events/block.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#include <linux/tracepoint.h>
1212
#include <uapi/linux/ioprio.h>
1313

14-
#define RWBS_LEN 9
14+
#define RWBS_LEN 10
1515

1616
#define IOPRIO_CLASS_STRINGS \
1717
{ IOPRIO_CLASS_NONE, "none" }, \

kernel/trace/blktrace.c

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1875,6 +1875,29 @@ void blk_fill_rwbs(char *rwbs, blk_opf_t opf)
18751875
case REQ_OP_READ:
18761876
rwbs[i++] = 'R';
18771877
break;
1878+
case REQ_OP_ZONE_APPEND:
1879+
rwbs[i++] = 'Z';
1880+
rwbs[i++] = 'A';
1881+
break;
1882+
case REQ_OP_ZONE_RESET:
1883+
case REQ_OP_ZONE_RESET_ALL:
1884+
rwbs[i++] = 'Z';
1885+
rwbs[i++] = 'R';
1886+
if ((opf & REQ_OP_MASK) == REQ_OP_ZONE_RESET_ALL)
1887+
rwbs[i++] = 'A';
1888+
break;
1889+
case REQ_OP_ZONE_FINISH:
1890+
rwbs[i++] = 'Z';
1891+
rwbs[i++] = 'F';
1892+
break;
1893+
case REQ_OP_ZONE_OPEN:
1894+
rwbs[i++] = 'Z';
1895+
rwbs[i++] = 'O';
1896+
break;
1897+
case REQ_OP_ZONE_CLOSE:
1898+
rwbs[i++] = 'Z';
1899+
rwbs[i++] = 'C';
1900+
break;
18781901
default:
18791902
rwbs[i++] = 'N';
18801903
}
@@ -1890,6 +1913,8 @@ void blk_fill_rwbs(char *rwbs, blk_opf_t opf)
18901913
if (opf & REQ_ATOMIC)
18911914
rwbs[i++] = 'U';
18921915

1916+
WARN_ON_ONCE(i >= RWBS_LEN);
1917+
18931918
rwbs[i] = '\0';
18941919
}
18951920
EXPORT_SYMBOL_GPL(blk_fill_rwbs);

0 commit comments

Comments
 (0)