tools lib bpf: Retrive bpf_map through offset of bpf_map_def
authorWang Nan <wangnan0@huawei.com>
Sat, 26 Nov 2016 07:03:27 +0000 (07:03 +0000)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 29 Nov 2016 15:10:19 +0000 (12:10 -0300)
commit5a6acad17d2e81765dd4c2fce7346a6f045eab25
treec5ee94f9aec5b8ac2d1b09e7e1b8b28f927a1204
parent10931d2413478239bdceac5546cce85d7a497a4e
tools lib bpf: Retrive bpf_map through offset of bpf_map_def

Add a new API to libbpf, caller is able to get bpf_map through the
offset of bpf_map_def to 'maps' section.

The API will be used to help jitted perf hook code find fd of a map.

Signed-off-by: Wang Nan <wangnan0@huawei.com>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Cc: He Kuang <hekuang@huawei.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Joe Stringer <joe@ovn.org>
Cc: Zefan Li <lizefan@huawei.com>
Cc: pi3orama@163.com
Link: http://lkml.kernel.org/r/20161126070354.141764-4-wangnan0@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/lib/bpf/libbpf.c
tools/lib/bpf/libbpf.h