public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Varun R Mallya <varunrmallya@gmail.com>
To: bot+bpf-ci@kernel.org
Cc: bpf@vger.kernel.org, jolsa@kernel.org, leon.hwang@linux.dev,
	andrii@kernel.org, alan.maguire@oracle.com, ast@kernel.org,
	eddyz87@gmail.com, martin.lau@linux.dev, daniel@iogearbox.net,
	linux-kernel@vger.kernel.org, memxor@gmail.com, song@kernel.org,
	menglong8.dong@gmail.com, martin.lau@kernel.org,
	yonghong.song@linux.dev, clm@meta.com, ihor.solodrai@linux.dev
Subject: Re: [RFC PATCH bpf-next v3 3/3] libbpf: Auto-upgrade kprobes to multi-kprobes when supported
Date: Fri, 10 Apr 2026 13:06:00 +0530	[thread overview]
Message-ID: <adioYBkwLPzQiDei@computer> (raw)
In-Reply-To: <ceb1b1cdd7512c5d2bbcb01dd0699c261e077fc92c08c2319f4311f0a3012b63@mail.kernel.org>

On Fri, Apr 03, 2026 at 01:35:31PM +0000, bot+bpf-ci@kernel.org wrote:
> > diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c
> > index bc749b9c291e..f566527d95f3 100644
> > --- a/tools/lib/bpf/libbpf.c
> > +++ b/tools/lib/bpf/libbpf.c
> 
> [ ... ]
> 
> > @@ -11841,6 +11867,30 @@ bpf_program__attach_kprobe_opts(const struct bpf_program *prog,
> >  	offset = OPTS_GET(opts, offset, 0);
> >  	pe_opts.bpf_cookie = OPTS_GET(opts, bpf_cookie, 0);
> >
> > +	/* This provides backwards compatibility to programs using kprobe, but
> > +	 * have been auto-upgraded to multi kprobe.
> > +	 */
> > +	if (prog->expected_attach_type == BPF_TRACE_KPROBE_MULTI &&
> > +	    offset == 0 && attach_mode == PROBE_ATTACH_MODE_DEFAULT) {
> 
> [ ... ]
> 
> > +	if (prog->expected_attach_type == BPF_TRACE_KPROBE_MULTI) {
> > +		pr_warn("prog '%s': multi-kprobe upgrade failed (off=%lu, mode=%d); use SEC(\"kprobe.single\")\n",
> > +			prog->name, offset, attach_mode);
> 
> Should this use %zu instead of %lu for offset?  It is declared as
> size_t in this function, and the existing pr_warn() calls further
> down use %zx for the same variable.

Valid, I'll do that too.

> > +		return libbpf_err_ptr(-ENOTSUP);
> > +	}
> 
> [ ... ]
> 
> > @@ -12297,14 +12347,24 @@ static int attach_kprobe(const struct bpf_program *prog, long cookie, struct bpf
> >  	*link = NULL;
> >
> >  	/* no auto-attach for SEC("kprobe") and SEC("kretprobe") */
> > -	if (strcmp(prog->sec_name, "kprobe") == 0 || strcmp(prog->sec_name, "kretprobe") == 0)
> > +	if (strcmp(prog->sec_name, "kprobe") == 0 ||
> > +	    strcmp(prog->sec_name, "kretprobe") == 0 ||
> > +	    strcmp(prog->sec_name, "kprobe.single") == 0 ||
> > +	    strcmp(prog->sec_name, "kretprobe.single") == 0)
> >  		return 0;
> 
> The comment above still only mentions SEC("kprobe") and
> SEC("kretprobe").  Could it be updated to also mention the .single
> variants that are now handled here?
> 

This seems valid, I'll add this into the next version.

> ---
> 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/23947048141


      reply	other threads:[~2026-04-10  7:36 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-03 12:44 [RFC PATCH bpf-next v3 0/3] Upgrading uprobe and kprobe to their `multi` counterparts Varun R Mallya
2026-04-03 12:44 ` [RFC PATCH bpf-next v3 1/3] libbpf: Auto-upgrade uprobes to multi-uprobes when supported Varun R Mallya
2026-04-03 13:35   ` bot+bpf-ci
2026-04-03 12:44 ` [RFC PATCH bpf-next v3 2/3] libbpf: Add FEAT_KPROBE_MULTI_LINK feature probe Varun R Mallya
2026-04-03 13:22   ` bot+bpf-ci
2026-04-10  7:33     ` Varun R Mallya
2026-04-03 12:44 ` [RFC PATCH bpf-next v3 3/3] libbpf: Auto-upgrade kprobes to multi-kprobes when supported Varun R Mallya
2026-04-03 13:35   ` bot+bpf-ci
2026-04-10  7:36     ` Varun R Mallya [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=adioYBkwLPzQiDei@computer \
    --to=varunrmallya@gmail.com \
    --cc=alan.maguire@oracle.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=jolsa@kernel.org \
    --cc=leon.hwang@linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin.lau@kernel.org \
    --cc=martin.lau@linux.dev \
    --cc=memxor@gmail.com \
    --cc=menglong8.dong@gmail.com \
    --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