BPF List
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Alan Maguire" <almagui@kernel.org>
Cc: bpf@vger.kernel.org
Subject: Re: [PATCH bpf-next 5/7] libbpf: Report function argument relocation support via type existence
Date: Mon, 23 Nov 2026 22:38:30 +0000	[thread overview]
Message-ID: <sashiko-outbox-230151@kernel.org> (raw)
In-Reply-To: <20261123223227.745345-6-almagui@kernel.org>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] libbpf: multi-line comment style violation in
  bpf_core_spec_match()
--

commit 4236a42c871ff888d9de43484f575fb4195ce34b
Author: Alan Maguire <almagui@kernel.org>

libbpf: Report function argument relocation support via type existence

This commit resolves BPF_CORE_TYPE_EXISTS relocations against function
argument structs to 1 when matched against the attach target, and adds
bpf_func_args_supported() to bpf_tracing.h so programs can detect whether
function argument relocation is supported by the loader.

> diff --git a/tools/lib/bpf/relo_core.c b/tools/lib/bpf/relo_core.c
> index 2f6627952220b..ed566a55cb068 100644
> --- a/tools/lib/bpf/relo_core.c
> +++ b/tools/lib/bpf/relo_core.c
> @@ -907,8 +907,15 @@ static int bpf_core_spec_match(struct bpf_core_spec *local_spec,
>  	targ_spec->relo_kind = local_spec->relo_kind;
>  
>  	if (func_args) {
> -		/* only field accesses (args->x...) of the arguments struct
> -		 * have a meaning for function argument candidates
> +		/* the existence of an arguments struct indicates that it is
> +		 * matched against the attach target, as only libbpf and
> +		 * kernel versions supporting that find a candidate for it,
> +		 * allowing programs to detect that support
> +		 */
> +		if (local_spec->relo_kind == BPF_CORE_TYPE_EXISTS)
> +			return 1;
> +		/* otherwise, only field accesses (args->x...) have a meaning
> +		 * for function argument candidates
>  		 */

[Severity: Low]
This isn't a bug, but BPF coding style puts the opening /* of multi-line
comments on its own line rather than placing comment text on the first
line.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261123223227.745345-1-almagui@kernel.org?part=5

  reply	other threads:[~2026-11-23 22:38 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-23 22:32 [PATCH bpf-next 0/7] libbpf, bpf: Utilize CO-RE for BPF program parameter presence, ordering Alan Maguire
2026-11-23 22:32 ` [PATCH bpf-next 5/7] libbpf: Report function argument relocation support via type existence Alan Maguire
2026-11-23 22:38   ` sashiko-bot [this message]
2026-11-23 22:32 ` [PATCH bpf-next 6/7] selftests/bpf: Test detection of function argument relocation support Alan Maguire
2026-11-23 22:36   ` sashiko-bot
2026-11-23 22:32 ` [PATCH bpf-next 7/7] Documentation/bpf: Describe CO-RE relocation of function arguments Alan Maguire
     [not found] ` <20261123223227.745345-5-almagui@kernel.org>
2026-11-23 22:41   ` [PATCH bpf-next 4/7] selftests/bpf: Test CO-RE relocation of BPF LSM program arguments sashiko-bot
     [not found] ` <20261123223227.745345-4-almagui@kernel.org>
2026-11-23 22:43   ` [PATCH bpf-next 3/7] selftests/bpf: Test CO-RE relocation of tracing " sashiko-bot
     [not found] ` <20261123223227.745345-3-almagui@kernel.org>
2026-11-23 22:52   ` [PATCH bpf-next 2/7] bpf: Support " sashiko-bot
     [not found] ` <20261123223227.745345-2-almagui@kernel.org>
2026-11-23 22:53   ` [PATCH bpf-next 1/7] libbpf: " sashiko-bot
2026-11-23 23:23   ` bot+bpf-ci

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-230151@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=almagui@kernel.org \
    --cc=bpf@vger.kernel.org \
    --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