]> git.baikalelectronics.ru Git - kernel.git/commit
samples/bpf: fix bio latency check with tracepoint
authorDaniel T. Lee <danieltimlee@gmail.com>
Fri, 18 Aug 2023 09:01:16 +0000 (18:01 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Sep 2023 07:42:34 +0000 (09:42 +0200)
commitc813db76bc1531ae33d9d748ef9d211d802ae580
tree9b550329f08e592da828b7c2f7382456bfaf7986
parentef67f3a959a75c793668ca6db14afaed69645ea7
samples/bpf: fix bio latency check with tracepoint

[ Upstream commit 92632115fb57ff9e368f256913e96d6fd5abf5ab ]

Recently, a new tracepoint for the block layer, specifically the
block_io_start/done tracepoints, was introduced in commit 5a80bd075f3b
("block: introduce block_io_start/block_io_done tracepoints").

Previously, the kprobe entry used for this purpose was quite unstable
and inherently broke relevant probes [1]. Now that a stable tracepoint
is available, this commit replaces the bio latency check with it.

One of the changes made during this replacement is the key used for the
hash table. Since 'struct request' cannot be used as a hash key, the
approach taken follows that which was implemented in bcc/biolatency [2].
(uses dev:sector for the key)

[1]: https://github.com/iovisor/bcc/issues/4261
[2]: https://github.com/iovisor/bcc/pull/4691

Fixes: 450b7879e345 ("block: move blk_account_io_{start,done} to blk-mq.c")
Signed-off-by: Daniel T. Lee <danieltimlee@gmail.com>
Link: https://lore.kernel.org/r/20230818090119.477441-7-danieltimlee@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
samples/bpf/tracex3_kern.c