mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-25 13:14:07 +08:00
2bf8c7e735
>From commit f1394b7988
("block: mark blk_account_io_completion
static") symbol blk_account_io_completion() has been marked as static,
which makes it no longer possible to attach kprobe to this event.
Currently, there are broken samples due to this reason.
As a solution to this, attach kprobe events to blk_account_io_done()
to modify them to perform the same behavior as before.
Signed-off-by: Daniel T. Lee <danieltimlee@gmail.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Yonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/bpf/20200818051641.21724-1-danieltimlee@gmail.com
20 lines
410 B
C
20 lines
410 B
C
// SPDX-License-Identifier: GPL-2.0
|
|
#include <linux/version.h>
|
|
#include <linux/ptrace.h>
|
|
#include <uapi/linux/bpf.h>
|
|
#include <bpf/bpf_helpers.h>
|
|
|
|
SEC("kprobe/blk_mq_start_request")
|
|
int bpf_prog1(struct pt_regs *ctx)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
SEC("kretprobe/blk_account_io_done")
|
|
int bpf_prog2(struct pt_regs *ctx)
|
|
{
|
|
return 0;
|
|
}
|
|
char _license[] SEC("license") = "GPL";
|
|
u32 _version SEC("version") = LINUX_VERSION_CODE;
|