samples: bpf: fix: broken sample regarding removed function
authorDaniel T. Lee <danieltimlee@gmail.com>
Wed, 27 Feb 2019 07:52:26 +0000 (02:52 -0500)
committerDaniel Borkmann <daniel@iogearbox.net>
Wed, 27 Feb 2019 16:27:22 +0000 (17:27 +0100)
Currently, running sample "task_fd_query" and "tracex3" occurs the
following error. On kernel v5.0-rc* this sample will be unavailable
due to the removal of function 'blk_start_request' at commit "a1ce35f".
(function removed, as "Single Queue IO scheduler" no longer exists)

$ sudo ./task_fd_query
failed to create kprobe 'blk_start_request' error 'No such file or
directory'

This commit will change the function 'blk_start_request' to
'blk_mq_start_request' to fix the broken sample.

Signed-off-by: Daniel T. Lee <danieltimlee@gmail.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
samples/bpf/task_fd_query_kern.c
samples/bpf/task_fd_query_user.c
samples/bpf/tracex3_kern.c

index f4b0a9ea674d65eba3ca4ff2ba4b4c6fe1f5dc24..fb56fc2a3e5d6b40d7f7e4895dff463fc673e549 100644 (file)
@@ -4,7 +4,7 @@
 #include <uapi/linux/bpf.h>
 #include "bpf_helpers.h"
 
-SEC("kprobe/blk_start_request")
+SEC("kprobe/blk_mq_start_request")
 int bpf_prog1(struct pt_regs *ctx)
 {
        return 0;
index 8381d792f13800e98854f7be0aea4675d6b661c6..aff2b4ae914ee00acda73ef0c025a7500de42923 100644 (file)
@@ -311,7 +311,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_start_request",
+       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",
                                           BPF_FD_TYPE_KRETPROBE));
index 9974c3d7c18b90f5850e87822a158c90e2645b8d..ea1d4c19c1328e81246c37ac2b523f9964091553 100644 (file)
@@ -20,7 +20,7 @@ struct bpf_map_def SEC("maps") my_map = {
 /* kprobe is NOT a stable ABI. If kernel internals change this bpf+kprobe
  * example will no longer be meaningful
  */
-SEC("kprobe/blk_start_request")
+SEC("kprobe/blk_mq_start_request")
 int bpf_prog1(struct pt_regs *ctx)
 {
        long rq = PT_REGS_PARM1(ctx);