Commit 59ed76fe authored by Song Liu's avatar Song Liu Committed by Alexei Starovoitov

selftests/bpf: fix stacktrace_build_id with missing kprobe/urandom_read

Kernel function urandom_read is replaced with urandom_read_iter.
Therefore, kprobe on urandom_read is not working any more:

[root@eth50-1 bpf]# ./test_progs -n 161
test_stacktrace_build_id:PASS:skel_open_and_load 0 nsec
libbpf: kprobe perf_event_open() failed: No such file or directory
libbpf: prog 'oncpu': failed to create kprobe 'urandom_read+0x0' \
        perf event: No such file or directory
libbpf: prog 'oncpu': failed to auto-attach: -2
test_stacktrace_build_id:FAIL:attach_tp err -2
161     stacktrace_build_id:FAIL

Fix this by replacing urandom_read with urandom_read_iter in the test.

Fixes: 1b388e77 ("random: convert to using fops->read_iter()")
Reported-by: default avatarMykola Lysenko <mykolal@fb.com>
Signed-off-by: default avatarSong Liu <song@kernel.org>
Acked-by: default avatarDavid Vernet <void@manifault.com>
Link: https://lore.kernel.org/r/20220526191608.2364049-1-song@kernel.orgSigned-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
parent 2c262b21
...@@ -39,7 +39,7 @@ struct { ...@@ -39,7 +39,7 @@ struct {
__type(value, stack_trace_t); __type(value, stack_trace_t);
} stack_amap SEC(".maps"); } stack_amap SEC(".maps");
SEC("kprobe/urandom_read") SEC("kprobe/urandom_read_iter")
int oncpu(struct pt_regs *args) int oncpu(struct pt_regs *args)
{ {
__u32 max_len = sizeof(struct bpf_stack_build_id) __u32 max_len = sizeof(struct bpf_stack_build_id)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment