Re: [PATCH bpf-next v1 4/7] tools: bpftool: implement map exec command

From: Jakub Kicinski
Date: Wed Mar 20 2019 - 17:23:54 EST

On Wed, 20 Mar 2019 18:33:29 +0100, Alban Crequy wrote:
> From: Alban Crequy <alban@xxxxxxxxxx>
> The map exec commands allows to open an existing map and pass the file
> descriptor to a child process. This enables applications to use an
> existing BPF map even when they don't support bpffs.
> Example of usage:
> # bpftool map exec pinned /sys/fs/bpf/foo fd 99 cmd -- readlink /proc/self/fd/99
> anon_inode:bpf-map

Would you mind telling us a little more about the use for this feature?
It seems fairly limited. If it's about probing objects (finding out if
they are a map or a program) perhaps we can add a command just for that?

(I guess bpftool -f isn't really the cleanest way of getting at that

> Documentation and bash completion updated as well.
> Signed-off-by: Alban Crequy <alban@xxxxxxxxxx>