* [PATCH bpf-next] selftests/bpf: Expect at least one kprobe miss in missed/perf_kprobe
@ 2026-10-09 1:49 Qiliang Yuan
2026-10-21 0:02 ` Alexei Starovoitov
0 siblings, 1 reply; 2+ messages in thread
From: Qiliang Yuan @ 2026-10-09 1:49 UTC (permalink / raw)
To: Andrii Nakryiko, Eduard Zingerman, Ihor Solodrai,
Alexei Starovoitov, Daniel Borkmann, Kumar Kartikeya Dwivedi,
Martin KaFai Lau, Song Liu, Yonghong Song, Jiri Olsa,
Emil Tsalapatis, Shuah Khan, Hou Tao
Cc: bpf, linux-kselftest, linux-kernel, Qiliang Yuan
missed_kprobe attaches test1 to bpf_fentry_test1 and test2 to
bpf_kfunc_common_test, which test1 calls. test_missed_perf_kprobe()
expects the kprobe of test2 to miss exactly one run, the one test1
triggers, since kprobes don't nest.
bpf_kfunc_common_test is a kfunc of bpf_testmod that other tests call
as well. When one of them calls it from another kprobe while test2 is
attached, the kprobe of test2 counts an extra miss, and the test reads
2 instead of 1.
Expect at least one miss, as missed_kprobe_recursion does since
commit 08a7078feacf ("selftests/bpf: Improve missed_kprobe_recursion test robustness").
Fixes: 01e4ae474e39 ("selftests/bpf: Add test for missed counts of perf event link kprobe")
Signed-off-by: Qiliang Yuan <odys.yuan@gmail.com>
---
tools/testing/selftests/bpf/prog_tests/missed.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/bpf/prog_tests/missed.c b/tools/testing/selftests/bpf/prog_tests/missed.c
index ed8857ae914a6..dc91be982dd32 100644
--- a/tools/testing/selftests/bpf/prog_tests/missed.c
+++ b/tools/testing/selftests/bpf/prog_tests/missed.c
@@ -36,7 +36,7 @@ static void test_missed_perf_kprobe(void)
ASSERT_EQ(info.type, BPF_LINK_TYPE_PERF_EVENT, "info.type");
ASSERT_EQ(info.perf_event.type, BPF_PERF_EVENT_KPROBE, "info.perf_event.type");
- ASSERT_EQ(info.perf_event.kprobe.missed, 1, "info.perf_event.kprobe.missed");
+ ASSERT_GE(info.perf_event.kprobe.missed, 1, "info.perf_event.kprobe.missed");
cleanup:
missed_kprobe__destroy(skel);
---
base-commit: e1d84a37cba984388988d2f1ddc84561413f0db2
change-id: 20261009-selftests-bpf-missed-perf-kprobe-05471f2aec76
Best regards,
--
Qiliang Yuan <odys.yuan@gmail.com>
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH bpf-next] selftests/bpf: Expect at least one kprobe miss in missed/perf_kprobe
2026-10-09 1:49 [PATCH bpf-next] selftests/bpf: Expect at least one kprobe miss in missed/perf_kprobe Qiliang Yuan
@ 2026-10-21 0:02 ` Alexei Starovoitov
0 siblings, 0 replies; 2+ messages in thread
From: Alexei Starovoitov @ 2026-10-21 0:02 UTC (permalink / raw)
To: Qiliang Yuan, Andrii Nakryiko, Eduard Zingerman, Ihor Solodrai,
Daniel Borkmann, Kumar Kartikeya Dwivedi, Martin KaFai Lau,
Song Liu, Yonghong Song, Jiri Olsa, Emil Tsalapatis, Shuah Khan,
Hou Tao
Cc: bpf, linux-kselftest, linux-kernel
On Thu, Oct 08, 2026 at 06:49 PM Qiliang Yuan <odys.yuan@gmail.com> wrote:
> bpf_kfunc_common_test is a kfunc of bpf_testmod that other tests call
> as well. When one of them calls it from another kprobe while test2 is
> attached, the kprobe of test2 counts an extra miss, and the test reads
> 2 instead of 1.
Which test is that?
The only other test that calls bpf_kfunc_common_test() is wq.
wq_callback() runs from a workqueue, not from a kprobe,
and serial_test_wq() doesn't run in parallel with anything.
The extra miss comes from test1 in missed_kprobe.c.
It's a kprobe on bpf_fentry_test1() without pid filter.
fentry_test, fexit_test, kprobe_multi_test and many others are not serial.
Their bpf_prog_test_run() calls bpf_fentry_test1(). That runs test1,
it calls bpf_kfunc_common_test() and the kprobe of test2 counts a miss.
Pls fix the commit log and include the output of the failed run.
> - ASSERT_EQ(info.perf_event.kprobe.missed, 1, "info.perf_event.kprobe.missed");
> + ASSERT_GE(info.perf_event.kprobe.missed, 1, "info.perf_event.kprobe.missed");
Yesterday you sent the same change for tp_recursion in the same file:
https://lore.kernel.org/bpf/20261008-selftests-bpf-missed-tp-recursion-v1-1-0dd60471d655@gmail.com/
The cause is the same. test1 there is a kprobe on bpf_fentry_test1() too.
No other kprobe prog with bpf_printk() is involved.
test6 in test_missed_kprobe_recursion() is still ASSERT_EQ 1
and another test bumps it the same way.
Fix all three in one patch.
Also pls send selftest fixes as a series instead of 10 separate mails.
pw-bot: cr
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-10-21 0:03 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-09 1:49 [PATCH bpf-next] selftests/bpf: Expect at least one kprobe miss in missed/perf_kprobe Qiliang Yuan
2026-10-21 0:02 ` Alexei Starovoitov
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.