tools lib bpf: Extract and collect map names from BPF object file
authorWang Nan <wangnan0@huawei.com>
Fri, 27 Nov 2015 08:47:36 +0000 (08:47 +0000)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Sat, 28 Nov 2015 00:59:53 +0000 (21:59 -0300)
commit561bbccac72d08babafaa33fd7fa9100ec4c9fb6
treeb7dd063a6d2acc55d05ebfedf3396fcfbd9640bd
parent9d759a9b4ac2690077d8b21258e6e95c3e34bfa9
tools lib bpf: Extract and collect map names from BPF object file

This patch collects name of maps in BPF object files and saves them into
'maps' field in 'struct bpf_object'. 'bpf_object__get_map_by_name' is
introduced to retrive fd and definitions of a map through its name.

Signed-off-by: He Kuang <hekuang@huawei.com>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: He Kuang <hekuang@huawei.com>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Zefan Li <lizefan@huawei.com>
Cc: pi3orama@163.com
Link: http://lkml.kernel.org/r/1448614067-197576-3-git-send-email-wangnan0@huawei.com
Signed-off-by: Wang Nan <wangnan0@huawei.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/lib/bpf/libbpf.c
tools/lib/bpf/libbpf.h