All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH bpf-next v2 0/2] bpftool: Add command to list BPF types, helpers
@ 2022-06-29 20:36 Quentin Monnet
  2022-06-29 20:36 ` [PATCH bpf-next v2 1/2] bpftool: Add feature list (prog/map/link/attach types, helpers) Quentin Monnet
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Quentin Monnet @ 2022-06-29 20:36 UTC (permalink / raw)
  To: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko
  Cc: Martin KaFai Lau, Song Liu, Yonghong Song, John Fastabend,
	KP Singh, bpf, netdev, Quentin Monnet

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(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-06-30 14:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-29 20:36 [PATCH bpf-next v2 0/2] bpftool: Add command to list BPF types, helpers Quentin Monnet
2022-06-29 20:36 ` [PATCH bpf-next v2 1/2] bpftool: Add feature list (prog/map/link/attach types, helpers) Quentin Monnet
2022-06-29 20:36 ` [PATCH bpf-next v2 2/2] bpftool: Use feature list in bash completion Quentin Monnet
2022-06-30 14:20 ` [PATCH bpf-next v2 0/2] bpftool: Add command to list BPF types, helpers patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.