fio: add alignment check for fp fields
authorJens Axboe <axboe@fb.com>
Mon, 20 Oct 2014 16:52:31 +0000 (10:52 -0600)
committerJens Axboe <axboe@fb.com>
Mon, 20 Oct 2014 16:52:31 +0000 (10:52 -0600)
Signed-off-by: Jens Axboe <axboe@fb.com>
libfio.c

index 5a996f9cbd6e9f35d09709ad70ff78d3a3365c69..7eff63b4cbdaa6c3372b1479ad3f64d3d982d210 100644 (file)
--- 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");