Skip to contentSkip to conversation

tools: Adopt __aligned from kernel sources

tip:perf/core tip-bot for Arnaldo Carvalho de Melo 1 participant 1 message Jun 20, 2017 perf events

lore
Share & tools
lore
#0 lore raw
Commit-ID:  5c97cac63ac24c78c8126958a453774e49e706dd
Gitweb:     http://git.kernel.org/tip/5c97cac63ac24c78c8126958a453774e49e706dd
Author:     Arnaldo Carvalho de Melo <[email protected]>
AuthorDate: Fri, 16 Jun 2017 11:39:15 -0300
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Mon, 19 Jun 2017 15:27:08 -0300

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.

---
 tools/include/linux/compiler-gcc.h | 1 +
 tools/perf/util/evlist.h           | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)
tools/include/linux/compiler-gcc.h +1 -0
index 0f57a48..bd39b20 100644
@@ -26,5 +26,6 @@
 
 #define __noreturn	__attribute__((noreturn))
 
+#define __aligned(x)	__attribute__((aligned(x)))
 #define __printf(a, b)	__attribute__((format(printf, a, b)))
 #define __scanf(a, b)	__attribute__((format(scanf, a, b)))
tools/perf/util/evlist.h +2 -1
index 94cea43..8d601fb 100644
@@ -1,6 +1,7 @@
 #ifndef __PERF_EVLIST_H
 #define __PERF_EVLIST_H 1
 
+#include <linux/compiler.h>
 #include <linux/kernel.h>
 #include <linux/refcount.h>
 #include <linux/list.h>
@@ -34,7 +35,7 @@ struct perf_mmap {
 	refcount_t	 refcnt;
 	u64		 prev;
 	struct auxtrace_mmap auxtrace_mmap;
-	char		 event_copy[PERF_SAMPLE_MAX_SIZE] __attribute__((aligned(8)));
+	char		 event_copy[PERF_SAMPLE_MAX_SIZE] __aligned(8);
 };
 
 static inline size_t