forked from Minki/linux
7bf98369a7
bpf_load_program() can be used to load bpf program into kernel. To make loading faster, first try to load without logbuf. Try again with logbuf if the first try failed. 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-19-git-send-email-wangnan0@huawei.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
24 lines
605 B
C
24 lines
605 B
C
/*
|
|
* common eBPF ELF operations.
|
|
*
|
|
* Copyright (C) 2013-2015 Alexei Starovoitov <ast@kernel.org>
|
|
* Copyright (C) 2015 Wang Nan <wangnan0@huawei.com>
|
|
* Copyright (C) 2015 Huawei Inc.
|
|
*/
|
|
#ifndef __BPF_BPF_H
|
|
#define __BPF_BPF_H
|
|
|
|
#include <linux/bpf.h>
|
|
|
|
int bpf_create_map(enum bpf_map_type map_type, int key_size, int value_size,
|
|
int max_entries);
|
|
|
|
/* Recommend log buffer size */
|
|
#define BPF_LOG_BUF_SIZE 65536
|
|
int bpf_load_program(enum bpf_prog_type type, struct bpf_insn *insns,
|
|
size_t insns_cnt, char *license,
|
|
u32 kern_version, char *log_buf,
|
|
size_t log_buf_sz);
|
|
|
|
#endif
|