From 976a77566d8b735fd0c064f33332aa4e0204122c Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Mon, 20 Oct 2014 10:52:31 -0600 Subject: [PATCH] fio: add alignment check for fp fields Signed-off-by: Jens Axboe --- libfio.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libfio.c b/libfio.c index 5a996f9c..7eff63b4 100644 --- a/libfio.c +++ b/libfio.c @@ -297,6 +297,14 @@ int initialize_fio(char *envp[]) { long ps; + /* + * We need these to be properly 64-bit aligned, otherwise we + * can run into problems on archs that fault on unaligned fp + * access (ARM). + */ + compiletime_assert((offsetof(struct thread_stat, percentile_list) % 8) == 0, "fp align"); + compiletime_assert((offsetof(struct thread_stat, latency_percentile) % 8) == 0, "fp align"); + if (endian_check()) { log_err("fio: endianness settings appear wrong.\n"); log_err("fio: please report this to fio@vger.kernel.org\n"); -- 2.25.1