* [PATCH v2 bpf-next] selftests/bpf: fix selftest after random:urandom_read tracepoint removal
@ 2022-03-25 22:56 Andrii Nakryiko
2022-03-25 23:05 ` Yonghong Song
2022-03-29 2:20 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Andrii Nakryiko @ 2022-03-25 22:56 UTC (permalink / raw)
To: bpf, ast, daniel; +Cc: andrii, kernel-team, Yonghong Song
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>
---
.../selftests/bpf/progs/test_stacktrace_build_id.c | 12 ++----------
1 file 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 36a707e7c7a7..6c62bfb8bb6f 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;
--
2.30.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2 bpf-next] selftests/bpf: fix selftest after random:urandom_read tracepoint removal
2022-03-25 22:56 [PATCH v2 bpf-next] selftests/bpf: fix selftest after random:urandom_read tracepoint removal Andrii Nakryiko
@ 2022-03-25 23:05 ` Yonghong Song
2022-03-29 2:20 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Yonghong Song @ 2022-03-25 23:05 UTC (permalink / raw)
To: Andrii Nakryiko, bpf, ast, daniel; +Cc: kernel-team
On 3/25/22 3:56 PM, Andrii Nakryiko wrote:
> 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>
Acked-by: Yonghong Song <yhs@fb.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2 bpf-next] selftests/bpf: fix selftest after random:urandom_read tracepoint removal
2022-03-25 22:56 [PATCH v2 bpf-next] selftests/bpf: fix selftest after random:urandom_read tracepoint removal Andrii Nakryiko
2022-03-25 23:05 ` Yonghong Song
@ 2022-03-29 2:20 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-03-29 2:20 UTC (permalink / raw)
To: Andrii Nakryiko; +Cc: bpf, ast, daniel, kernel-team, yhs
Hello:
This patch was applied to bpf/bpf.git (master)
by Alexei Starovoitov <ast@kernel.org>:
On Fri, 25 Mar 2022 15:56:43 -0700 you wrote:
> 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.
>
> [...]
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!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-03-29 2:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-25 22:56 [PATCH v2 bpf-next] selftests/bpf: fix selftest after random:urandom_read tracepoint removal Andrii Nakryiko
2022-03-25 23:05 ` Yonghong Song
2022-03-29 2:20 ` patchwork-bot+netdevbpf
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.