Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1f477305 authored by Arnaldo Carvalho de Melo's avatar Arnaldo Carvalho de Melo
Browse files

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: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 7542b767
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -40,5 +40,4 @@ int func(void *ctx, int err, long sec)
	return sec == 5;
}

char _license[] SEC("license") = "GPL";
int _version SEC("version") = LINUX_VERSION_CODE;
license(GPL);
+1 −2
Original line number Diff line number Diff line
#include <bpf.h>

char _license[] SEC("license") = "GPL";
int _version SEC("version") = LINUX_VERSION_CODE;
license(GPL);
+5 −0
Original line number Diff line number Diff line
@@ -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 */