summaryrefslogtreecommitdiff
path: root/tools/perf/util/config.c
diff options
context:
space:
mode:
authorWang Nan <wangnan0@huawei.com>2015-07-01 02:14:07 +0000
committerArnaldo Carvalho de Melo <acme@redhat.com>2015-08-07 10:16:59 -0300
commit55cffde2e1a41109cb49f8e94de954c8240242b5 (patch)
tree327432a2959dcf1e3d4161c62b7589e2896da8c5 /tools/perf/util/config.c
parent7bf98369a73a9a84c56b3f2b247ea8f0eaf8668b (diff)
downloadlinux-55cffde2e1a41109cb49f8e94de954c8240242b5.tar.gz
linux-55cffde2e1a41109cb49f8e94de954c8240242b5.tar.bz2
linux-55cffde2e1a41109cb49f8e94de954c8240242b5.zip
bpf tools: Load eBPF programs in object files into kernel
This patch utilizes previous introduced bpf_load_program to load programs in the ELF file into kernel. Result is stored in 'fd' field in 'struct bpf_program'. During loading, it allocs a log buffer and free it before return. Note that that buffer is not passed to bpf_load_program() if the first loading try is successful. Doesn't use a statically allocated log buffer to avoid potention multi-thread problem. Instructions collected during opening is cleared after loading. load_program() is created for loading a 'struct bpf_insn' array into kernel, bpf_program__load() calls it. By this design we have a function loads instructions into kernel. It will be used by further patches, which creates different instances from a program and load them into kernel. 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-20-git-send-email-wangnan0@huawei.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/config.c')
0 files changed, 0 insertions, 0 deletions