BPF List
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Mahe Tardy" <mahe.tardy@gmail.com>, bpf@vger.kernel.org
Subject: Re: [PATCH bpf-next v3 4/5] bpftool: Add attach option for light skeleton generation
Date: Mon, 02 Nov 2026 20:41:39 +0000	[thread overview]
Message-ID: <sashiko-outbox-194143@kernel.org> (raw)
In-Reply-To: <20261102201356.5798-5-mahe.tardy@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] bpftool: bash completion suggests attach after name in _bpftool()
--

commit f5b94ca511f36c96410ef0757d692a7a6f4ea1cf
Author: Mahe Tardy <mahe.tardy@gmail.com>

bpftool: Add attach option for light skeleton generation

This commit adds an optional attach keyword to bpftool gen skeleton when
generating light skeletons with the loader backend (-L), passing the request
through gen_loader_opts.gen_attach and updating the generated attach and
detach helpers, documentation, and bash completion.

> diff --git a/tools/bpf/bpftool/bash-completion/bpftool b/tools/bpf/bpftool/bash-completion/bpftool
> index a28af31937ad4..9247a9fdcaef9 100644
> --- a/tools/bpf/bpftool/bash-completion/bpftool
> +++ b/tools/bpf/bpftool/bash-completion/bpftool
> @@ -1021,7 +1021,7 @@ _bpftool()
>                              return 0
>                              ;;
>                          *)
> -                            _bpftool_once_attr 'name'
> +                            _bpftool_once_attr 'name attach'

[Severity: Low]
In _bpftool() under the gen -> skeleton case:

                skeleton)
                    case $prev in
                        $command)
                            _filedir
                            return 0
                            ;;
                        *)
                            _bpftool_once_attr 'name attach'
                            return 0
                            ;;
                    esac

When a user types "bpftool gen skeleton <file> name <TAB>", $prev is "name"
and falls through to the wildcard branch. Because "name" is already on the
command line and "attach" is not, won't _bpftool_once_attr 'name attach'
autocomplete "attach" as the object name argument to "name"?

Should there be a "name) return 0 ;;" case before the wildcard branch so
that completion does not suggest "attach" when expecting the user-supplied
object name?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261102201356.5798-1-mahe.tardy@gmail.com?part=4

  reply	other threads:[~2026-11-02 20:41 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-02 20:13 [PATCH bpf-next v3 0/5] libbpf: Support gen loader attach Mahe Tardy
2026-11-02 20:13 ` [PATCH bpf-next v3 1/5] libbpf: Count entry programs for bpf_gen__init() Mahe Tardy
2026-11-02 20:45   ` bot+bpf-ci
2026-11-02 20:13 ` [PATCH bpf-next v3 2/5] libbpf: Track generated loader link FDs Mahe Tardy
2026-11-02 20:13 ` [PATCH bpf-next v3 3/5] libbpf: Emit BPF_LINK_CREATE calls in generated loaders Mahe Tardy
2026-11-03 17:59   ` Alexei Starovoitov
2026-11-02 20:13 ` [PATCH bpf-next v3 4/5] bpftool: Add attach option for light skeleton generation Mahe Tardy
2026-11-02 20:41   ` sashiko-bot [this message]
2026-11-02 20:56   ` bot+bpf-ci
2026-11-02 20:13 ` [PATCH bpf-next v3 5/5] selftests/bpf: Test gen loader attach Mahe Tardy

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-194143@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=mahe.tardy@gmail.com \
    --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