Skip to content

Commit 39601fd

Browse files
anakryikoNobody
authored andcommitted
selftests/bpf: fix selftest after random:urandom_read tracepoint removal
14c1746 ("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>
1 parent e6fd8a2 commit 39601fd

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

tools/testing/selftests/bpf/progs/test_stacktrace_build_id.c

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,8 @@ struct {
3939
__type(value, stack_trace_t);
4040
} stack_amap SEC(".maps");
4141

42-
/* taken from /sys/kernel/debug/tracing/events/random/urandom_read/format */
43-
struct random_urandom_args {
44-
unsigned long long pad;
45-
int got_bits;
46-
int pool_left;
47-
int input_left;
48-
};
49-
50-
SEC("tracepoint/random/urandom_read")
51-
int oncpu(struct random_urandom_args *args)
42+
SEC("kprobe/urandom_read")
43+
int oncpu(struct pt_regs *args)
5244
{
5345
__u32 max_len = sizeof(struct bpf_stack_build_id)
5446
* PERF_MAX_STACK_DEPTH;

0 commit comments

Comments
 (0)