diff options
author | Daniel T. Lee <danieltimlee@gmail.com> | 2019-02-27 02:52:26 -0500 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2019-02-27 11:27:22 -0500 |
commit | d2e614cb0795d935aee879e47aab231247274f13 (patch) | |
tree | 3004ab61b1ad0e1611083510111f3faa8d3c61d0 /samples/bpf | |
parent | da4e023e452801204f645a502e87352d7f17689d (diff) |
samples: bpf: fix: broken sample regarding removed function
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>
Diffstat (limited to 'samples/bpf')
-rw-r--r-- | samples/bpf/task_fd_query_kern.c | 2 | ||||
-rw-r--r-- | samples/bpf/task_fd_query_user.c | 2 | ||||
-rw-r--r-- | samples/bpf/tracex3_kern.c | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/samples/bpf/task_fd_query_kern.c b/samples/bpf/task_fd_query_kern.c index f4b0a9ea674d..fb56fc2a3e5d 100644 --- a/samples/bpf/task_fd_query_kern.c +++ b/samples/bpf/task_fd_query_kern.c | |||
@@ -4,7 +4,7 @@ | |||
4 | #include <uapi/linux/bpf.h> | 4 | #include <uapi/linux/bpf.h> |
5 | #include "bpf_helpers.h" | 5 | #include "bpf_helpers.h" |
6 | 6 | ||
7 | SEC("kprobe/blk_start_request") | 7 | SEC("kprobe/blk_mq_start_request") |
8 | int bpf_prog1(struct pt_regs *ctx) | 8 | int bpf_prog1(struct pt_regs *ctx) |
9 | { | 9 | { |
10 | return 0; | 10 | return 0; |
diff --git a/samples/bpf/task_fd_query_user.c b/samples/bpf/task_fd_query_user.c index 8381d792f138..aff2b4ae914e 100644 --- a/samples/bpf/task_fd_query_user.c +++ b/samples/bpf/task_fd_query_user.c | |||
@@ -311,7 +311,7 @@ int main(int argc, char **argv) | |||
311 | } | 311 | } |
312 | 312 | ||
313 | /* test two functions in the corresponding *_kern.c file */ | 313 | /* test two functions in the corresponding *_kern.c file */ |
314 | CHECK_AND_RET(test_debug_fs_kprobe(0, "blk_start_request", | 314 | CHECK_AND_RET(test_debug_fs_kprobe(0, "blk_mq_start_request", |
315 | BPF_FD_TYPE_KPROBE)); | 315 | BPF_FD_TYPE_KPROBE)); |
316 | CHECK_AND_RET(test_debug_fs_kprobe(1, "blk_account_io_completion", | 316 | CHECK_AND_RET(test_debug_fs_kprobe(1, "blk_account_io_completion", |
317 | BPF_FD_TYPE_KRETPROBE)); | 317 | BPF_FD_TYPE_KRETPROBE)); |
diff --git a/samples/bpf/tracex3_kern.c b/samples/bpf/tracex3_kern.c index 9974c3d7c18b..ea1d4c19c132 100644 --- a/samples/bpf/tracex3_kern.c +++ b/samples/bpf/tracex3_kern.c | |||
@@ -20,7 +20,7 @@ struct bpf_map_def SEC("maps") my_map = { | |||
20 | /* kprobe is NOT a stable ABI. If kernel internals change this bpf+kprobe | 20 | /* kprobe is NOT a stable ABI. If kernel internals change this bpf+kprobe |
21 | * example will no longer be meaningful | 21 | * example will no longer be meaningful |
22 | */ | 22 | */ |
23 | SEC("kprobe/blk_start_request") | 23 | SEC("kprobe/blk_mq_start_request") |
24 | int bpf_prog1(struct pt_regs *ctx) | 24 | int bpf_prog1(struct pt_regs *ctx) |
25 | { | 25 | { |
26 | long rq = PT_REGS_PARM1(ctx); | 26 | long rq = PT_REGS_PARM1(ctx); |