diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2017-06-16 10:39:15 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2017-06-19 14:27:08 -0400 |
commit | 5c97cac63ac24c78c8126958a453774e49e706dd (patch) | |
tree | b7c409190c73b559de47218d15d4733d8678b24e | |
parent | c9f5da742fa3dfebc49d03deb312522e5db643ed (diff) |
tools: Adopt __aligned from kernel sources
To have a more compact way to ask the compiler to use a specific
alignment, making tools/ look more like kernel source 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: http://lkml.kernel.org/n/tip-8jiem6ubg9rlpbs7c2p900no@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r-- | tools/include/linux/compiler-gcc.h | 1 | ||||
-rw-r--r-- | tools/perf/util/evlist.h | 3 |
2 files changed, 3 insertions, 1 deletions
diff --git a/tools/include/linux/compiler-gcc.h b/tools/include/linux/compiler-gcc.h index 0f57a48272ab..bd39b2090ad1 100644 --- a/tools/include/linux/compiler-gcc.h +++ b/tools/include/linux/compiler-gcc.h | |||
@@ -26,5 +26,6 @@ | |||
26 | 26 | ||
27 | #define __noreturn __attribute__((noreturn)) | 27 | #define __noreturn __attribute__((noreturn)) |
28 | 28 | ||
29 | #define __aligned(x) __attribute__((aligned(x))) | ||
29 | #define __printf(a, b) __attribute__((format(printf, a, b))) | 30 | #define __printf(a, b) __attribute__((format(printf, a, b))) |
30 | #define __scanf(a, b) __attribute__((format(scanf, a, b))) | 31 | #define __scanf(a, b) __attribute__((format(scanf, a, b))) |
diff --git a/tools/perf/util/evlist.h b/tools/perf/util/evlist.h index 94cea4398a13..8d601fbdd8d6 100644 --- a/tools/perf/util/evlist.h +++ b/tools/perf/util/evlist.h | |||
@@ -1,6 +1,7 @@ | |||
1 | #ifndef __PERF_EVLIST_H | 1 | #ifndef __PERF_EVLIST_H |
2 | #define __PERF_EVLIST_H 1 | 2 | #define __PERF_EVLIST_H 1 |
3 | 3 | ||
4 | #include <linux/compiler.h> | ||
4 | #include <linux/kernel.h> | 5 | #include <linux/kernel.h> |
5 | #include <linux/refcount.h> | 6 | #include <linux/refcount.h> |
6 | #include <linux/list.h> | 7 | #include <linux/list.h> |
@@ -34,7 +35,7 @@ struct perf_mmap { | |||
34 | refcount_t refcnt; | 35 | refcount_t refcnt; |
35 | u64 prev; | 36 | u64 prev; |
36 | struct auxtrace_mmap auxtrace_mmap; | 37 | struct auxtrace_mmap auxtrace_mmap; |
37 | char event_copy[PERF_SAMPLE_MAX_SIZE] __attribute__((aligned(8))); | 38 | char event_copy[PERF_SAMPLE_MAX_SIZE] __aligned(8); |
38 | }; | 39 | }; |
39 | 40 | ||
40 | static inline size_t | 41 | static inline size_t |