diff options
author | Andrii Nakryiko <andrii@kernel.org> | 2022-03-25 23:56:43 +0100 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2022-03-29 04:09:23 +0200 |
commit | 99dea2c664d7bc7e4f6f6947182d0d365165a998 (patch) | |
tree | ad66459f356c992b138d36f0b38af500a6efe359 /tools | |
parent | bpf: Fix maximum permitted number of arguments check (diff) | |
download | linux-99dea2c664d7bc7e4f6f6947182d0d365165a998.tar.xz linux-99dea2c664d7bc7e4f6f6947182d0d365165a998.zip |
selftests/bpf: fix selftest after random: Urandom_read tracepoint removal
14c174633f34 ("random: remove unused tracepoints") removed all the
tracepoints from drivers/char/random.c, one of which,
random:urandom_read, was used by stacktrace_build_id selftest to trigger
stack trace capture.
Fix breakage by switching to kprobing urandom_read() function.
Suggested-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Yonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/bpf/20220325225643.2606-1-andrii@kernel.org
Diffstat (limited to 'tools')
-rw-r--r-- | tools/testing/selftests/bpf/progs/test_stacktrace_build_id.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/tools/testing/selftests/bpf/progs/test_stacktrace_build_id.c b/tools/testing/selftests/bpf/progs/test_stacktrace_build_id.c index 36a707e7c7a7..6c62bfb8bb6f 100644 --- a/tools/testing/selftests/bpf/progs/test_stacktrace_build_id.c +++ b/tools/testing/selftests/bpf/progs/test_stacktrace_build_id.c @@ -39,16 +39,8 @@ struct { __type(value, stack_trace_t); } stack_amap SEC(".maps"); -/* taken from /sys/kernel/debug/tracing/events/random/urandom_read/format */ -struct random_urandom_args { - unsigned long long pad; - int got_bits; - int pool_left; - int input_left; -}; - -SEC("tracepoint/random/urandom_read") -int oncpu(struct random_urandom_args *args) +SEC("kprobe/urandom_read") +int oncpu(struct pt_regs *args) { __u32 max_len = sizeof(struct bpf_stack_build_id) * PERF_MAX_STACK_DEPTH; |