]> git.baikalelectronics.ru Git - kernel.git/commit
bpftool: Match maps by name
authorPaul Chaignon <paul.chaignon@orange.com>
Fri, 13 Dec 2019 19:10:37 +0000 (20:10 +0100)
committerAlexei Starovoitov <ast@kernel.org>
Sun, 15 Dec 2019 17:03:18 +0000 (09:03 -0800)
commitf371215a1ed1529c1c17d3750fb291f898f20830
tree2f81f80c00f4927221ed3ffe7ca1da7162079902
parent2b56ec381bf5dfaafd7ac7cf86daeba4716b0ae6
bpftool: Match maps by name

This patch implements lookup by name for maps and changes the behavior of
lookups by tag to be consistent with prog subcommands.  Similarly to
program subcommands, the show and dump commands will return all maps with
the given name (or tag), whereas other commands will error out if several
maps have the same name (resp. tag).

When a map has BTF info, it is dumped in JSON with available BTF info.
This patch requires that all matched maps have BTF info before switching
the output format to JSON.

Signed-off-by: Paul Chaignon <paul.chaignon@orange.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/8de1c9f273860b3ea1680502928f4da2336b853e.1576263640.git.paul.chaignon@gmail.com
tools/bpf/bpftool/Documentation/bpftool-map.rst
tools/bpf/bpftool/bash-completion/bpftool
tools/bpf/bpftool/main.h
tools/bpf/bpftool/map.c