diff options
author | Andrii Nakryiko <andrii@kernel.org> | 2022-03-25 15:56:43 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-06-14 18:36:10 +0200 |
commit | 8969c3b1051eadc9b016c0b2dcfc0eeadcfbf566 (patch) | |
tree | c66c095a6a7c298b1a5fbe10cf4536896076fde7 /tools/testing | |
parent | 5ff2514e4fb55dcf3d88294686040ca73ea0c1a2 (diff) | |
download | linux-stable-8969c3b1051eadc9b016c0b2dcfc0eeadcfbf566.tar.gz linux-stable-8969c3b1051eadc9b016c0b2dcfc0eeadcfbf566.tar.bz2 linux-stable-8969c3b1051eadc9b016c0b2dcfc0eeadcfbf566.zip |
selftests/bpf: fix selftest after random: Urandom_read tracepoint removal
[ Upstream commit 99dea2c664d7bc7e4f6f6947182d0d365165a998 ]
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
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'tools/testing')
-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 0cf0134631b4..08aee18d9ded 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; |