mbox series

[bpf-next,v2,0/2] bpftool: Add command to list BPF types, helpers

Message ID 20220629203637.138944-1-quentin@isovalent.com (mailing list archive)
Headers show
Series bpftool: Add command to list BPF types, helpers | expand

Message

Quentin Monnet June 29, 2022, 8:36 p.m. UTC
Now that bpftool relies on libbpf to get a "standard" textual
representation for program, map, link, and attach types, we can make it
list all these types (plus BPF helpers) that it knows from compilation
time.

The first use case for this feature is to help with bash completion. It
also provides a simple way for scripts to iterate over existing BPF types,
using the canonical names known to libbpf.

The first patch adds a new subcommand "bpftool feature list" to do this,
and the second one updates the bash completion to drop the hardcoded lists
of map types or cgroup attach types.

Quentin Monnet (2):
  bpftool: Add feature list (prog/map/link/attach types, helpers)
  bpftool: Use feature list in bash completion

 .../bpftool/Documentation/bpftool-feature.rst | 12 ++++
 tools/bpf/bpftool/bash-completion/bpftool     | 28 ++++------
 tools/bpf/bpftool/feature.c                   | 55 +++++++++++++++++++
 .../selftests/bpf/test_bpftool_synctypes.py   | 20 +------
 4 files changed, 80 insertions(+), 35 deletions(-)

Comments

patchwork-bot+netdevbpf@kernel.org June 30, 2022, 2:20 p.m. UTC | #1
Hello:

This series was applied to bpf/bpf-next.git (master)
by Daniel Borkmann <daniel@iogearbox.net>:

On Wed, 29 Jun 2022 21:36:35 +0100 you wrote:
> Now that bpftool relies on libbpf to get a "standard" textual
> representation for program, map, link, and attach types, we can make it
> list all these types (plus BPF helpers) that it knows from compilation
> time.
> 
> The first use case for this feature is to help with bash completion. It
> also provides a simple way for scripts to iterate over existing BPF types,
> using the canonical names known to libbpf.
> 
> [...]

Here is the summary with links:
  - [bpf-next,v2,1/2] bpftool: Add feature list (prog/map/link/attach types, helpers)
    https://git.kernel.org/bpf/bpf-next/c/27b3f7055343
  - [bpf-next,v2,2/2] bpftool: Use feature list in bash completion
    https://git.kernel.org/bpf/bpf-next/c/6d304871e3ef

You are awesome, thank you!