From: Mykyta Yatsenko <mykyta.yatsenko5@gmail.com>
To: bot+bpf-ci@kernel.org, bpf@vger.kernel.org, ast@kernel.org,
andrii@kernel.org, daniel@iogearbox.net, kafai@meta.com,
kernel-team@meta.com, eddyz87@gmail.com, memxor@gmail.com,
peterz@infradead.org, rostedt@goodmis.org
Cc: yatsenko@meta.com, martin.lau@kernel.org,
yonghong.song@linux.dev, clm@meta.com, ihor.solodrai@linux.dev
Subject: Re: [PATCH bpf-next v13 6/6] selftests/bpf: Add tests for sleepable tracepoint programs
Date: Wed, 22 Apr 2026 21:37:16 +0100 [thread overview]
Message-ID: <df7094ce-c286-4201-af8e-442eb7a97743@gmail.com> (raw)
In-Reply-To: <0ca1420ce830b146a1ed429af9af7bb489a7959bad702d7080d3be6a325a483d@mail.kernel.org>
On 4/22/26 9:30 PM, bot+bpf-ci@kernel.org wrote:
>> diff --git a/tools/testing/selftests/bpf/prog_tests/sleepable_tracepoints.c b/tools/testing/selftests/bpf/prog_tests/sleepable_tracepoints.c
>> --- /dev/null
>> +++ b/tools/testing/selftests/bpf/prog_tests/sleepable_tracepoints.c
>
> [ ... ]
>
>> @@ -0,0 +1,142 @@
>> +void test_sleepable_tracepoints(void)
>> +{
>> + struct test_sleepable_tracepoints *skel;
>> +
>> + skel = test_sleepable_tracepoints__open_and_load();
>> + if (!ASSERT_OK_PTR(skel, "open_and_load"))
>> + return;
>> +
>> + if (test__start_subtest("tp_btf"))
>> + run_auto_attach_test(skel->progs.handle_sys_enter_tp_btf, skel);
>> + if (test__start_subtest("raw_tp"))
>> + run_auto_attach_test(skel->progs.handle_sys_enter_raw_tp, skel);
>> + if (test__start_subtest("tracepoint"))
>> + run_auto_attach_test(skel->progs.handle_sys_enter_tp, skel);
>> + if (test__start_subtest("sys_exit"))
>> + run_auto_attach_test(skel->progs.handle_sys_exit_tp, skel);
>> + if (test__start_subtest("tracepoint_alias"))
>> + test_attach_only(skel->progs.handle_sys_enter_tp_alias);
>> + if (test__start_subtest("raw_tracepoint_alias"))
>> + test_attach_only(skel->progs.handle_sys_enter_raw_tp_alias);
>> + if (test__start_subtest("raw_tp_bare"))
>> + test_raw_tp_bare(skel);
>> + if (test__start_subtest("tp_bare"))
>> + test_tp_bare(skel);
>> + if (test__start_subtest("test_run"))
>> + test_test_run(skel);
>> + if (test__start_subtest("test_run_on_cpu_reject"))
>> + test_test_run_on_cpu_reject(skel);
>> + if (test__start_subtest("raw_tp_non_faultable"))
>> + test_attach_reject(skel->progs.handle_raw_tp_non_faultable);
>> + if (test__start_subtest("tp_non_syscall"))
>> + test_attach_reject(skel->progs.handle_tp_non_syscall);
>> + if (test__start_subtest("tp_btf_non_faultable_reject"))
>> + RUN_TESTS(test_sleepable_tracepoints_fail);
>> +
>> + test_sleepable_tracepoints__destroy(skel);
>> +}
>
> In v8, Andrii Nakryiko suggested simplifying this test structure by using
> an array-based approach instead of individual if statements for each test
> case:
>
> "why not have an array
>
> struct { const char *name; struct bpf_program *prog } cases[] = {
> { "tp_btf", skel->progs.handle_sys_enter_tp_btf},
> ...
> }
>
> and then do the tests in a loop?"
>
> Reference: https://lore.kernel.org/bpf/CAEf4BzZ_YOb1MNpUxuhFESqRWARFiBJ6yGZ-Z8xBqdCvqi_Bow@mail.gmail.com/
>
> Would an array-driven approach reduce repetition and make it easier to
> maintain as new test cases are added?
>
I did array-driven approach around v10, but then after few de-claudings
and simplifications ended up with this structure that is more common in
our selftests. This implementation reuses test logic via generic
functions, like test_attach_only() or run_auto_attach_test().
I find it's even better this way.
> [ ... ]
>
>
> ---
> AI reviewed your patch. Please fix the bug or email reply why it's not a bug.
> See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/README.md
>
> CI run summary: https://github.com/kernel-patches/bpf/actions/runs/24799223877
next prev parent reply other threads:[~2026-04-22 20:37 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-22 19:41 [PATCH bpf-next v13 0/6] bpf: Add support for sleepable tracepoint programs Mykyta Yatsenko
2026-04-22 19:41 ` [PATCH bpf-next v13 1/6] bpf: Add sleepable support for raw " Mykyta Yatsenko
2026-04-22 19:41 ` [PATCH bpf-next v13 2/6] bpf: Add bpf_prog_run_array_sleepable() Mykyta Yatsenko
2026-04-22 19:41 ` [PATCH bpf-next v13 3/6] bpf: Add sleepable support for classic tracepoint programs Mykyta Yatsenko
2026-04-22 20:57 ` bot+bpf-ci
2026-04-23 13:42 ` Mykyta Yatsenko
2026-04-22 23:35 ` sashiko-bot
2026-04-23 13:38 ` Mykyta Yatsenko
2026-04-22 19:41 ` [PATCH bpf-next v13 4/6] bpf: Verifier support for sleepable " Mykyta Yatsenko
2026-04-22 19:41 ` [PATCH bpf-next v13 5/6] libbpf: Add section handlers for sleepable tracepoints Mykyta Yatsenko
2026-04-22 19:41 ` [PATCH bpf-next v13 6/6] selftests/bpf: Add tests for sleepable tracepoint programs Mykyta Yatsenko
2026-04-22 20:30 ` bot+bpf-ci
2026-04-22 20:37 ` Mykyta Yatsenko [this message]
2026-04-22 20:49 ` Kumar Kartikeya Dwivedi
2026-04-22 21:00 ` [PATCH bpf-next v13 0/6] bpf: Add support " patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=df7094ce-c286-4201-af8e-442eb7a97743@gmail.com \
--to=mykyta.yatsenko5@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bot+bpf-ci@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=clm@meta.com \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=ihor.solodrai@linux.dev \
--cc=kafai@meta.com \
--cc=kernel-team@meta.com \
--cc=martin.lau@kernel.org \
--cc=memxor@gmail.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=yatsenko@meta.com \
--cc=yonghong.song@linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.