tools lib bpf: Collect map definition in bpf_object
authorWang Nan <wangnan0@huawei.com>
Fri, 27 Nov 2015 08:47:35 +0000 (08:47 +0000)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Sat, 28 Nov 2015 00:57:09 +0000 (21:57 -0300)
commit9d759a9b4ac2690077d8b21258e6e95c3e34bfa9
tree184e9f95a010e1a883e83962189b742173ffd30a
parent039050482573e168690d365b8ea1d4f599ebbbd8
tools lib bpf: Collect map definition in bpf_object

This patch collects more information from maps sections in BPF object
files into 'struct bpf_object', enables later patches access those
information (such as the type and size of the map).

In this patch, a new handler 'struct bpf_map' is extracted in parallel
with bpf_object and bpf_program. Its iterator and accessor is also
created.

Signed-off-by: Wang Nan <wangnan0@huawei.com>
Cc: Alexei Starovoitov <ast@kernel.org>
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-2-git-send-email-wangnan0@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/lib/bpf/libbpf.c
tools/lib/bpf/libbpf.h