mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Alexei Starovoitov" <alexei.starovoitov@gmail.com>
To: "Qiliang Yuan" <odys.yuan@gmail.com>,
	"Andrii Nakryiko" <andrii@kernel.org>,
	"Eduard Zingerman" <eddyz87@gmail.com>,
	"Ihor Solodrai" <ihor.solodrai@linux.dev>,
	"Daniel Borkmann" <daniel@iogearbox.net>,
	"Kumar Kartikeya Dwivedi" <memxor@gmail.com>,
	"Martin KaFai Lau" <martin.lau@linux.dev>,
	"Song Liu" <song@kernel.org>,
	"Yonghong Song" <yonghong.song@linux.dev>,
	"Jiri Olsa" <jolsa@kernel.org>,
	"Emil Tsalapatis" <emil@etsalapatis.com>,
	"Shuah Khan" <shuah@kernel.org>, "Hou Tao" <houtao1@huawei.com>
Cc: <bpf@vger.kernel.org>, <linux-kselftest@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH bpf-next] selftests/bpf: Expect at least one kprobe miss in missed/perf_kprobe
Date: Wed, 21 Oct 2026 00:02:56 +0000	[thread overview]
Message-ID: <DMA2QS9N1LRH.OIOET3SWXS1L@gmail.com> (raw)
In-Reply-To: <20261009-selftests-bpf-missed-perf-kprobe-v1-1-c9d0f75f6f99@gmail.com>

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

      reply	other threads:[~2026-10-21  0:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-09  1:49 Qiliang Yuan
2026-10-21  0:02 ` Alexei Starovoitov [this message]

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=DMA2QS9N1LRH.OIOET3SWXS1L@gmail.com \
    --to=alexei.starovoitov@gmail.com \
    --cc=andrii@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=eddyz87@gmail.com \
    --cc=emil@etsalapatis.com \
    --cc=houtao1@huawei.com \
    --cc=ihor.solodrai@linux.dev \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=martin.lau@linux.dev \
    --cc=memxor@gmail.com \
    --cc=odys.yuan@gmail.com \
    --cc=shuah@kernel.org \
    --cc=song@kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®