samples: bpf: Fix broken bpf programs due to removed symbol
authorDaniel T. Lee <danieltimlee@gmail.com>
Tue, 18 Aug 2020 05:16:41 +0000 (14:16 +0900)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 19 Aug 2020 00:10:03 +0000 (17:10 -0700)
>From commit f1394b798814 ("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
samples/bpf/task_fd_query_kern.c
samples/bpf/task_fd_query_user.c
samples/bpf/tracex3_kern.c

index 278ade5427c83644a5a6eadc4c11ec59b37cfbd6..c821294e17742b36f2dc5262506cab193b813ba3 100644 (file)
@@ -10,7 +10,7 @@ int bpf_prog1(struct pt_regs *ctx)
        return 0;
 }
 
-SEC("kretprobe/blk_account_io_completion")
+SEC("kretprobe/blk_account_io_done")
 int bpf_prog2(struct pt_regs *ctx)
 {
        return 0;
index ff2e9c1c7266a23491b1f6cf40f8b554c2e5a78f..4a74531dc403105d0dac2204367af32652d48fd2 100644 (file)
@@ -314,7 +314,7 @@ int main(int argc, char **argv)
        /* test two functions in the corresponding *_kern.c file */
        CHECK_AND_RET(test_debug_fs_kprobe(0, "blk_mq_start_request",
                                           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));
 
        /* test nondebug fs kprobe */
index 659613c19a82ae5e07ee0e90f156165fba3ed32c..710a4410b2fb81b82eefff2ad9dc1d84829326bd 100644 (file)
@@ -49,7 +49,7 @@ struct {
        __uint(max_entries, SLOTS);
 } lat_map SEC(".maps");
 
-SEC("kprobe/blk_account_io_completion")
+SEC("kprobe/blk_account_io_done")
 int bpf_prog2(struct pt_regs *ctx)
 {
        long rq = PT_REGS_PARM1(ctx);