summaryrefslogtreecommitdiff
path: root/blkiomon.c
diff options
context:
space:
mode:
authorMartin Peschke <mpeschke@linux.vnet.ibm.com>2008-10-28 17:08:12 +0100
committerJens Axboe <jens.axboe@oracle.com>2008-10-28 19:09:41 +0100
commit53cab5f58afd61525674ba7d6de8ac111f173a90 (patch)
tree842943a73a1d4d89b5abec9272bcc16ac4498d0e /blkiomon.c
parent29ec9a38dabc610005c5b8d11dba2a0824117c97 (diff)
downloadblktrace-53cab5f58afd61525674ba7d6de8ac111f173a90.tar.gz
blktrace-53cab5f58afd61525674ba7d6de8ac111f173a90.tar.bz2
blkiomon: add through-put statistics
Add accounting of per-request throughput in bytes per millisecond both for read ad write I/O. Signed-off-by: Martin Peschke <mpeschke@linux.vnet.ibm.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'blkiomon.c')
-rw-r--r--blkiomon.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/blkiomon.c b/blkiomon.c
index b53dfd9..2066006 100644
--- a/blkiomon.c
+++ b/blkiomon.c
@@ -316,6 +316,7 @@ static int blkiomon_account(struct blk_io_trace *bit_d,
struct blkiomon_stat *p;
__u64 d2c = (bit_c->time - bit_d->time) / 1000; /* ns -> us */
__u32 size = bit_d->bytes;
+ __u64 thrput = size * 1000 / d2c;
dstat = blkiomon_get_dstat(bit_d->device);
if (!dstat)
@@ -323,9 +324,11 @@ static int blkiomon_account(struct blk_io_trace *bit_d,
p = &dstat->msg.stat;
if (BLK_DATADIR(bit_c->action) & BLK_TC_READ) {
+ minmax_account(&p->thrput_r, thrput);
minmax_account(&p->size_r, size);
minmax_account(&p->d2c_r, d2c);
} else if (BLK_DATADIR(bit_c->action) & BLK_TC_WRITE) {
+ minmax_account(&p->thrput_w, thrput);
minmax_account(&p->size_w, size);
minmax_account(&p->d2c_w, d2c);
} else