linux-stable/tools/lib/bpf
Wang Nan 52d3352e79 bpf tools: Create eBPF maps defined in an object file
This patch creates maps based on 'map' section in object file using
bpf_create_map(), and stores the fds into an array in 'struct
bpf_object'.

Previous patches parse ELF object file and collects required data, but
doesn't play with the kernel. They belong to the 'opening' phase. This
patch is the first patch in 'loading' phase. The 'loaded' field is
introduced in 'struct bpf_object' to avoid loading an object twice,
because the loading phase clears resources collected during the opening
which becomes useless after loading. In this patch, maps_buf is cleared.

Signed-off-by: Wang Nan <wangnan0@huawei.com>
Acked-by: Alexei Starovoitov <ast@plumgrid.com>
Cc: Brendan Gregg <brendan.d.gregg@gmail.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: David Ahern <dsahern@gmail.com>
Cc: He Kuang <hekuang@huawei.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kaixu Xia <xiakaixu@huawei.com>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Zefan Li <lizefan@huawei.com>
Cc: pi3orama@163.com
Link: http://lkml.kernel.org/r/1435716878-189507-17-git-send-email-wangnan0@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2015-08-07 10:16:58 -03:00
..
.gitignore bpf tools: Introduce 'bpf' library and add bpf feature check 2015-08-07 10:16:56 -03:00
Build bpf tools: Add bpf.c/h for common bpf operations 2015-08-07 10:16:58 -03:00
Makefile bpf tools: Introduce 'bpf' library and add bpf feature check 2015-08-07 10:16:56 -03:00
bpf.c bpf tools: Add bpf.c/h for common bpf operations 2015-08-07 10:16:58 -03:00
bpf.h bpf tools: Add bpf.c/h for common bpf operations 2015-08-07 10:16:58 -03:00
libbpf.c bpf tools: Create eBPF maps defined in an object file 2015-08-07 10:16:58 -03:00
libbpf.h bpf tools: Create eBPF maps defined in an object file 2015-08-07 10:16:58 -03:00