Commit 2bf8c7e7 authored by Daniel T. Lee's avatar Daniel T. Lee Committed by Alexei Starovoitov

samples: bpf: Fix broken bpf programs due to removed symbol

>From commit f1394b79 ("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: default avatarDaniel T. Lee <danieltimlee@gmail.com>
Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
Acked-by: default avatarYonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/bpf/20200818051641.21724-1-danieltimlee@gmail.com
parent e3ec1e8c
...@@ -10,7 +10,7 @@ int bpf_prog1(struct pt_regs *ctx) ...@@ -10,7 +10,7 @@ int bpf_prog1(struct pt_regs *ctx)
return 0; return 0;
} }
SEC("kretprobe/blk_account_io_completion") SEC("kretprobe/blk_account_io_done")
int bpf_prog2(struct pt_regs *ctx) int bpf_prog2(struct pt_regs *ctx)
{ {
return 0; return 0;
......
...@@ -314,7 +314,7 @@ int main(int argc, char **argv) ...@@ -314,7 +314,7 @@ int main(int argc, char **argv)
/* test two functions in the corresponding *_kern.c file */ /* test two functions in the corresponding *_kern.c file */
CHECK_AND_RET(test_debug_fs_kprobe(0, "blk_mq_start_request", CHECK_AND_RET(test_debug_fs_kprobe(0, "blk_mq_start_request",
BPF_FD_TYPE_KPROBE)); BPF_FD_TYPE_KPROBE));
CHECK_AND_RET(test_debug_fs_kprobe(1, "blk_account_io_completion", CHECK_AND_RET(test_debug_fs_kprobe(1, "blk_account_io_done",
BPF_FD_TYPE_KRETPROBE)); BPF_FD_TYPE_KRETPROBE));
/* test nondebug fs kprobe */ /* test nondebug fs kprobe */
......
...@@ -49,7 +49,7 @@ struct { ...@@ -49,7 +49,7 @@ struct {
__uint(max_entries, SLOTS); __uint(max_entries, SLOTS);
} lat_map SEC(".maps"); } lat_map SEC(".maps");
SEC("kprobe/blk_account_io_completion") SEC("kprobe/blk_account_io_done")
int bpf_prog2(struct pt_regs *ctx) int bpf_prog2(struct pt_regs *ctx)
{ {
long rq = PT_REGS_PARM1(ctx); long rq = PT_REGS_PARM1(ctx);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment