[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <x498vyzqten.fsf@segfault.boston.devel.redhat.com>
Date: Wed, 05 Jan 2011 10:09:20 -0500
From: Jeff Moyer <jmoyer@...hat.com>
To: Mathieu Desnoyers <mathieu.desnoyers@...icios.com>
Cc: LKML <linux-kernel@...r.kernel.org>,
Steven Rostedt <rostedt@...dmis.org>,
Frederic Weisbecker <fweisbec@...il.com>,
Ingo Molnar <mingo@...e.hu>,
Thomas Gleixner <tglx@...utronix.de>,
Jens Axboe <jens.axboe@...cle.com>,
Li Zefan <lizf@...fujitsu.com>, Alan.Brunelle@...com
Subject: Re: [RFC patch 1/5] trace event block fix unassigned field
Mathieu Desnoyers <mathieu.desnoyers@...icios.com> writes:
> The "error" field in block_bio_complete is not assigned, leaving the memory area
> uninitialized (keeping garbage data). Initialize it to 0.
>
> We should eventually remove this field when we find out if blktrace can live
> without it.
Well, I'm fairly sure blkparse has the ability to print this field out,
so we should probably just fill it in properly. Something like the
following untested patch should do.
Cheers,
Jeff
Signed-off-by: Jeff Moyer <jmoyer@...hat.com>
diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index 7cb1352..f4d83f2 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -630,7 +630,7 @@ static void dec_pending(struct dm_io *io, int error)
queue_io(md, bio);
} else {
/* done with normal IO or empty flush */
- trace_block_bio_complete(md->queue, bio);
+ trace_block_bio_complete(md->queue, bio, io_error);
bio_endio(bio, io_error);
}
}
diff --git a/include/trace/events/block.h b/include/trace/events/block.h
index d8ce278..8990a62 100644
--- a/include/trace/events/block.h
+++ b/include/trace/events/block.h
@@ -212,7 +212,7 @@ TRACE_EVENT(block_bio_bounce,
*/
TRACE_EVENT(block_bio_complete,
- TP_PROTO(struct request_queue *q, struct bio *bio),
+ TP_PROTO(struct request_queue *q, struct bio *bio, int error),
TP_ARGS(q, bio),
@@ -228,6 +228,7 @@ TRACE_EVENT(block_bio_complete,
__entry->dev = bio->bi_bdev->bd_dev;
__entry->sector = bio->bi_sector;
__entry->nr_sector = bio->bi_size >> 9;
+ __entry->error = error;
blk_fill_rwbs(__entry->rwbs, bio->bi_rw, bio->bi_size);
),
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists