Skip to contentSkip to conversation

blktrace: log dropped REQ_OP_ZONE_XXX events ver1

PATCH In review Chaitanya Kulkarni 5 participants 6 messages Oct 28, 2025 – Dec 23, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 blktrace: log dropped REQ_OP_ZONE_XXX events ver1

Add informational messages during blktrace setup when version 1 tools are used on kernels with CONFIG_BLK_DEV_ZONED enabled. This alerts users that REQ_OP_ZONE_* events will be dropped and suggests upgrading to blktrace tools version 2 or later.

The warning is printed once during trace setup to inform users about the limitation without spamming the logs during tracing operations. Version 2 blktrace tools properly handle zone management operations (zone reset, zone open, zone close, zone finish, zone append) that were added for zoned block devices.

Example output:

blktests (master) # ./check blktrace
blktrace/001 (blktrace zone management command tracing) [passed]

    runtime  0.110s  ...  3.917s
blktrace/002 (blktrace ftrace corruption with sysfs trace)   [passed]
    runtime  0.333s  ...  0.608s
blktests (master) # dmesg -c
[   57.610592] blktrace: nullb0: blktrace events for REQ_OP_ZONE_XXX will be dropped
[   57.610603] blktrace: use blktrace tools version >= 2 to track REQ_OP_ZONE_XXX

This helps users understand why zone operation traces may be missing when using older blktrace tool versions with modern kernels that support REQ_OP_ZONE_XXX in blktrace.

---
v1->v2 :-

Remove the extra () around IS_ENABLED(CONFIG_BLK_DEV_ZONED). (Jens) Add a space after device name in first pr_info(). (Jens)

---
 kernel/trace/blktrace.c | 6 ++++++
 1 file changed, 6 insertions(+)
