Skip to contentSkip to conversation

index of rq.count[]

BUGFIX Ryo Tsuruta 2 participants 2 messages Jul 28, 2009

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

Hi,

The following patch corrects that the index of rq.count[] should use BLK_RW_SYNC/BLK_RW_ASYNC instead of READ/WRITE.

Thanks,
Ryo Tsuruta

---
 include/trace/events/block.h |    6 ++++--
 kernel/trace/blktrace.c      |    6 ++++--
 2 files changed, 8 insertions(+), 4 deletions(-)
kernel/trace/blktrace.c +4 -2
Index: linux-2.6.31-rc4/kernel/trace/blktrace.c
===================================================================
@@ -796,7 +796,8 @@ static void blk_add_trace_unplug_io(stru
 	struct blk_trace *bt = q->blk_trace;
 
 	if (bt) {
-		unsigned int pdu = q->rq.count[READ] + q->rq.count[WRITE];
+		unsigned int pdu =
+			q->rq.count[BLK_RW_SYNC] + q->rq.count[BLK_RW_ASYNC];
 		__be64 rpdu = cpu_to_be64(pdu);
 
 		__blk_add_trace(bt, 0, 0, 0, BLK_TA_UNPLUG_IO, 0,
@@ -809,7 +810,8 @@ static void blk_add_trace_unplug_timer(s
 	struct blk_trace *bt = q->blk_trace;
 
 	if (bt) {
-		unsigned int pdu = q->rq.count[READ] + q->rq.count[WRITE];
+		unsigned int pdu =
+			q->rq.count[BLK_RW_SYNC] + q->rq.count[BLK_RW_ASYNC];
 		__be64 rpdu = cpu_to_be64(pdu);
 
 		__blk_add_trace(bt, 0, 0, 0, BLK_TA_UNPLUG_TIMER, 0,
include/trace/events/block.h +4 -2
Index: linux-2.6.31-rc4/include/trace/events/block.h
===================================================================
@@ -397,7 +397,8 @@ TRACE_EVENT(block_unplug_timer,
 	),
 
 	TP_fast_assign(
-		__entry->nr_rq	= q->rq.count[READ] + q->rq.count[WRITE];
+		__entry->nr_rq	=
+			q->rq.count[BLK_RW_SYNC] + q->rq.count[BLK_RW_ASYNC];
 		memcpy(__entry->comm, current->comm, TASK_COMM_LEN);
 	),
 
@@ -416,7 +417,8 @@ TRACE_EVENT(block_unplug_io,
 	),
 
 	TP_fast_assign(
-		__entry->nr_rq	= q->rq.count[READ] + q->rq.count[WRITE];
+		__entry->nr_rq	=
+			q->rq.count[BLK_RW_SYNC] + q->rq.count[BLK_RW_ASYNC];
 		memcpy(__entry->comm, current->comm, TASK_COMM_LEN);
 	),
#1 lore raw
Quoted 4 lines · Ryo Tsuruta

Hi,

The following patch corrects that the index of rq.count[] should use BLK_RW_SYNC/BLK_RW_ASYNC instead of READ/WRITE.

It's not a bug fix as such, since they are both 0 and 1. But for clarity it should be changed, that can wait until .32 though.

Signature · 1 line
Jens Axboe