diff options
author | Wang Nan <wangnan0@huawei.com> | 2015-10-14 08:41:13 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2015-10-28 11:48:12 -0400 |
commit | 69d262a93a25cf475012ea2e00aeb29f4932c028 (patch) | |
tree | d1d85e664f15eb185a2451972425a0f78766fb4b /tools/perf/util/bpf-loader.h | |
parent | ed63f34c026e9a60d17fa750ecdfe3f600d49393 (diff) |
perf ebpf: Add the libbpf glue
The 'bpf-loader.[ch]' files are introduced in this patch. Which will be
the interface between perf and libbpf. bpf__prepare_load() resides in
bpf-loader.c. Following patches will enrich these two files.
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/1444826502-49291-3-git-send-email-wangnan0@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/bpf-loader.h')
-rw-r--r-- | tools/perf/util/bpf-loader.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/tools/perf/util/bpf-loader.h b/tools/perf/util/bpf-loader.h new file mode 100644 index 000000000000..f402d7c8c288 --- /dev/null +++ b/tools/perf/util/bpf-loader.h | |||
@@ -0,0 +1,29 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2015, Wang Nan <wangnan0@huawei.com> | ||
3 | * Copyright (C) 2015, Huawei Inc. | ||
4 | */ | ||
5 | #ifndef __BPF_LOADER_H | ||
6 | #define __BPF_LOADER_H | ||
7 | |||
8 | #include <linux/compiler.h> | ||
9 | #include <linux/err.h> | ||
10 | #include <string.h> | ||
11 | #include "debug.h" | ||
12 | |||
13 | struct bpf_object; | ||
14 | |||
15 | #ifdef HAVE_LIBBPF_SUPPORT | ||
16 | struct bpf_object *bpf__prepare_load(const char *filename); | ||
17 | |||
18 | void bpf__clear(void); | ||
19 | #else | ||
20 | static inline struct bpf_object * | ||
21 | bpf__prepare_load(const char *filename __maybe_unused) | ||
22 | { | ||
23 | pr_debug("ERROR: eBPF object loading is disabled during compiling.\n"); | ||
24 | return ERR_PTR(-ENOTSUP); | ||
25 | } | ||
26 | |||
27 | static inline void bpf__clear(void) { } | ||
28 | #endif | ||
29 | #endif | ||