Skip to content

Commit 2bf8c7e

Browse files
DanielTimLeeAlexei Starovoitov
authored andcommitted
samples: bpf: Fix broken bpf programs due to removed symbol
>From commit f1394b7 ("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
1 parent e3ec1e8 commit 2bf8c7e

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
@@ -10,7 +10,7 @@ int bpf_prog1(struct pt_regs *ctx)
1010
return 0;
1111
}
1212

13-
SEC("kretprobe/blk_account_io_completion")
13+
SEC("kretprobe/blk_account_io_done")
1414
int bpf_prog2(struct pt_regs *ctx)
1515
{
1616
return 0;

‎samples/bpf/task_fd_query_user.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ int main(int argc, char **argv)
314314
/* test two functions in the corresponding *_kern.c file */
315315
CHECK_AND_RET(test_debug_fs_kprobe(0, "blk_mq_start_request",
316316
BPF_FD_TYPE_KPROBE));
317-
CHECK_AND_RET(test_debug_fs_kprobe(1, "blk_account_io_completion",
317+
CHECK_AND_RET(test_debug_fs_kprobe(1, "blk_account_io_done",
318318
BPF_FD_TYPE_KRETPROBE));
319319

320320
/* test nondebug fs kprobe */

‎samples/bpf/tracex3_kern.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ struct {
4949
__uint(max_entries, SLOTS);
5050
} lat_map SEC(".maps");
5151

52-
SEC("kprobe/blk_account_io_completion")
52+
SEC("kprobe/blk_account_io_done")
5353
int bpf_prog2(struct pt_regs *ctx)
5454
{
5555
long rq = PT_REGS_PARM1(ctx);

0 commit comments

Comments
 (0)