Commit 99dea2c6 authored by Andrii Nakryiko's avatar Andrii Nakryiko Committed by Alexei Starovoitov

selftests/bpf: fix selftest after random: Urandom_read tracepoint removal

14c17463 ("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: default avatarYonghong Song <yhs@fb.com>
Signed-off-by: default avatarAndrii Nakryiko <andrii@kernel.org>
Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
Acked-by: default avatarYonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/bpf/20220325225643.2606-1-andrii@kernel.org
parent c29a4920
...@@ -39,16 +39,8 @@ struct { ...@@ -39,16 +39,8 @@ struct {
__type(value, stack_trace_t); __type(value, stack_trace_t);
} stack_amap SEC(".maps"); } stack_amap SEC(".maps");
/* taken from /sys/kernel/debug/tracing/events/random/urandom_read/format */ SEC("kprobe/urandom_read")
struct random_urandom_args { int oncpu(struct pt_regs *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)
{ {
__u32 max_len = sizeof(struct bpf_stack_build_id) __u32 max_len = sizeof(struct bpf_stack_build_id)
* PERF_MAX_STACK_DEPTH; * PERF_MAX_STACK_DEPTH;
......
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