diff options
| author | Wang Nan <[email protected]> | 2015-07-01 02:14:07 +0000 |
|---|---|---|
| committer | Arnaldo Carvalho de Melo <[email protected]> | 2015-08-07 13:16:59 +0000 |
| commit | 55cffde2e1a41109cb49f8e94de954c8240242b5 (patch) | |
| tree | 327432a2959dcf1e3d4161c62b7589e2896da8c5 /tools/perf/scripts/python/sctop.py | |
| parent | bpf tools: Introduce bpf_load_program() to bpf.c (diff) | |
| download | kernel-55cffde2e1a41109cb49f8e94de954c8240242b5.tar.gz kernel-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 <[email protected]>
Acked-by: Alexei Starovoitov <[email protected]>
Cc: Brendan Gregg <[email protected]>
Cc: Daniel Borkmann <[email protected]>
Cc: David Ahern <[email protected]>
Cc: He Kuang <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Kaixu Xia <[email protected]>
Cc: Masami Hiramatsu <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Zefan Li <[email protected]>
Cc: [email protected]
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/sctop.py')
0 files changed, 0 insertions, 0 deletions
