perf ebpf: Add the libbpf glue
[linux-2.6-block.git] / tools / perf / util / bpf-loader.h
CommitLineData
69d262a9
WN
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
13struct bpf_object;
14
15#ifdef HAVE_LIBBPF_SUPPORT
16struct bpf_object *bpf__prepare_load(const char *filename);
17
18void bpf__clear(void);
19#else
20static inline struct bpf_object *
21bpf__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
27static inline void bpf__clear(void) { }
28#endif
29#endif