* [PATCH] trace event block fix unassigned field
@ 2011-01-06 18:43 Mathieu Desnoyers
2011-01-06 19:42 ` Jens Axboe
0 siblings, 1 reply; 3+ messages in thread
From: Mathieu Desnoyers @ 2011-01-06 18:43 UTC (permalink / raw)
To: Jeff Moyer, Mathieu Desnoyers, Steven Rostedt
Cc: Frederic Weisbecker, Ingo Molnar, Thomas Gleixner, Jens Axboe,
Li Zefan, Alan.Brunelle, linux-kernel
The "error" field in block_bio_complete is not assigned, leaving the memory area
uninitialized (keeping garbage data). Pass an additional tracepoint argument to
this event to initialize this field.
From: Jeff Moyer <jmoyer@redhat.com>
Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
CC: Steven Rostedt <rostedt@goodmis.org>
CC: Frederic Weisbecker <fweisbec@gmail.com>
CC: Ingo Molnar <mingo@elte.hu>
CC: Thomas Gleixner <tglx@linutronix.de>
CC: Jens Axboe <axboe@kernel.dk>
CC: Li Zefan <lizf@cn.fujitsu.com>
CC: Alan.Brunelle@hp.com
---
drivers/md/dm.c | 2 +-
include/trace/events/block.h | 6 ++++--
2 files changed, 5 insertions(+), 3 deletions(-)
Index: linux-2.6-lttng/include/trace/events/block.h
===================================================================
--- linux-2.6-lttng.orig/include/trace/events/block.h
+++ linux-2.6-lttng/include/trace/events/block.h
@@ -206,15 +206,16 @@ TRACE_EVENT(block_bio_bounce,
* block_bio_complete - completed all work on the block operation
* @q: queue holding the block operation
* @bio: block operation completed
+ * @error: io error value
*
* This tracepoint indicates there is no further work to do on this
* block IO operation @bio.
*/
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),
+ TP_ARGS(q, bio, error),
TP_STRUCT__entry(
__field( dev_t, dev )
@@ -228,6 +229,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);
),
Index: linux-2.6-lttng/drivers/md/dm.c
===================================================================
--- linux-2.6-lttng.orig/drivers/md/dm.c
+++ linux-2.6-lttng/drivers/md/dm.c
@@ -659,7 +659,7 @@ static void dec_pending(struct dm_io *io
free_io(md, io);
if (io_error != DM_ENDIO_REQUEUE) {
- trace_block_bio_complete(md->queue, bio);
+ trace_block_bio_complete(md->queue, bio, io_error);
bio_endio(bio, io_error);
}
--
Mathieu Desnoyers
Operating System Efficiency R&D Consultant
EfficiOS Inc.
http://www.efficios.com
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] trace event block fix unassigned field
2011-01-06 18:43 [PATCH] trace event block fix unassigned field Mathieu Desnoyers
@ 2011-01-06 19:42 ` Jens Axboe
2011-01-06 19:54 ` Mathieu Desnoyers
0 siblings, 1 reply; 3+ messages in thread
From: Jens Axboe @ 2011-01-06 19:42 UTC (permalink / raw)
To: Mathieu Desnoyers
Cc: Jeff Moyer, Steven Rostedt, Frederic Weisbecker, Ingo Molnar,
Thomas Gleixner, Li Zefan, Alan.Brunelle, linux-kernel
On 2011-01-06 19:43, Mathieu Desnoyers wrote:
> The "error" field in block_bio_complete is not assigned, leaving the
> memory area uninitialized (keeping garbage data). Pass an additional
> tracepoint argument to this event to initialize this field.
Thanks guys, applied.
--
Jens Axboe
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] trace event block fix unassigned field
2011-01-06 19:42 ` Jens Axboe
@ 2011-01-06 19:54 ` Mathieu Desnoyers
0 siblings, 0 replies; 3+ messages in thread
From: Mathieu Desnoyers @ 2011-01-06 19:54 UTC (permalink / raw)
To: Jens Axboe
Cc: Jeff Moyer, Steven Rostedt, Frederic Weisbecker, Ingo Molnar,
Thomas Gleixner, Li Zefan, Alan.Brunelle, linux-kernel
* Jens Axboe (axboe@kernel.dk) wrote:
> On 2011-01-06 19:43, Mathieu Desnoyers wrote:
> > The "error" field in block_bio_complete is not assigned, leaving the
> > memory area uninitialized (keeping garbage data). Pass an additional
> > tracepoint argument to this event to initialize this field.
>
> Thanks guys, applied.
Thanks Jens. A side-note for Frederic and Steven: for this patch specifically,
going through the block layer tree seems like the right approach, because we
also modify the tracepoint caller code.
Thanks,
Mathieu
--
Mathieu Desnoyers
Operating System Efficiency R&D Consultant
EfficiOS Inc.
http://www.efficios.com
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-01-06 19:54 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-06 18:43 [PATCH] trace event block fix unassigned field Mathieu Desnoyers
2011-01-06 19:42 ` Jens Axboe
2011-01-06 19:54 ` Mathieu Desnoyers
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox