aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tools/bpf/bpftool/main.h
diff options
context:
space:
mode:
authorPaul Chaignon <paul.chaignon@orange.com>2019-12-13 20:10:37 +0100
committerAlexei Starovoitov <ast@kernel.org>2019-12-15 09:03:18 -0800
commit99f9863a0c45f4e87cb99593015090fdc9f44398 (patch)
tree2f81f80c00f4927221ed3ffe7ca1da7162079902 /tools/bpf/bpftool/main.h
parentbpftool: Match programs by name (diff)
downloadwireguard-linux-99f9863a0c45f4e87cb99593015090fdc9f44398.tar.xz
wireguard-linux-99f9863a0c45f4e87cb99593015090fdc9f44398.zip
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
Diffstat (limited to 'tools/bpf/bpftool/main.h')
-rw-r--r--tools/bpf/bpftool/main.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/bpf/bpftool/main.h b/tools/bpf/bpftool/main.h
index a7ead7bb9447..81890f4c8cca 100644
--- a/tools/bpf/bpftool/main.h
+++ b/tools/bpf/bpftool/main.h
@@ -47,7 +47,7 @@
"OPTIONS := { {-j|--json} [{-p|--pretty}] | {-f|--bpffs} |\n" \
"\t {-m|--mapcompat} | {-n|--nomount} }"
#define HELP_SPEC_MAP \
- "MAP := { id MAP_ID | pinned FILE }"
+ "MAP := { id MAP_ID | pinned FILE | name MAP_NAME }"
static const char * const prog_type_name[] = {
[BPF_PROG_TYPE_UNSPEC] = "unspec",