linux/tools/bpf/bpftool
Quentin Monnet 3fc27b71b8 tools: bpftool: try to mount bpffs if required for pinning objects
One possible cause of failure for `bpftool {prog|map} pin * file FILE`
is the FILE not being in an eBPF virtual file system (bpffs). In this
case, make bpftool attempt to mount bpffs on the parent directory of the
FILE. Then, if this operation is successful, try again to pin the
object.

The code for mnt_bpffs() is a copy of function bpf_mnt_fs() from
iproute2 package (under lib/bpf.c, taken at commit 4b73d52f8a81), with
modifications regarding handling of error messages.

Signed-off-by: Quentin Monnet <quentin.monnet@netronome.com>
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-10-26 17:52:59 +09:00
..
Documentation tools: bpftool: update documentation for --json and --pretty usage 2017-10-24 01:25:09 +01:00
common.c tools: bpftool: try to mount bpffs if required for pinning objects 2017-10-26 17:52:59 +09:00
jit_disasm.c tools: bpftool: add JSON output for bpftool prog dump jited * command 2017-10-24 01:25:08 +01:00
json_writer.c tools: bpftool: add JSON output for bpftool prog dump xlated * command 2017-10-24 01:25:08 +01:00
json_writer.h tools: bpftool: add JSON output for bpftool prog dump xlated * command 2017-10-24 01:25:08 +01:00
main.c tools: bpftool: update documentation for --json and --pretty usage 2017-10-24 01:25:09 +01:00
main.h tools: bpftool: try to mount bpffs if required for pinning objects 2017-10-26 17:52:59 +09:00
Makefile tools: bpftool: use the kernel's instruction printer 2017-10-10 12:30:16 -07:00
map.c tools: bpftool: update documentation for --json and --pretty usage 2017-10-24 01:25:09 +01:00
prog.c tools: bpftool: update documentation for --json and --pretty usage 2017-10-24 01:25:09 +01:00