kernel/trace/blktrace.c +6 -0
index e4f26ddb7ee2..4a37d9aa0481 100644
@@ -739,6 +739,12 @@ static void blk_trace_setup_finalize(struct request_queue *q,
 	 */
 	strreplace(buts->name, '/', '_');
 
+	if (version == 1 && IS_ENABLED(CONFIG_BLK_DEV_ZONED)) {
+		pr_info("%s: blktrace events for REQ_OP_ZONE_XXX will be dropped\n",
+				name);
+		pr_info("use blktrace tools version >= 2 to track REQ_OP_ZONE_XXX\n");
+	}
+
 	bt->version = version;
 	bt->act_mask = buts->act_mask;
 	if (!bt->act_mask)
Signature · 1 line
2.40.0
#1 lore raw

kernel/trace/blktrace.c static void blk_trace_setup_finalize(struct request_queue *q, · line 745

Quoted 4 lines · Chaitanya Kulkarni
kernel/trace/blktrace.c +4 -0
+	if (version == 1 && IS_ENABLED(CONFIG_BLK_DEV_ZONED)) {
+		pr_info("%s: blktrace events for REQ_OP_ZONE_XXX will be dropped\n",
+				name);
+		pr_info("use blktrace tools version >= 2 to track REQ_OP_ZONE_XXX\n");

Jens hasn't merged the user-space part yet and I'm not sure he'll assign a dedicated version number for it. So I'd say hold this until he has.

#2 lore raw
Quoted 8 lines · Johannes Thumshirn

kernel/trace/blktrace.c static void blk_trace_setup_finalize(struct request_queue *q, · line 745

Quoted 4 lines · Chaitanya Kulkarni
kernel/trace/blktrace.c +4 -0
+	if (version == 1 && IS_ENABLED(CONFIG_BLK_DEV_ZONED)) {
+		pr_info("%s: blktrace events for REQ_OP_ZONE_XXX will be dropped\n",
+				name);
+		pr_info("use blktrace tools version >= 2 to track REQ_OP_ZONE_XXX\n");

Jens hasn't merged the user-space part yet and I'm not sure he'll assign a dedicated version number for it. So I'd say hold this until he has.

Now Jen's has merged the userspace part, may I please get a reviewed-by if this looks good?

-ck

Reviewed-by on v2 1/1
#3 lore raw
In reply to Chaitanya Kulkarni
Quoted 42 lines · Chaitanya Kulkarni

Add informational messages during blktrace setup when version 1 tools are used on kernels with CONFIG_BLK_DEV_ZONED enabled. This alerts users that REQ_OP_ZONE_* events will be dropped and suggests upgrading to blktrace tools version 2 or later.

The warning is printed once during trace setup to inform users about the limitation without spamming the logs during tracing operations. Version 2 blktrace tools properly handle zone management operations (zone reset, zone open, zone close, zone finish, zone append) that were added for zoned block devices.

Example output:

blktests (master) # ./check blktrace
blktrace/001 (blktrace zone management command tracing) [passed]

    runtime  0.110s  ...  3.917s
blktrace/002 (blktrace ftrace corruption with sysfs trace)   [passed]
    runtime  0.333s  ...  0.608s
blktests (master) # dmesg -c
[   57.610592] blktrace: nullb0: blktrace events for REQ_OP_ZONE_XXX will be dropped
[   57.610603] blktrace: use blktrace tools version >= 2 to track REQ_OP_ZONE_XXX

This helps users understand why zone operation traces may be missing when using older blktrace tool versions with modern kernels that support REQ_OP_ZONE_XXX in blktrace.

---
v1->v2 :-

Remove the extra () around IS_ENABLED(CONFIG_BLK_DEV_ZONED). (Jens) Add a space after device name in first pr_info(). (Jens)

---
 kernel/trace/blktrace.c | 6 ++++++
 1 file changed, 6 insertions(+)
kernel/trace/blktrace.c +0 -0
index e4f26ddb7ee2..4a37d9aa0481 100644

kernel/trace/blktrace.c static void blk_trace_setup_finalize(struct request_queue *q, · line 745

Quoted 7 lines
kernel/trace/blktrace.c +4 -0
@@ -739,6 +739,12 @@ static void blk_trace_setup_finalize(struct request_queue *q,
 	 */
 	strreplace(buts->name, '/', '_');
 
+	if (version == 1 && IS_ENABLED(CONFIG_BLK_DEV_ZONED)) {
+		pr_info("%s: blktrace events for REQ_OP_ZONE_XXX will be dropped\n",
+				name);
+		pr_info("use blktrace tools version >= 2 to track REQ_OP_ZONE_XXX\n");

Please change REQ_OP_ZONE_XXX to "zone operations" in these messages. That is a little more general, so better I think since we also trace zone write plug/unplug events, which are not REQ_OP_ZONE_XXX.

With that done,

Quoted 5 lines
kernel/trace/blktrace.c +2 -0
+	}
+
 	bt->version = version;
 	bt->act_mask = buts->act_mask;
 	if (!bt->act_mask)
Signature · 2 lines
Damien Le Moal
Western Digital Research
maintainer
#4 lore raw
Quoted 46 lines · Damien Le Moal
Quoted 45 lines · Chaitanya Kulkarni

Add informational messages during blktrace setup when version 1 tools are used on kernels with CONFIG_BLK_DEV_ZONED enabled. This alerts users that REQ_OP_ZONE_* events will be dropped and suggests upgrading to blktrace tools version 2 or later.

The warning is printed once during trace setup to inform users about the limitation without spamming the logs during tracing operations. Version 2 blktrace tools properly handle zone management operations (zone reset, zone open, zone close, zone finish, zone append) that were added for zoned block devices.

Example output:

blktests (master) # ./check blktrace
blktrace/001 (blktrace zone management command tracing) [passed]

    runtime  0.110s  ...  3.917s
blktrace/002 (blktrace ftrace corruption with sysfs trace)   [passed]
    runtime  0.333s  ...  0.608s
blktests (master) # dmesg -c
[   57.610592] blktrace: nullb0: blktrace events for REQ_OP_ZONE_XXX will be dropped
[   57.610603] blktrace: use blktrace tools version >= 2 to track REQ_OP_ZONE_XXX

This helps users understand why zone operation traces may be missing when using older blktrace tool versions with modern kernels that support REQ_OP_ZONE_XXX in blktrace.

---
v1->v2 :-

Remove the extra () around IS_ENABLED(CONFIG_BLK_DEV_ZONED). (Jens) Add a space after device name in first pr_info(). (Jens)

---
 kernel/trace/blktrace.c | 6 ++++++
 1 file changed, 6 insertions(+)
kernel/trace/blktrace.c +0 -0
index e4f26ddb7ee2..4a37d9aa0481 100644
@@ -739,6 +739,12 @@ static void blk_trace_setup_finalize(struct request_queue *q,
 	 */
 	strreplace(buts->name, '/', '_');
 
Quoted 8 lines

kernel/trace/blktrace.c static void blk_trace_setup_finalize(struct request_queue *q, · line 745

Quoted 4 lines
kernel/trace/blktrace.c +4 -0
+	if (version == 1 && IS_ENABLED(CONFIG_BLK_DEV_ZONED)) {
+		pr_info("%s: blktrace events for REQ_OP_ZONE_XXX will be dropped\n",
+				name);
+		pr_info("use blktrace tools version >= 2 to track REQ_OP_ZONE_XXX\n");

Please change REQ_OP_ZONE_XXX to "zone operations" in these messages. That is a little more general, so better I think since we also trace zone write plug/unplug events, which are not REQ_OP_ZONE_XXX.

Agree, REQ_OP_ZONE_XXX means nothing in userspace.

Signature · 1 line
Jens Axboe
#5 lore raw
Quoted 10 lines · Jens Axboe
Quoted 10 lines

kernel/trace/blktrace.c static void blk_trace_setup_finalize(struct request_queue *q, · line 745

Quoted 7 lines
  	 */
  	strreplace(buts->name, '/', '_');
kernel/trace/blktrace.c +4 -0
+	if (version == 1 && IS_ENABLED(CONFIG_BLK_DEV_ZONED)) {
+		pr_info("%s: blktrace events for REQ_OP_ZONE_XXX will be dropped\n",
+				name);
+		pr_info("use blktrace tools version >= 2 to track REQ_OP_ZONE_XXX\n");

Please change REQ_OP_ZONE_XXX to "zone operations" in these messages. That is a little more general, so better I think since we also trace zone write plug/unplug events, which are not REQ_OP_ZONE_XXX.

Quoted 3 lines

Agree, REQ_OP_ZONE_XXX means nothing in userspace.

-- Jens Axboe

Thanks Damien and Jens for comment.

Will send out V3 soon.

-ck