lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 17 Jan 2012 10:32:06 +0900
From:	Namhyung Kim <namhyung.kim@....com>
To:	Jens Axboe <axboe@...nel.dk>
Cc:	Namhyung Kim <namhyung@...il.com>, linux-kernel@...r.kernel.org,
	Tejun Heo <tj@...nel.org>, Steven Rostedt <rostedt@...dmis.org>
Subject: [PATCH 1/3] block: add missing block_bio_complete() tracepoint

The block_bio_complete() TP has been missed so long,
so that bio-based drivers haven't been able to trace
its IO behavior. Add it.

In some rare cases, such as loop_switch, @bio->bi_bdev
can be NULL. Thus convert it to TRACE_EVENT_CONDITION()
as Steven suggested.

>From now on, request-based drivers will also get
BLK_TA_COMPLETEs for all bio's in requests. This needs
to be handled in userland properly.

Signed-off-by: Namhyung Kim <namhyung.kim@....com>
Cc: Tejun Heo <tj@...nel.org>
Cc: Steven Rostedt <rostedt@...dmis.org>
---
 fs/bio.c                     |    2 ++
 include/trace/events/block.h |    4 +++-
 2 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/fs/bio.c b/fs/bio.c
index b1fe82cf88cf..14c03eaf384e 100644
--- a/fs/bio.c
+++ b/fs/bio.c
@@ -1447,6 +1447,8 @@ void bio_endio(struct bio *bio, int error)
 	else if (!test_bit(BIO_UPTODATE, &bio->bi_flags))
 		error = -EIO;
 
+	trace_block_bio_complete(bdev_get_queue(bio->bi_bdev), bio, error);
+
 	if (bio->bi_end_io)
 		bio->bi_end_io(bio, error);
 }
diff --git a/include/trace/events/block.h b/include/trace/events/block.h
index 05c5e61f0a7c..96955f4828b3 100644
--- a/include/trace/events/block.h
+++ b/include/trace/events/block.h
@@ -213,12 +213,14 @@ TRACE_EVENT(block_bio_bounce,
  * This tracepoint indicates there is no further work to do on this
  * block IO operation @bio.
  */
-TRACE_EVENT(block_bio_complete,
+TRACE_EVENT_CONDITION(block_bio_complete,
 
 	TP_PROTO(struct request_queue *q, struct bio *bio, int error),
 
 	TP_ARGS(q, bio, error),
 
+	TP_CONDITION(bio->bi_bdev != NULL),
+
 	TP_STRUCT__entry(
 		__field( dev_t,		dev		)
 		__field( sector_t,	sector		)
-- 
1.7.9.rc1.dirty

--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