tools/bpftool: Add bpftool support for bpf map element iterator
authorYonghong Song <yhs@fb.com>
Thu, 23 Jul 2020 18:41:19 +0000 (11:41 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Sun, 26 Jul 2020 03:16:33 +0000 (20:16 -0700)
commitd8793aca708602c676372b03d6493972457524af
treee245a88b1cbd10418cd8eaf8aa1ab2aa732a6dd0
parentcd31039a7347610863aa8b77a9162048999723d0
tools/bpftool: Add bpftool support for bpf map element iterator

The optional parameter "map MAP" can be added to "bpftool iter"
command to create a bpf iterator for map elements. For example,
  bpftool iter pin ./prog.o /sys/fs/bpf/p1 map id 333

For map element bpf iterator "map MAP" parameter is required.
Otherwise, bpf link creation will return an error.

Quentin Monnet kindly provided bash-completion implementation
for new "map MAP" option.

Signed-off-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20200723184119.590799-1-yhs@fb.com
tools/bpf/bpftool/Documentation/bpftool-iter.rst
tools/bpf/bpftool/bash-completion/bpftool
tools/bpf/bpftool/iter.c