selftests/bpf: fix selftest after random: Urandom_read tracepoint removal
14c174633f ("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
This commit is contained in:
committed by
Alexei Starovoitov
parent
c29a4920df
commit
99dea2c664
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user