diff options
author | Hengqi Chen <hengqi.chen@gmail.com> | 2023-05-20 08:40:57 +0000 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2023-05-24 08:38:59 -0600 |
commit | 5a80bd075f3bce24793ae1aeb06066895ec5aef0 (patch) | |
tree | 55ba9c3be2d53893e59f33f5dfba04818141fa25 /block/blk-mq.c | |
parent | a13bd91be22318768d55470cbc0b0f4488ef9edf (diff) | |
download | linux-rpi-5a80bd075f3bce24793ae1aeb06066895ec5aef0.tar.gz linux-rpi-5a80bd075f3bce24793ae1aeb06066895ec5aef0.tar.bz2 linux-rpi-5a80bd075f3bce24793ae1aeb06066895ec5aef0.zip |
block: introduce block_io_start/block_io_done tracepoints
Currently, several BCC ([0]) tools (biosnoop/biostacks/biotop) use
kprobes to blk_account_io_start/blk_account_io_done to implement
their functionalities. This is fragile because the target kernel
functions may be renamed ([1]) or inlined ([2]). So introduce two
new tracepoints for such use cases.
[0]: https://github.com/iovisor/bcc
[1]: https://github.com/iovisor/bcc/issues/3954
[2]: https://github.com/iovisor/bcc/issues/4261
Tested-by: Francis Laniel <flaniel@linux.microsoft.com>
Signed-off-by: Hengqi Chen <hengqi.chen@gmail.com>
Tested-by: Yonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/r/20230520084057.1467003-1-hengqi.chen@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-mq.c')
-rw-r--r-- | block/blk-mq.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c index 551e7760f45e..1749f5890606 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -962,6 +962,8 @@ EXPORT_SYMBOL_GPL(blk_update_request); static inline void blk_account_io_done(struct request *req, u64 now) { + trace_block_io_done(req); + /* * Account IO completion. flush_rq isn't accounted as a * normal IO on queueing nor completion. Accounting the @@ -981,6 +983,8 @@ static inline void blk_account_io_done(struct request *req, u64 now) static inline void blk_account_io_start(struct request *req) { + trace_block_io_start(req); + if (blk_do_io_stat(req)) { /* * All non-passthrough requests are created from a bio with one |