Skip to content

bpftool: Add command to list BPF types, helpers

Quentin Monnet bpf netdev 2 versions Applied

Status from this message: This series was applied to bpf/bpf-next.git (master)

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 0 repliesApplied 2/2
  2. v12 patches 3 repliesSuperseded

Patches in v2 All 2 applied

#Subject and filesSizeRepliesApplied
1/2bpftool: Add feature list (prog/map/link/attach types, helpers)tools/bpf/bpftool/Documentation/bpftool-feature.rst tools/bpf/bpftool/bash-completion/bpftool tools/bpf/bpftool/feature.c+73 -10 repliesApplied
2/2bpftool: Use feature list in bash completiontools/bpf/bpftool/bash-completion/bpftool tools/testing/selftests/bpf/test_bpftool_synctypes.py+7 -340 repliesApplied

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchDaniel Müller
1/2A-b
2/2A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

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

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(-)
Signature · 1 line
2.34.1