Skip to content

Commit d2e614c

Browse files
DanielTimLeeborkmann
authored andcommitted
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>
1 parent da4e023 commit d2e614c

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

‎samples/bpf/task_fd_query_kern.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include <uapi/linux/bpf.h>
55
#include "bpf_helpers.h"
66

7-
SEC("kprobe/blk_start_request")
7+
SEC("kprobe/blk_mq_start_request")
88
int bpf_prog1(struct pt_regs *ctx)
99
{
1010
return 0;

‎samples/bpf/task_fd_query_user.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ int main(int argc, char **argv)
311311
}
312312

313313
/* 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",
315315
BPF_FD_TYPE_KPROBE));
316316
CHECK_AND_RET(test_debug_fs_kprobe(1, "blk_account_io_completion",
317317
BPF_FD_TYPE_KRETPROBE));

‎samples/bpf/tracex3_kern.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ struct bpf_map_def SEC("maps") my_map = {
2020
/* kprobe is NOT a stable ABI. If kernel internals change this bpf+kprobe
2121
* example will no longer be meaningful
2222
*/
23-
SEC("kprobe/blk_start_request")
23+
SEC("kprobe/blk_mq_start_request")
2424
int bpf_prog1(struct pt_regs *ctx)
2525
{
2626
long rq = PT_REGS_PARM1(ctx);

0 commit comments

Comments
 (0)