Re: [PATCH bpf-next v3 4/5] bpftool: Add attach option for light skeleton generation

From: bot+bpf-ci

Date: Mon Nov 02 2026 - 16:29:37 EST


> bpftool: Add attach option for light skeleton generation

TL;DR: bpftool bash completion for "gen skeleton" may offer "attach" as the
object name after "name <TAB>", since there is no name case before the
catch-all branch. Minor completion bug.

> diff --git a/tools/bpf/bpftool/bash-completion/bpftool b/tools/bpf/bpftool/bash-completion/bpftool
> index a28af31937ad..9247a9fdcaef 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'
> return 0
> ;;
> esac

Does this completion offer "attach" as the object name?

The skeleton branch of _bpftool() has no case for prev == name, so when the
cursor is on the OBJECT_NAME value it falls into the catch-all *) branch and
runs _bpftool_once_attr 'name attach'. The 'name' keyword is skipped because
it is already on the line, but 'attach' is not.

So "bpftool gen skeleton prog.o name <TAB>" now offers "attach", and
"name a<TAB>" completes to "name attach". That sets the object name to
"attach" and does not request loader attachment. Before this change,
_bpftool_once_attr 'name' offered nothing in that position.

Other value-taking keywords in this file are handled explicitly, for example
the 'map create' branch has a name) case that returns 0. Would adding a
name) case that does "return 0" ahead of the *) branch for skeleton restore
the previous behaviour?


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