diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2018-05-04 15:18:31 -0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2018-05-15 14:31:24 -0300 |
commit | 1f477305ab462e2fd1fa8a4c4fa425ad752b3175 (patch) | |
tree | 5b41f0f141d3b7af760221e0decbb222b48d536d /tools/perf/include | |
parent | 7542b767b0469f4a76afa3feae6246d8a3d44e7f (diff) | |
download | linux-1f477305ab462e2fd1fa8a4c4fa425ad752b3175.tar.gz linux-1f477305ab462e2fd1fa8a4c4fa425ad752b3175.tar.bz2 linux-1f477305ab462e2fd1fa8a4c4fa425ad752b3175.zip |
perf bpf: Add license(NAME) helper
To further reduce boilerplate.
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-vst6hj335s0ebxzqltes3nsc@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 index 003afcab4e51..cdfd18b9c318 100644 --- a/tools/perf/include/bpf/bpf.h +++ b/tools/perf/include/bpf/bpf.h @@ -2,4 +2,9 @@ #ifndef _PERF_BPF_H #define _PERF_BPF_H #define SEC(NAME) __attribute__((section(NAME), used)) + +#define license(name) \ +char _license[] SEC("license") = #name; \ +int _version SEC("version") = LINUX_VERSION_CODE; + #endif /* _PERF_BPF_H */ |