BPF List
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Geyslan Gregório" <gg@condado.dev>, bpf@vger.kernel.org
Subject: Re: [PATCH bpf-next 2/3] libbpf: Load objects with weak typed ksyms on kernels without BTF
Date: Sat, 05 Dec 2026 21:36:39 +0000	[thread overview]
Message-ID: <sashiko-outbox-251912@kernel.org> (raw)
In-Reply-To: <20261205-libbpf-weak-typed-ksyms-no-vmlinux-btf-v1-2-77cc642f7d4b@condado.dev>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] libbpf: newly added multi-line comments violate BPF comment
  style
--

commit 0a6249088ebcbf60499ca895e6e10512c2579665
Author: Geyslan Gregório <gg@condado.dev>

libbpf: Load objects with weak typed ksyms on kernels without BTF

This commit allows libbpf to load BPF objects whose only use of vmlinux
BTF is weak typed ksyms when no usable kernel BTF is available, leaving
those ksyms unresolved instead of failing with -ESRCH.

> diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c
> index 6fe0143ea9590..5e2bb95bda953 100644
> --- a/tools/lib/bpf/libbpf.c
> +++ b/tools/lib/bpf/libbpf.c
> @@ -3736,58 +3736,83 @@ static bool map_needs_vmlinux_btf(struct bpf_map *map)
>  	return bpf_map__is_struct_ops(map);
>  }
>  
> -static bool obj_needs_vmlinux_btf(const struct bpf_object *obj)
> +enum vmlinux_btf_need {
> +	VMLINUX_BTF_NONE,
> +	/* Only weak typed ksyms use it. Without kernel BTF they are left
> +	 * unresolved, as on a kernel with BTF that lacks them.
> +	 */
> +	VMLINUX_BTF_OPTIONAL,
> +	VMLINUX_BTF_REQUIRED,
> +};

[Severity: Low]
BPF code uses the kernel multi-line comment style with the opening /* on
its own line, even when surrounding code in the file uses the older
style.  The newly added multi-line comments here, in
bpf_object__load_vmlinux_btf(), and in bpf_object__resolve_externs()
should start the text on the line after /*.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261205-libbpf-weak-typed-ksyms-no-vmlinux-btf-v1-0-77cc642f7d4b@condado.dev?part=2

  reply	other threads:[~2026-12-05 21:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-05 21:28 [PATCH bpf-next 0/3] libbpf: Load objects with weak typed ksyms on kernels without BTF Geyslan Gregório via B4 Relay
2026-12-05 21:28 ` [PATCH bpf-next 1/3] libbpf: Do not resolve typed ksyms through kallsyms Geyslan Gregório via B4 Relay
2026-12-05 21:33   ` sashiko-bot
2026-12-05 21:28 ` [PATCH bpf-next 2/3] libbpf: Load objects with weak typed ksyms on kernels without BTF Geyslan Gregório via B4 Relay
2026-12-05 21:36   ` sashiko-bot [this message]
2026-12-05 21:28 ` [PATCH bpf-next 3/3] selftests/bpf: Test weak typed ksyms without vmlinux BTF Geyslan Gregório via B4 Relay
2026-12-05 21:40   ` sashiko-bot

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=sashiko-outbox-251912@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=gg@condado.dev \
    --cc=sashiko-reviews@lists.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