bpftool: Match programs by name
authorPaul Chaignon <paul.chaignon@orange.com>
Fri, 13 Dec 2019 19:10:17 +0000 (20:10 +0100)
committerAlexei Starovoitov <ast@kernel.org>
Sun, 15 Dec 2019 17:03:18 +0000 (09:03 -0800)
commita7d22ca2a483d6c69c0791954447464297315ffa
tree6d8abf29900bda20bfda5946945ec18156573ea1
parentec2025095cf6acda3233a4301809596938b47da5
bpftool: Match programs by name

When working with frequently modified BPF programs, both the ID and the
tag may change.  bpftool currently doesn't provide a "stable" way to match
such programs.

This patch implements lookup by name for programs.  The show and dump
commands will return all programs with the given name, whereas other
commands will error out if several programs have the same name.

Signed-off-by: Paul Chaignon <paul.chaignon@orange.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Reviewed-by: Quentin Monnet <quentin.monnet@netronome.com>
Link: https://lore.kernel.org/bpf/b5fc1a5dcfaeb5f16fc80295cdaa606dd2d91534.1576263640.git.paul.chaignon@gmail.com
tools/bpf/bpftool/Documentation/bpftool-map.rst
tools/bpf/bpftool/Documentation/bpftool-prog.rst
tools/bpf/bpftool/bash-completion/bpftool
tools/bpf/bpftool/main.h
tools/bpf/bpftool/prog.c