From 9b96749f6602001e3cc6b17644b9af55466dbeee Mon Sep 17 00:00:00 2001 From: Tomasz Zawadzki Date: Fri, 14 Jun 2019 07:41:21 -0400 Subject: [PATCH] fio_plugin: Use CLOCK_MONOTONIC for FreeBSD In order for fio_plugin to compile a replacement is needed for CLOCK_MONOTONIC_RAW, since FreeBSD does not support it. In that case CLOCK_MONOTONIC is used. Change-Id: I234ce4d932baf9c5399a46f9f4676315351e720c Signed-off-by: Tomasz Zawadzki Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/458072 Tested-by: SPDK CI Jenkins Reviewed-by: Shuhei Matsumoto Reviewed-by: Ben Walker Reviewed-by: Darek Stojaczyk --- examples/bdev/fio_plugin/fio_plugin.c | 6 ++++++ examples/nvme/fio_plugin/fio_plugin.c | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/examples/bdev/fio_plugin/fio_plugin.c b/examples/bdev/fio_plugin/fio_plugin.c index c8c9b6f3e..0c40380a7 100644 --- a/examples/bdev/fio_plugin/fio_plugin.c +++ b/examples/bdev/fio_plugin/fio_plugin.c @@ -49,6 +49,12 @@ #include "fio.h" #include "optgroup.h" +/* FreeBSD is missing CLOCK_MONOTONIC_RAW, + * so alternative is provided. */ +#ifndef CLOCK_MONOTONIC_RAW /* Defined in glibc bits/time.h */ +#define CLOCK_MONOTONIC_RAW CLOCK_MONOTONIC +#endif + struct spdk_fio_options { void *pad; char *conf; diff --git a/examples/nvme/fio_plugin/fio_plugin.c b/examples/nvme/fio_plugin/fio_plugin.c index 5ec18ec87..ba22ef1aa 100644 --- a/examples/nvme/fio_plugin/fio_plugin.c +++ b/examples/nvme/fio_plugin/fio_plugin.c @@ -46,6 +46,12 @@ #include "fio.h" #include "optgroup.h" +/* FreeBSD is missing CLOCK_MONOTONIC_RAW, + * so alternative is provided. */ +#ifndef CLOCK_MONOTONIC_RAW /* Defined in glibc bits/time.h */ +#define CLOCK_MONOTONIC_RAW CLOCK_MONOTONIC +#endif + #define NVME_IO_ALIGN 4096 static bool g_spdk_env_initialized;