aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/lib/include/internal/xyarray.h
diff options
context:
space:
mode:
authorGerald BAEZA <gerald.baeza@st.com>2019-08-22 09:07:01 +0000
committerArnaldo Carvalho de Melo <acme@redhat.com>2019-08-22 17:16:57 -0300
commitd9c5c083416500e95da098c01be092b937def7fa (patch)
treee3ee50fdf080ed6fb1c48c835cff27aee85b9e03 /tools/perf/lib/include/internal/xyarray.h
parentperf c2c: Fix report with offline cpus (diff)
downloadlinux-dev-d9c5c083416500e95da098c01be092b937def7fa.tar.xz
linux-dev-d9c5c083416500e95da098c01be092b937def7fa.zip
libperf: Fix alignment trap with xyarray contents in 'perf stat'
Following the patch 'perf stat: Fix --no-scale', an alignment trap happens in process_counter_values() on ARMv7 platforms due to the attempt to copy non 64 bits aligned double words (pointed by 'count') via a NEON vectored instruction ('vld1' with 64 bits alignment constraint). This patch sets a 64 bits alignment constraint on 'contents[]' field in 'struct xyarray' since the 'count' pointer used above points to such a structure. Signed-off-by: Gerald Baeza <gerald.baeza@st.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Alexandre Torgue <alexandre.torgue@st.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Mathieu Poirier <mathieu.poirier@linaro.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/1566464769-16374-1-git-send-email-gerald.baeza@st.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/lib/include/internal/xyarray.h')
-rw-r--r--tools/perf/lib/include/internal/xyarray.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/perf/lib/include/internal/xyarray.h b/tools/perf/lib/include/internal/xyarray.h
index 3bf70e4d474c..51e35d6c8ec4 100644
--- a/tools/perf/lib/include/internal/xyarray.h
+++ b/tools/perf/lib/include/internal/xyarray.h
@@ -2,6 +2,7 @@
#ifndef __LIBPERF_INTERNAL_XYARRAY_H
#define __LIBPERF_INTERNAL_XYARRAY_H
+#include <linux/compiler.h>
#include <sys/types.h>
struct xyarray {
@@ -10,7 +11,7 @@ struct xyarray {
size_t entries;
size_t max_x;
size_t max_y;
- char contents[];
+ char contents[] __aligned(8);
};
struct xyarray *xyarray__new(int xlen, int ylen, size_t entry_size);