diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2018-05-04 18:23:29 +0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2018-05-15 20:31:23 +0300 |
commit | dd8e4ead6e983acea959d10252688ef1471106fe (patch) | |
tree | d5bd2697f2da73fe19477a08694cf0148ab0db52 /tools/perf/include | |
parent | 8f12a2ff00e5e48ad5618167bac72cad7c9f214e (diff) | |
download | linux-dd8e4ead6e983acea959d10252688ef1471106fe.tar.xz |
perf bpf: Add bpf.h to be used in eBPF proggies
So, the first helper is the one shortening a variable/function section
attribute, from, for instance:
char _license[] __attribute__((section("license"), used)) = "GPL";
to:
char _license[] SEC("license") = "GPL";
Convert empty.c to that and it becomes:
# cat ~acme/lib/examples/perf/bpf/empty.c
#include <bpf.h>
char _license[] SEC("license") = "GPL";
int _version SEC("version") = LINUX_VERSION_CODE;
#
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: https://lkml.kernel.org/n/tip-zmeg52dlvy51rdlhyumfl5yf@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/include')
-rw-r--r-- | tools/perf/include/bpf/bpf.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/perf/include/bpf/bpf.h b/tools/perf/include/bpf/bpf.h new file mode 100644 index 000000000000..003afcab4e51 --- /dev/null +++ b/tools/perf/include/bpf/bpf.h @@ -0,0 +1,5 @@ +// SPDX-License-Identifier: GPL-2.0 +#ifndef _PERF_BPF_H +#define _PERF_BPF_H +#define SEC(NAME) __attribute__((section(NAME), used)) +#endif /* _PERF_BPF_H */ |