selftests/bpf: fix selftest after random:urandom_read tracepoint removal
Subsystems (3)
Andrii Nakryiko
maintainerPATCH v2 1/1 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.
--- .../selftests/bpf/progs/test_stacktrace_build_id.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-)
tools/testing/selftests/bpf/progs/test_stacktrace_build_id.c +2 -10
@@ -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 ;
Signature · 1 line
2.30.2
Quoted 9 lines · Andrii Nakryiko
14c174633f34("random: remove unused tracepoints") removed all the tracepoints fromdrivers/char/random.c, one of which, random:urandom_read, was used bystacktrace_build_idselftest to trigger stack trace capture.Fix breakage by switching to kprobing
urandom_read()function.Suggested-by Yonghong Song <[email protected]>Signed-off-by Andrii Nakryiko <[email protected]>
This patch was applied to bpf/bpf.git (master) by Alexei Starovoitov <[email protected]>:
Hello:
This patch was applied to bpf/bpf.git (master)
by Alexei Starovoitov <[email protected]>:
Quoted 8 lines · On Fri, 25 Mar 2022 15:56:43 -0700 you wrote:
14c174633f34("random: remove unused tracepoints") removed all the tracepoints fromdrivers/char/random.c, one of which, random:urandom_read, was used bystacktrace_build_idselftest to trigger stack trace capture.Fix breakage by switching to kprobing
urandom_read()function.[...]
Here is the summary with links:
- [v2,bpf-next] selftests/bpf: fix selftest after random:urandom_read tracepoint removal
https://git.kernel.org/bpf/bpf/c/99dea2c664d7
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html