mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ryo Tsuruta <ryov@valinux.co.jp>
To: jens.axboe@oracle.com
Cc: linux-kernel@vger.kernel.org
Subject: [BUGFIX] index of rq.count[]
Date: Tue, 28 Jul 2009 22:06:23 +0900 (JST)	[thread overview]
Message-ID: <20090728.220623.39170303.ryov@valinux.co.jp> (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(-)

Index: linux-2.6.31-rc4/kernel/trace/blktrace.c
===================================================================
--- linux-2.6.31-rc4.orig/kernel/trace/blktrace.c
+++ 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,
Index: linux-2.6.31-rc4/include/trace/events/block.h
===================================================================
--- linux-2.6.31-rc4.orig/include/trace/events/block.h
+++ 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);
 	),

             reply	other threads:[~2009-07-28 13:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-28 13:06 Ryo Tsuruta [this message]
2009-07-28 20:21 ` Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090728.220623.39170303.ryov@valinux.co.jp \
    --to=ryov@valinux.co.jp \
    --cc=jens.axboe@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®