Add configure script
authorJens Axboe <axboe@kernel.dk>
Thu, 10 Jan 2013 10:23:19 +0000 (11:23 +0100)
committerJens Axboe <axboe@kernel.dk>
Thu, 10 Jan 2013 10:23:19 +0000 (11:23 +0100)
Get rid of all the fragile guessing and checking of features,
and roll a configure script instead.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
45 files changed:
HOWTO
Makefile
arch/arch-x86.h
arch/arch-x86_64.h
arch/arch.h
backend.c
client.c
compiler/compiler.h
configure [new file with mode: 0755]
engines/fusion-aw.c
engines/guasi.c
engines/libaio.c
engines/net.c
engines/posixaio.c
engines/rdma.c
engines/solarisaio.c
engines/splice.c
engines/syslet-rw.c [deleted file]
fio.c
fio.h
gettime.c
helpers.c
helpers.h
init.c
ioengine.h
ioengines.c
lib/getopt.h
lib/inet_aton.c [new file with mode: 0644]
lib/inet_aton.h [new file with mode: 0644]
lib/strsep.h
options.c
os/indirect.h [deleted file]
os/os-aix.h
os/os-android.h
os/os-freebsd.h
os/os-hpux.h
os/os-linux.h
os/os-mac.h
os/os-netbsd.h
os/os-solaris.h
os/os-windows.h
os/os.h
os/syslet.h [deleted file]
os/windows/posix.c
server.c

diff --git a/HOWTO b/HOWTO
index 0930f33784a6515fe67691226851c38621bb47b2..014b7f3d4ca763135f131c163a054709e6b637e0 100644 (file)
--- a/HOWTO
+++ b/HOWTO
@@ -844,9 +844,7 @@ cpus_allowed=str Controls the same options as cpumask, but it allows a text
 numa_cpu_nodes=str Set this job running on spcified NUMA nodes' CPUs. The
                arguments allow comma delimited list of cpu numbers,
                A-B ranges, or 'all'. Note, to enable numa options support,
 numa_cpu_nodes=str Set this job running on spcified NUMA nodes' CPUs. The
                arguments allow comma delimited list of cpu numbers,
                A-B ranges, or 'all'. Note, to enable numa options support,
-               export the following environment variables,
-                       export EXTFLAGS+=" -DFIO_HAVE_LIBNUMA "
-                       export EXTLIBS+=" -lnuma "
+               fio must be built on a system with libnuma-dev(el) installed.
 
 numa_mem_policy=str Set this job's memory policy and corresponding NUMA
                nodes. Format of the argements:
 
 numa_mem_policy=str Set this job's memory policy and corresponding NUMA
                nodes. Format of the argements:
index ba8b997b88ad8f5622e8ca0deb128d010defde6b..96819c81378d1a2861121a15cfd3ecac7f71ca0d 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,3 @@
-CC ?= gcc
 DEBUGFLAGS = -D_FORTIFY_SOURCE=2 -DFIO_INC_DEBUG
 CPPFLAGS= -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 \
        $(DEBUGFLAGS)
 DEBUGFLAGS = -D_FORTIFY_SOURCE=2 -DFIO_INC_DEBUG
 CPPFLAGS= -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 \
        $(DEBUGFLAGS)
@@ -9,62 +8,161 @@ PROGS        = fio
 SCRIPTS = fio_generate_plots
 UNAME  := $(shell uname)
 
 SCRIPTS = fio_generate_plots
 UNAME  := $(shell uname)
 
+ifneq ($(wildcard config-host.mak),)
+all:
+include config-host.mak
+config-host-mak: configure
+       @echo $@ is out-of-date, running configure
+       @sed -n "/.*Configured with/s/[^:]*: //p" $@ | sh
+else
+config-host.mak:
+       @echo "Running configure for you..."
+       @./configure
+all:
+include config-host.mak
+endif
+
 SOURCE := gettime.c fio.c ioengines.c init.c stat.c log.c time.c filesetup.c \
                eta.c verify.c memory.c io_u.c parse.c mutex.c options.c \
                rbtree.c smalloc.c filehash.c profile.c debug.c lib/rand.c \
                lib/num2str.c lib/ieee754.c $(wildcard crc/*.c) engines/cpu.c \
                engines/mmap.c engines/sync.c engines/null.c engines/net.c \
                memalign.c server.c client.c iolog.c backend.c libfio.c flow.c \
 SOURCE := gettime.c fio.c ioengines.c init.c stat.c log.c time.c filesetup.c \
                eta.c verify.c memory.c io_u.c parse.c mutex.c options.c \
                rbtree.c smalloc.c filehash.c profile.c debug.c lib/rand.c \
                lib/num2str.c lib/ieee754.c $(wildcard crc/*.c) engines/cpu.c \
                engines/mmap.c engines/sync.c engines/null.c engines/net.c \
                memalign.c server.c client.c iolog.c backend.c libfio.c flow.c \
-               json.c lib/zipf.c lib/axmap.c lib/lfsr.c gettime-thread.c
+               json.c lib/zipf.c lib/axmap.c lib/lfsr.c gettime-thread.c \
+               helpers.c
+
+ifdef CONFIG_64BIT
+  CFLAGS += -DBITS_PER_LONG=64
+endif
+ifdef CONFIG_32BIT
+  CFLAGS += -DBITS_PER_LONG=32
+endif
+
+ifdef CONFIG_LIBAIO
+  CFLAGS += -DCONFIG_LIBAIO
+  SOURCE += engines/libaio.c
+endif
+ifdef CONFIG_RDMA
+  CFLAGS += -DCONFIG_RDMA
+  SOURCE += engines/rdma.c
+endif
+ifdef CONFIG_POSIXAIO
+  CFLAGS += -DCONFIG_POSIXAIO
+  SOURCE += engines/posixaio.c
+endif
+ifdef CONFIG_LINUX_FALLOCATE
+  SOURCE += engines/falloc.c
+endif
+ifdef CONFIG_LINUX_EXT4_MOVE_EXTENT
+  SOURCE += engines/e4defrag.c
+endif
+ifdef CONFIG_LINUX_SPLICE
+  CFLAGS += -DCONFIG_LINUX_SPLICE
+  SOURCE += engines/splice.c
+endif
+ifdef CONFIG_GUASI
+  CFLAGS += -DCONFIG_GUASI
+  SOURCE += engines/guasi.c
+endif
+ifdef CONFIG_FUSION_AW
+  CFLAGS += -DCONFIG_FUSION_AW
+  SOURCE += engines/fusion-aw.c
+endif
+ifdef CONFIG_SOLARISAIO
+  CFLAGS += -DCONFIG_SOLARISAIO
+  SOURCE += engines/solarisaio.c
+endif
+
+ifndef CONFIG_STRSEP
+  CFLAGS += -DCONFIG_STRSEP
+  SOURCE += lib/strsep.c
+endif
+ifndef CONFIG_GETOPT_LONG_ONLY
+  CFLAGS += -DCONFIG_GETOPT_LONG_ONLY
+  SOURCE += lib/getopt_long.c
+endif
+
+ifndef CONFIG_INET_ATON
+  CFLAGS += -DCONFIG_INET_ATON
+  SOURCE += lib/inet_aton.c
+endif
+ifdef CONFIG_CLOCK_GETTIME
+  CFLAGS += -DCONFIG_CLOCK_GETTIME
+endif
+ifdef CONFIG_POSIXAIO_FSYNC
+  CFLAGS += -DCONFIG_POSIXAIO_FSYNC
+endif
+ifdef CONFIG_FADVISE
+  CFLAGS += -DCONFIG_FADVISE
+endif
+ifdef CONFIG_CLOCK_MONOTONIC
+  CFLAGS += -DCONFIG_CLOCK_MONOTONIC
+endif
+ifdef CONFIG_CLOCK_MONOTONIC_PRECISE
+  CFLAGS += -DCONFIG_CLOCK_MONOTONIC_PRECISE
+endif
+ifdef CONFIG_GETTIMEOFDAY
+  CFLAGS += -DCONFIG_GETTIMEOFDAY
+endif
+ifdef CONFIG_SOCKLEN_T
+  CFLAGS += -DCONFIG_SOCKLEN_T
+endif
+ifdef CONFIG_SFAA
+  CFLAGS += -DCONFIG_SFAA
+endif
+ifdef CONFIG_FDATASYNC
+  CFLAGS += -DCONFIG_FDATASYNC
+endif
+ifdef CONFIG_3ARG_AFFINITY
+  CFLAGS += -DCONFIG_3ARG_AFFINITY
+endif
+ifdef CONFIG_2ARG_AFFINITY
+  CFLAGS += -DCONFIG_2ARG_AFFINITY
+endif
+ifdef CONFIG_SYNC_FILE_RANGE
+  CFLAGS += -DCONFIG_SYNC_FILE_RANGE
+endif
+ifdef CONFIG_LIBNUMA
+  CFLAGS += -DCONFIG_LIBNUMA
+endif
+ifdef CONFIG_TLS_THREAD
+  CFLAGS += -DCONFIG_TLS_THREAD
+endif
 
 ifeq ($(UNAME), Linux)
 
 ifeq ($(UNAME), Linux)
-  SOURCE += diskutil.c fifo.c blktrace.c helpers.c cgroup.c trim.c \
-               engines/libaio.c engines/posixaio.c engines/sg.c \
-               engines/splice.c engines/syslet-rw.c engines/guasi.c \
-               engines/binject.c engines/rdma.c profiles/tiobench.c \
-               engines/fusion-aw.c engines/falloc.c engines/e4defrag.c
-  LIBS += -lpthread -ldl -lrt -laio
+  SOURCE += diskutil.c fifo.c blktrace.c cgroup.c trim.c engines/sg.c \
+               engines/binject.c profiles/tiobench.c
+  LIBS += -lpthread -ldl
   LDFLAGS += -rdynamic
 endif
 ifeq ($(UNAME), Android)
   LDFLAGS += -rdynamic
 endif
 ifeq ($(UNAME), Android)
-  SOURCE += diskutil.c fifo.c blktrace.c helpers.c trim.c \
-               engines/splice.c profiles/tiobench.c engines/falloc.c \
-               engines/e4defrag.c
+  SOURCE += diskutil.c fifo.c blktrace.c trim.c profiles/tiobench.c
   LIBS += -ldl
   LDFLAGS += -rdynamic
   CPPFLAGS += -DFIO_NO_HAVE_SHM_H
 endif
 ifeq ($(UNAME), SunOS)
   LIBS += -ldl
   LDFLAGS += -rdynamic
   CPPFLAGS += -DFIO_NO_HAVE_SHM_H
 endif
 ifeq ($(UNAME), SunOS)
-  CC      = gcc
-  SOURCE += fifo.c lib/strsep.c helpers.c engines/posixaio.c \
-               engines/solarisaio.c
   LIBS  += -lpthread -ldl -laio -lrt -lnsl -lsocket
   CPPFLAGS += -D__EXTENSIONS__
 endif
 ifeq ($(UNAME), FreeBSD)
   LIBS  += -lpthread -ldl -laio -lrt -lnsl -lsocket
   CPPFLAGS += -D__EXTENSIONS__
 endif
 ifeq ($(UNAME), FreeBSD)
-  SOURCE += helpers.c engines/posixaio.c
   LIBS  += -lpthread -lrt
   LDFLAGS += -rdynamic
 endif
 ifeq ($(UNAME), NetBSD)
   LIBS  += -lpthread -lrt
   LDFLAGS += -rdynamic
 endif
 ifeq ($(UNAME), NetBSD)
-  SOURCE += helpers.c engines/posixaio.c
   LIBS  += -lpthread -lrt
   LDFLAGS += -rdynamic
 endif
 ifeq ($(UNAME), AIX)
   LIBS  += -lpthread -lrt
   LDFLAGS += -rdynamic
 endif
 ifeq ($(UNAME), AIX)
-  SOURCE += fifo.c helpers.c lib/getopt_long.c engines/posixaio.c
   LIBS  += -lpthread -ldl -lrt
   CPPFLAGS += -D_LARGE_FILES -D__ppc__
   LDFLAGS += -L/opt/freeware/lib -Wl,-blibpath:/opt/freeware/lib:/usr/lib:/lib -Wl,-bmaxdata:0x80000000
 endif
 ifeq ($(UNAME), HP-UX)
   LIBS  += -lpthread -ldl -lrt
   CPPFLAGS += -D_LARGE_FILES -D__ppc__
   LDFLAGS += -L/opt/freeware/lib -Wl,-blibpath:/opt/freeware/lib:/usr/lib:/lib -Wl,-bmaxdata:0x80000000
 endif
 ifeq ($(UNAME), HP-UX)
-  CC      = gcc
-  SOURCE += fifo.c helpers.c lib/getopt_long.c lib/strsep.c engines/posixaio.c
   LIBS   += -lpthread -ldl -lrt
   LIBS   += -lpthread -ldl -lrt
-  CFLAGS += -D_LARGEFILE64_SOURCE
+  CFLAGS += -D_LARGEFILE64_SOURCE -D_XOPEN_SOURCE_EXTENDED
 endif
 ifeq ($(UNAME), Darwin)
 endif
 ifeq ($(UNAME), Darwin)
-  SOURCE += helpers.c engines/posixaio.c
   LIBS  += -lpthread -ldl
 endif
 ifneq (,$(findstring CYGWIN,$(UNAME)))
   LIBS  += -lpthread -ldl
 endif
 ifneq (,$(findstring CYGWIN,$(UNAME)))
@@ -72,8 +170,6 @@ ifneq (,$(findstring CYGWIN,$(UNAME)))
   SOURCE += engines/windowsaio.c os/windows/posix.c
   LIBS  += -lpthread -lpsapi -lws2_32
   CFLAGS += -DPSAPI_VERSION=1 -Ios/windows/posix/include -Wno-format
   SOURCE += engines/windowsaio.c os/windows/posix.c
   LIBS  += -lpthread -lpsapi -lws2_32
   CFLAGS += -DPSAPI_VERSION=1 -Ios/windows/posix/include -Wno-format
-  CC     = x86_64-w64-mingw32-gcc
-  #CC    = i686-w64-mingw32-gcc
 endif
 
 OBJS = $(SOURCE:.c=.o)
 endif
 
 OBJS = $(SOURCE:.c=.o)
@@ -159,7 +255,7 @@ fio: $(OBJS)
 $(PROGS): .depend
 
 clean: FORCE
 $(PROGS): .depend
 
 clean: FORCE
-       -rm -f .depend $(OBJS) $(T_OBJS) $(PROGS) $(T_PROGS) core.* core FIO-VERSION-FILE
+       -rm -f .depend $(OBJS) $(T_OBJS) $(PROGS) $(T_PROGS) core.* core FIO-VERSION-FILE config-host.mak config-host.ld cscope.out
 
 cscope:
        @cscope -b -R
 
 cscope:
        @cscope -b -R
index 48030060041bfc48391ec90f998bbace4556741e..679ec2816992a3c7fa82a00b520cd24a82a936ca 100644 (file)
 #define __NR_sys_vmsplice      316
 #endif
 
 #define __NR_sys_vmsplice      316
 #endif
 
-#ifndef __NR_async_exec
-#define __NR_async_exec                325
-#define __NR_async_wait                326
-#define __NR_umem_add          327
-#define __NR_async_thread      328
-#endif
-
 #define        FIO_HUGE_PAGE           4194304
 
 #define        FIO_HUGE_PAGE           4194304
 
-#define FIO_HAVE_SYSLET
-
 #define nop            __asm__ __volatile__("rep;nop": : :"memory")
 #define read_barrier() __asm__ __volatile__("": : :"memory")
 #define write_barrier()        __asm__ __volatile__("": : :"memory")
 #define nop            __asm__ __volatile__("rep;nop": : :"memory")
 #define read_barrier() __asm__ __volatile__("": : :"memory")
 #define write_barrier()        __asm__ __volatile__("": : :"memory")
index d8b0933bdadda5e3c7c076b176d9655022bf93ec..cea0451d8ba6f3788e7658508a27863f494ac590 100644 (file)
 #define __NR_sys_vmsplice      278
 #endif
 
 #define __NR_sys_vmsplice      278
 #endif
 
-#ifndef __NR_async_exec
-#define __NR_async_exec                286
-#define __NR_async_wait                287
-#define __NR_umem_add          288
-#define __NR_async_thread      289
-#endif
-
 #define        FIO_HUGE_PAGE           2097152
 
 #define        FIO_HUGE_PAGE           2097152
 
-#define FIO_HAVE_SYSLET
-
 #define nop            __asm__ __volatile__("rep;nop": : :"memory")
 #define read_barrier() __asm__ __volatile__("lfence":::"memory")
 #define write_barrier()        __asm__ __volatile__("sfence":::"memory")
 #define nop            __asm__ __volatile__("rep;nop": : :"memory")
 #define read_barrier() __asm__ __volatile__("lfence":::"memory")
 #define write_barrier()        __asm__ __volatile__("sfence":::"memory")
index f6a8e998672c4e4425103e576238946be9cabb61..4165c9f95dba610951dd72c7e81f3af4ec8021c5 100644 (file)
@@ -1,14 +1,6 @@
 #ifndef ARCH_H
 #define ARCH_H
 
 #ifndef ARCH_H
 #define ARCH_H
 
-#include <stdint.h>
-
-#ifdef __WORDSIZE
-#define BITS_PER_LONG  __WORDSIZE
-#else
-#define BITS_PER_LONG  32
-#endif
-
 enum {
        arch_x86_64 = 1,
        arch_i386,
 enum {
        arch_x86_64 = 1,
        arch_i386,
index 099bd9bd63170da1187983d25e50f0ba8c94b59d..8e96fb081af7aecb2da6ccd3fac40b511cd53636 100644 (file)
--- a/backend.c
+++ b/backend.c
@@ -1074,7 +1074,7 @@ static void *thread_main(void *data)
                goto err;
        }
 
                goto err;
        }
 
-#ifdef FIO_HAVE_LIBNUMA
+#ifdef CONFIG_LIBNUMA
        /* numa node setup */
        if (td->o.numa_cpumask_set || td->o.numa_memmask_set) {
                int ret;
        /* numa node setup */
        if (td->o.numa_cpumask_set || td->o.numa_memmask_set) {
                int ret;
index fd67079c01d8f6baf12890f6b90e6fb0632ea051..83cb57ea033ecd039a1c1331b27178d1a77bd9cc 100644 (file)
--- a/client.c
+++ b/client.c
@@ -267,7 +267,7 @@ int fio_client_add(const char *hostname, void **cookie)
 static int fio_client_connect_ip(struct fio_client *client)
 {
        struct sockaddr *addr;
 static int fio_client_connect_ip(struct fio_client *client)
 {
        struct sockaddr *addr;
-       fio_socklen_t socklen;
+       socklen_t socklen;
        int fd, domain;
 
        if (client->ipv6) {
        int fd, domain;
 
        if (client->ipv6) {
@@ -304,7 +304,7 @@ static int fio_client_connect_ip(struct fio_client *client)
 static int fio_client_connect_sock(struct fio_client *client)
 {
        struct sockaddr_un *addr = &client->addr_un;
 static int fio_client_connect_sock(struct fio_client *client)
 {
        struct sockaddr_un *addr = &client->addr_un;
-       fio_socklen_t len;
+       socklen_t len;
        int fd;
 
        memset(addr, 0, sizeof(*addr));
        int fd;
 
        memset(addr, 0, sizeof(*addr));
@@ -1037,7 +1037,7 @@ static int fio_client_timed_out(void)
        struct timeval tv;
        int ret = 0;
 
        struct timeval tv;
        int ret = 0;
 
-       gettimeofday(&tv, NULL);
+       fio_gettime(&tv, NULL);
 
        flist_for_each_safe(entry, tmp, &client_list) {
                client = flist_entry(entry, struct fio_client, list);
 
        flist_for_each_safe(entry, tmp, &client_list) {
                client = flist_entry(entry, struct fio_client, list);
@@ -1061,7 +1061,7 @@ int fio_handle_clients(void)
        struct pollfd *pfds;
        int i, ret = 0, retval = 0;
 
        struct pollfd *pfds;
        int i, ret = 0, retval = 0;
 
-       gettimeofday(&eta_tv, NULL);
+       fio_gettime(&eta_tv, NULL);
 
        pfds = malloc(nr_clients * sizeof(struct pollfd));
 
 
        pfds = malloc(nr_clients * sizeof(struct pollfd));
 
@@ -1095,7 +1095,7 @@ int fio_handle_clients(void)
                do {
                        struct timeval tv;
 
                do {
                        struct timeval tv;
 
-                       gettimeofday(&tv, NULL);
+                       fio_gettime(&tv, NULL);
                        if (mtime_since(&eta_tv, &tv) >= 900) {
                                request_client_etas();
                                memcpy(&eta_tv, &tv, sizeof(tv));
                        if (mtime_since(&eta_tv, &tv) >= 900) {
                                request_client_etas();
                                memcpy(&eta_tv, &tv, sizeof(tv));
index 8923f9a6235190d0837505c1852363fdf3fd6162..72e84197584e1aa8872e2905bc70710989443416 100644 (file)
 #define __must_check
 #endif
 
 #define __must_check
 #endif
 
-#ifndef _weak
-#ifndef __CYGWIN__
-#define _weak  __attribute__((weak))
-#else
-#define _weak
-#endif
-#endif
-
 #endif
 #endif
diff --git a/configure b/configure
new file mode 100755 (executable)
index 0000000..9cdfc49
--- /dev/null
+++ b/configure
@@ -0,0 +1,840 @@
+#!/bin/sh
+#
+# Fio configure script. Heavily influenced by the manual qemu configure
+# script. Sad this this is easier than autoconf and enemies.
+#
+
+# set temporary file name
+if test ! -z "$TMPDIR" ; then
+    TMPDIR1="${TMPDIR}"
+elif test ! -z "$TEMPDIR" ; then
+    TMPDIR1="${TEMPDIR}"
+else
+    TMPDIR1="/tmp"
+fi
+
+TMPC="${TMPDIR1}/fio-conf-${RANDOM}-$$-${RANDOM}.c"
+TMPO="${TMPDIR1}/fio-conf-${RANDOM}-$$-${RANDOM}.o"
+TMPE="${TMPDIR1}/fio-conf-${RANDOM}-$$-${RANDOM}.exe"
+
+# NB: do not call "exit" in the trap handler; this is buggy with some shells;
+# see <1285349658-3122-1-git-send-email-loic.minier@linaro.org>
+trap "rm -f $TMPC $TMPO $TMPE" EXIT INT QUIT TERM
+
+rm -rf config.log
+
+config_host_mak="config-host.mak"
+config_host_ld="config-host.ld"
+
+# Print a helpful header at the top of config.log
+echo "# FIO configure log $(date)" >> config.log
+printf "# Configured with:" >> config.log
+printf " '%s'" "$0" "$@" >> config.log
+echo >> config.log
+echo "#" >> config.log
+
+do_cc() {
+    # Run the compiler, capturing its output to the log.
+    echo $cc "$@" >> config.log
+    $cc "$@" >> config.log 2>&1 || return $?
+    # Test passed. If this is an --enable-werror build, rerun
+    # the test with -Werror and bail out if it fails. This
+    # makes warning-generating-errors in configure test code
+    # obvious to developers.
+    if test "$werror" != "yes"; then
+        return 0
+    fi
+    # Don't bother rerunning the compile if we were already using -Werror
+    case "$*" in
+        *-Werror*)
+           return 0
+        ;;
+    esac
+    echo $cc -Werror "$@" >> config.log
+    $cc -Werror "$@" >> config.log 2>&1 && return $?
+    echo "ERROR: configure test passed without -Werror but failed with -Werror."
+    echo "This is probably a bug in the configure script. The failing command"
+    echo "will be at the bottom of config.log."
+    echo "You can run configure with --disable-werror to bypass this check."
+    exit 1
+}
+
+compile_object() {
+  do_cc $CFLAGS -c -o $TMPO $TMPC
+}
+
+compile_prog() {
+  local_cflags="$1"
+  local_ldflags="$2"
+  echo "Compiling test case $3" >> config.log
+  do_cc $CFLAGS $local_cflags -o $TMPE $TMPC $LDFLAGS $local_ldflags
+}
+
+feature_not_found() {
+  feature=$1
+
+  echo "ERROR"
+  echo "ERROR: User requested feature $feature"
+  echo "ERROR: configure was not able to find it"
+  echo "ERROR"
+  exit 1;
+}
+
+has() {
+  type "$1" >/dev/null 2>&1
+}
+
+check_define() {
+  cat > $TMPC <<EOF
+#if !defined($1)
+#error $1 not defined
+#endif
+int main(void)
+{
+  return 0;
+}
+EOF
+  compile_object
+}
+
+targetos=""
+cpu=""
+
+cc="${CC-${cross_prefix}gcc}"
+
+if check_define __linux__ ; then
+  targetos="Linux"
+elif check_define _WIN32 ; then
+  targetos='MINGW32'
+elif check_define __OpenBSD__ ; then
+  targetos='OpenBSD'
+elif check_define __sun__ ; then
+  targetos='SunOS'
+else
+  targetos=`uname -s`
+fi
+
+# Some host OSes need non-standard checks for which CPU to use.
+# Note that these checks are broken for cross-compilation: if you're
+# cross-compiling to one of these OSes then you'll need to specify
+# the correct CPU with the --cpu option.
+case $targetos in
+Darwin)
+  # on Leopard most of the system is 32-bit, so we have to ask the kernel if
+  # we can run 64-bit userspace code.
+  # If the user didn't specify a CPU explicitly and the kernel says this is
+  # 64 bit hw, then assume x86_64. Otherwise fall through to the usual
+  # detection code.
+  if test -z "$cpu" && test "$(sysctl -n hw.optional.x86_64)" = "1"; then
+    cpu="x86_64"
+  fi
+  ;;
+SunOS)
+  # `uname -m` returns i86pc even on an x86_64 box, so default based on isainfo
+  if test -z "$cpu" && test "$(isainfo -k)" = "amd64"; then
+    cpu="x86_64"
+  fi
+esac
+
+if test ! -z "$cpu" ; then
+  # command line argument
+  :
+elif check_define __i386__ ; then
+  cpu="i386"
+elif check_define __x86_64__ ; then
+  cpu="x86_64"
+elif check_define __sparc__ ; then
+  if check_define __arch64__ ; then
+    cpu="sparc64"
+  else
+    cpu="sparc"
+  fi
+elif check_define _ARCH_PPC ; then
+  if check_define _ARCH_PPC64 ; then
+    cpu="ppc64"
+  else
+    cpu="ppc"
+  fi
+elif check_define __mips__ ; then
+  cpu="mips"
+elif check_define __ia64__ ; then
+  cpu="ia64"
+elif check_define __s390__ ; then
+  if check_define __s390x__ ; then
+    cpu="s390x"
+  else
+    cpu="s390"
+  fi
+elif check_define __arm__ ; then
+  cpu="arm"
+elif check_define __hppa__ ; then
+  cpu="hppa"
+else
+  cpu=`uname -m`
+fi
+
+# Normalise host CPU name and set ARCH.
+case "$cpu" in
+  ia64|ppc|ppc64|s390|s390x|sparc64)
+    cpu="$cpu"
+  ;;
+  i386|i486|i586|i686|i86pc|BePC)
+    cpu="i386"
+  ;;
+  x86_64|amd64)
+    cpu="x86_64"
+  ;;
+  armv*b|armv*l|arm)
+    cpu="arm"
+  ;;
+  hppa|parisc|parisc64)
+    cpu="hppa"
+  ;;
+  mips*)
+    cpu="mips"
+  ;;
+  sparc|sun4[cdmuv])
+    cpu="sparc"
+  ;;
+  *)
+    echo "Unknown CPU"
+    exit 1;
+  ;;
+esac
+
+if test -z $CC; then
+  if test "$targetos" = "FreeBSD"; then
+    if has clang; then
+      CC=clang
+    else
+      CC=gcc
+    fi
+  elif test "$targetos" = "MINGW32"; then
+    CC=x86_64-w64-mingw32-gcc
+  fi
+fi
+
+cc="${CC-${cross_prefix}gcc}"
+
+echo "Operating system              $targetos"
+echo "CPU                           $cpu"
+echo "Compiler                      $cc"
+echo
+
+##########################################
+# check for wordsize
+wordsize="0"
+cat > $TMPC <<EOF
+#include <stdio.h>
+int main(void)
+{
+  unsigned int wsize = sizeof(long) * 8;
+  printf("%d\n", wsize);
+  return 0;
+}
+EOF
+if compile_prog "" "" "wordsize"; then
+  wordsize=$($TMPE)
+fi
+echo "Wordsize                      $wordsize"
+
+##########################################
+# linux-aio probe
+libaio="no"
+cat > $TMPC <<EOF
+#include <libaio.h>
+#include <stddef.h>
+int main(void)
+{
+  io_setup(0, NULL);
+  return 0;
+}
+EOF
+if compile_prog "" "-laio" "libaio" ; then
+  libaio=yes
+  LIBS="-laio $LIBS"
+else
+  if test "$libaio" = "yes" ; then
+    feature_not_found "linux AIO"
+  fi
+  libaio=no
+fi
+echo "Linux AIO support             $libaio"
+
+##########################################
+# posix aio probe
+posix_aio="no"
+posix_aio_lrt="no"
+cat > $TMPC <<EOF
+#include <aio.h>
+int main(void)
+{
+  struct aiocb cb;
+  aio_read(&cb);
+  return 0;
+}
+EOF
+if compile_prog "" "" "posixaio" ; then
+  posix_aio="yes"
+elif compile_prog "" "-lrt" "posixaio"; then
+  posix_aio="yes"
+  posix_aio_lrt="yes"
+  LIBS="-lrt $LIBS"
+fi
+echo "POSIX AIO support             $posix_aio"
+echo "POSIX AIO support needs -lrt  $posix_aio_lrt"
+
+##########################################
+# posix aio fsync probe
+posix_aio_fsync="no"
+if test "$posix_aio" = "yes" ; then
+  cat > $TMPC <<EOF
+#include <fcntl.h>
+#include <aio.h>
+int main(void)
+{
+  struct aiocb cb;
+  return aio_fsync(O_SYNC, &cb);
+  return 0;
+}
+EOF
+  if compile_prog "" "$LIBS" "posix_aio_fsync" ; then
+    posix_aio_fsync=yes
+  fi
+fi
+echo "POSIX AIO fsync               $posix_aio_fsync"
+
+##########################################
+# solaris aio probe
+solaris_aio="no"
+cat > $TMPC <<EOF
+#include <sys/types.h>
+#include <sys/asynch.h>
+#include <unistd.h>
+int main(void)
+{
+  aio_result_t res;
+  return aioread(0, NULL, 0, 0, SEEK_SET, &res);
+  return 0;
+}
+EOF
+if compile_prog "" "-laio" "solarisaio" ; then
+  solaris_aio=yes
+  LIBS="-laio $LIBS"
+fi
+echo "Solaris AIO support           $solaris_aio"
+
+##########################################
+# __sync_fetch_and_and test
+sfaa="no"
+cat > $TMPC << EOF
+static int sfaa(int *ptr)
+{
+  return __sync_fetch_and_and(ptr, 0);
+}
+
+int main(int argc, char **argv)
+{
+  int val = 42;
+  sfaa(&val);
+  return val;
+}
+EOF
+if compile_prog "" "" "__sync_fetch_and_add()" ; then
+    sfaa="yes"
+fi
+echo "__sync_fetch_and add          $sfaa"
+
+##########################################
+# libverbs probe
+libverbs="no"
+cat > $TMPC << EOF
+#include <stdio.h>
+#include <infiniband/arch.h>
+int main(int argc, char **argv)
+{
+  struct ibv_pd *pd = ibv_alloc_pd(NULL);
+  return 0;
+}
+EOF
+if compile_prog "" "-libverbs" "libverbs" ; then
+    libverbs="yes"
+    LIBS="-libverbs $LIBS"
+fi
+echo "libverbs                      $libverbs"
+
+##########################################
+# rdmacm probe
+rdmacm="no"
+cat > $TMPC << EOF
+#include <stdio.h>
+#include <rdma/rdma_cma.h>
+int main(int argc, char **argv)
+{
+  rdma_destroy_qp(NULL);
+  return 0;
+}
+EOF
+if compile_prog "" "-lrdmacm" "rdma"; then
+    rdmacm="yes"
+    LIBS="-lrdmacm $LIBS"
+fi
+echo "rdmacm                        $rdmacm"
+
+##########################################
+# Linux fallocate probe
+linux_fallocate="no"
+cat > $TMPC << EOF
+#include <stdio.h>
+#include <linux/falloc.h>
+int main(int argc, char **argv)
+{
+  int r = fallocate(0, FALLOC_FL_KEEP_SIZE, 0, 1024);
+  return r;
+}
+EOF
+if compile_prog "" "" "linux_fallocate"; then
+    linux_fallocate="yes"
+fi
+echo "Linux fallocate               $linux_fallocate"
+
+##########################################
+# POSIX fadvise probe
+posix_fadvise="no"
+cat > $TMPC << EOF
+#include <stdio.h>
+#include <fcntl.h>
+int main(int argc, char **argv)
+{
+  int r = posix_fadvise(0, 0, 0, POSIX_FADV_NORMAL);
+  return r;
+}
+EOF
+if compile_prog "" "" "posix_fadvise"; then
+    posix_fadvise="yes"
+fi
+echo "POSIX fadvise                 $posix_fadvise"
+
+##########################################
+# POSIX fallocate probe
+posix_fallocate="no"
+cat > $TMPC << EOF
+#include <stdio.h>
+#include <fcntl.h>
+int main(int argc, char **argv)
+{
+  int r = posix_fallocate(0, 0, 1024);
+  return r;
+}
+EOF
+if compile_prog "" "" "posix_fallocate"; then
+    posix_fallocate="yes"
+fi
+echo "POSIX fallocate               $posix_fallocate"
+
+##########################################
+# sched_set/getaffinity 2 or 3 argument test
+linux_2arg_affinity="no"
+linux_3arg_affinity="no"
+cat > $TMPC << EOF
+#define _GNU_SOURCE
+#include <sched.h>
+int main(int argc, char **argv)
+{
+  cpu_set_t mask;
+  return sched_setaffinity(0, sizeof(mask), &mask);
+}
+EOF
+if compile_prog "" "" "sched_setaffinity(,,)"; then
+  linux_3arg_affinity="yes"
+else
+  cat > $TMPC << EOF
+#define _GNU_SOURCE
+#include <sched.h>
+int main(int argc, char **argv)
+{
+  cpu_set_t mask;
+  return sched_setaffinity(0, &mask);
+}
+EOF
+  if compile_prog "" "" "sched_setaffinity(,)"; then
+    linux_2arg_affinity="yes"
+  fi
+fi
+echo "sched_setaffinity(3 arg)      $linux_3arg_affinity"
+echo "sched_setaffinity(2 arg)      $linux_2arg_affinity"
+
+##########################################
+# clock_gettime probe
+clock_gettime="no"
+cat > $TMPC << EOF
+#include <stdio.h>
+#include <time.h>
+int main(int argc, char **argv)
+{
+  return clock_gettime(0, NULL);
+}
+EOF
+if compile_prog "" "" "clock_gettime"; then
+    clock_gettime="yes"
+elif compile_prog "" "-lrt" "clock_gettime"; then
+    clock_gettime="yes"
+    LIBS="-lrt $LIBS"
+fi
+echo "clock_gettime                 $clock_gettime"
+
+##########################################
+# CLOCK_MONOTONIC probe
+clock_monotonic="no"
+if test "$clock_gettime" = "yes" ; then
+  cat > $TMPC << EOF
+#include <stdio.h>
+#include <time.h>
+int main(int argc, char **argv)
+{
+  return clock_gettime(CLOCK_MONOTONIC, NULL);
+}
+EOF
+  if compile_prog "" "$LIBS" "clock monotonic"; then
+      clock_monotonic="yes"
+  fi
+fi
+echo "CLOCK_MONOTONIC               $clock_monotonic"
+
+##########################################
+# CLOCK_MONOTONIC_PRECISE probe
+clock_monotonic_precise="no"
+if test "$clock_gettime" = "yes" ; then
+  cat > $TMPC << EOF
+#include <stdio.h>
+#include <time.h>
+int main(int argc, char **argv)
+{
+  return clock_gettime(CLOCK_MONOTONIC_PRECISE, NULL);
+}
+EOF
+  if compile_prog "" "$LIBS" "clock monotonic precise"; then
+      clock_monotonic_precise="yes"
+  fi
+fi
+echo "CLOCK_MONOTONIC_PRECISE       $clock_monotonic_precise"
+
+##########################################
+# gettimeofday() probe
+gettimeofday="no"
+cat > $TMPC << EOF
+#include <sys/time.h>
+#include <stdio.h>
+int main(int argc, char **argv)
+{
+  struct timeval tv;
+  return gettimeofday(&tv, NULL);
+}
+EOF
+if compile_prog "" "" "gettimeofday"; then
+    gettimeofday="yes"
+fi
+echo "gettimeofday                  $gettimeofday"
+
+##########################################
+# fdatasync() probe
+fdatasync="no"
+cat > $TMPC << EOF
+#include <stdio.h>
+#include <unistd.h>
+int main(int argc, char **argv)
+{
+  return fdatasync(0);
+}
+EOF
+if compile_prog "" "" "fdatasync"; then
+  fdatasync="yes"
+fi
+echo "fdatasync                     $fdatasync"
+
+##########################################
+# sync_file_range() probe
+sync_file_range="no"
+cat > $TMPC << EOF
+#include <stdio.h>
+#include <unistd.h>
+#define _GNU_SOURCE
+#include <fcntl.h>
+#include <linux/fs.h>
+int main(int argc, char **argv)
+{
+  unsigned int flags = SYNC_FILE_RANGE_WAIT_BEFORE | SYNC_FILE_RANGE_WRITE |
+                       SYNC_FILE_RANGE_WAIT_AFTER;
+  return sync_file_range(0, 0, 0, flags);
+}
+EOF
+if compile_prog "" "" "sync_file_range"; then
+  sync_file_range="yes"
+fi
+echo "sync_file_range               $sync_file_range"
+
+##########################################
+# ext4 move extent probe
+ext4_me="no"
+cat > $TMPC << EOF
+#include <fcntl.h>
+#include <sys/ioctl.h>
+int main(int argc, char **argv)
+{
+  struct move_extent me;
+  return ioctl(0, EXT4_IOC_MOVE_EXT, &me);
+}
+EOF
+if compile_prog "" "" "ext4 move extent"; then
+  ext4_me="yes"
+fi
+echo "EXT4 move extent              $ext4_me"
+
+##########################################
+# splice probe
+linux_splice="no"
+cat > $TMPC << EOF
+#define _GNU_SOURCE
+#include <stdio.h>
+#include <fcntl.h>
+int main(int argc, char **argv)
+{
+  return splice(0, NULL, 0, NULL, 0, SPLICE_F_NONBLOCK);
+}
+EOF
+if compile_prog "" "" "linux splice"; then
+  linux_splice="yes"
+fi
+echo "Linux splice(2)               $linux_splice"
+
+##########################################
+# GUASI probe
+guasi="no"
+cat > $TMPC << EOF
+#include <guasi.h>
+#include <guasi_syscalls.h>
+int main(int argc, char **argv)
+{
+  guasi_t ctx = guasi_create(0, 0, 0);
+  return 0;
+}
+EOF
+if compile_prog "" "" "guasi"; then
+  guasi="yes"
+fi
+echo "GUASI                         $guasi"
+
+##########################################
+# fusion-aw probe
+fusion_aw="no"
+cat > $TMPC << EOF
+#include <vsl_dp_experimental/vectored_write.h>
+int main(int argc, char **argv)
+{
+  struct vsl_iovec iov;
+  return vsl_vectored_write(0, &iov, 0, O_ATOMIC);
+}
+EOF
+if compile_prog "" "" "fusion-aw"; then
+  fusion_aw="yes"
+fi
+echo "Fusion-io atomic engine       $fusion_aw"
+
+##########################################
+# libnuma probe
+libnuma="no"
+cat > $TMPC << EOF
+#include <numa.h>
+int main(int argc, char **argv)
+{
+  return numa_available();
+}
+EOF
+if compile_prog "" "-lnuma" "libnuma"; then
+  libnuma="yes"
+  LIBS="-lnuma $LIBS"
+fi
+echo "libnuma                       $libnuma"
+
+##########################################
+# strsep() probe
+strsep="no"
+cat > $TMPC << EOF
+#include <string.h>
+int main(int argc, char **argv)
+{
+  strsep(NULL, NULL);
+  return 0;
+}
+EOF
+if compile_prog "" "" "strsep"; then
+  strsep="yes"
+fi
+echo "strsep                        $strsep"
+
+##########################################
+# getopt_long_only() probe
+getopt_long_only="no"
+cat > $TMPC << EOF
+#include <unistd.h>
+#include <stdio.h>
+int main(int argc, char **argv)
+{
+  int c = getopt_long_only(argc, argv, NULL, NULL, NULL);
+  return c;
+}
+EOF
+if compile_prog "" "" "getopt_long_only"; then
+  getopt_long_only="yes"
+fi
+echo "getopt_long_only()            $getopt_long_only"
+
+##########################################
+# inet_aton() probe
+inet_aton="no"
+cat > $TMPC << EOF
+#include <sys/socket.h>
+#include <arpa/inet.h>
+#include <stdio.h>
+int main(int argc, char **argv)
+{
+  struct in_addr in;
+  return inet_aton(NULL, &in);
+}
+EOF
+if compile_prog "" "" "inet_aton"; then
+  inet_aton="yes"
+fi
+echo "inet_aton                     $inet_aton"
+
+##########################################
+# socklen_t probe
+socklen_t="no"
+cat > $TMPC << EOF
+#include <string.h>
+#include <netinet/in.h>
+int main(int argc, char **argv)
+{
+  socklen_t len = 0;
+  return len;
+}
+EOF
+if compile_prog "" "" "socklen_t"; then
+  socklen_t="yes"
+fi
+echo "socklen_t                     $socklen_t"
+
+##########################################
+# Whether or not __thread is supported for TLS
+tls_thread="no"
+cat > $TMPC << EOF
+#include <stdio.h>
+static int __thread ret;
+int main(int argc, char **argv)
+{
+  return ret;
+}
+EOF
+if compile_prog "" "" "__thread"; then
+  tls_thread="yes"
+fi
+echo "__thread                      $tls_thread"
+
+#############################################################################
+
+echo "# Automatically generated by configure - do not modify" > $config_host_mak
+printf "# Configured with:" >> $config_host_mak
+printf " '%s'" "$0" "$@" >> $config_host_mak
+echo >> $config_host_mak
+
+if test "$wordsize" = "64" ; then
+  echo "CONFIG_64BIT=y" >> $config_host_mak
+elif test "$wordsize" = "32" ; then
+  echo "CONFIG_32BIT=y" >> $config_host_mak
+else
+  echo "Unknown wordsize!"
+  exit 1
+fi
+if test "$libaio" = "yes" ; then
+  echo "CONFIG_LIBAIO=y" >> $config_host_mak
+fi
+if test "$posix_aio" = "yes" ; then
+  echo "CONFIG_POSIXAIO=y" >> $config_host_mak
+fi
+if test "$posix_aio_fsync" = "yes" ; then
+  echo "CONFIG_POSIXAIO_FSYNC=y" >> $config_host_mak
+fi
+if test "$linux_fallocate" = "yes" ; then
+  echo "CONFIG_LINUX_FALLOCATE=y" >> $config_host_mak
+fi
+if test "$posix_fallocate" = "yes" ; then
+  echo "CONFIG_POSIX_FALLOCATE=y" >> $config_host_mak
+fi
+if test "$fdatasync" = "yes" ; then
+  echo "CONFIG_FDATASYNC=y" >> $config_host_mak
+fi
+if test "$sync_file_range" = "yes" ; then
+  echo "CONFIG_SYNC_FILE_RANGE=y" >> $config_host_mak
+fi
+if test "$sfaa" = "yes" ; then
+  echo "CONFIG_SFAA=y" >> $config_host_mak
+fi
+if test "$libverbs" = "yes" -o "rdmacm" = "yes" ; then
+  echo "CONFIG_RDMA=y" >> $config_host_mak
+fi
+if test "$clock_gettime" = "yes" ; then
+  echo "CONFIG_CLOCK_GETTIME=y" >> $config_host_mak
+fi
+if test "$clock_monotonic" = "yes" ; then
+  echo "CONFIG_CLOCK_MONOTONIC=y" >> $config_host_mak
+fi
+if test "$clock_monotonic_precise" = "yes" ; then
+  echo "CONFIG_CLOCK_MONOTONIC_PRECISE=y" >> $config_host_mak
+fi
+if test "$gettimeofday" = "yes" ; then
+  echo "CONFIG_GETTIMEOFDAY=y" >> $config_host_mak
+fi
+if test "$posix_fadvise" = "yes" ; then
+  echo "CONFIG_POSIX_FADVISE=y" >> $config_host_mak
+fi
+if test "$linux_3arg_affinity" = "yes" ; then
+  echo "CONFIG_3ARG_AFFINITY=y" >> $config_host_mak
+elif test "$linux_2arg_affinity" = "yes" ; then
+  echo "CONFIG_2ARG_AFFINITY=y" >> $config_host_mak
+fi
+if test "$strsep" = "yes" ; then
+  echo "CONFIG_STRSEP=y" >> $config_host_mak
+fi
+if test "$getopt_long_only" = "yes" ; then
+  echo "CONFIG_GETOPT_LONG_ONLY=y" >> $config_host_mak
+fi
+if test "$inet_aton" = "yes" ; then
+  echo "CONFIG_INET_ATON=y" >> $config_host_mak
+fi
+if test "$socklen_t" = "yes" ; then
+  echo "CONFIG_SOCKLEN_T=y" >> $config_host_mak
+fi
+if test "$ext4_me" = "yes" ; then
+  echo "CONFIG_LINUX_EXT4_MOVE_EXTENT=y" >> $config_host_mak
+fi
+if test "$linux_splice" = "yes" ; then
+  echo "CONFIG_LINUX_SPLICE=y" >> $config_host_mak
+fi
+if test "$guasi" = "yes" ; then
+  echo "CONFIG_GUASI=y" >> $config_host_mak
+fi
+if test "$fusion_aw" = "yes" ; then
+  echo "CONFIG_FUSION_AW=y" >> $config_host_mak
+fi
+if test "$libnuma" = "yes" ; then
+  echo "CONFIG_LIBNUMA=y" >> $config_host_mak
+fi
+if test "$solaris_aio" = "yes" ; then
+  echo "CONFIG_SOLARISAIO=y" >> $config_host_mak
+fi
+if test "$tls_thread" = "yes" ; then
+  echo "CONFIG_TLS_THREAD=y" >> $config_host_mak
+fi
+
+echo "LIBS+=$LIBS" >> $config_host_mak
+echo "CC=$cc" >> $config_host_mak
index 118c6dd5a0cc599ca2d36572eb86bcf92fec0e24..4213592460586d890253a00971a953bd349bbd86 100644 (file)
@@ -22,8 +22,6 @@
 
 #include "../fio.h"
 
 
 #include "../fio.h"
 
-#ifdef FIO_HAVE_FUSION_AW
-
 #include <vsl_dp_experimental/vectored_write.h>
 
 /* Fix sector size to 512 bytes independent of actual sector size, just like
 #include <vsl_dp_experimental/vectored_write.h>
 
 /* Fix sector size to 512 bytes independent of actual sector size, just like
@@ -145,22 +143,6 @@ static struct ioengine_ops ioengine = {
        .flags = FIO_SYNCIO | FIO_RAWIO | FIO_MEMALIGN
 };
 
        .flags = FIO_SYNCIO | FIO_RAWIO | FIO_MEMALIGN
 };
 
-#else /* !FUSION_HAVE_FUSION_AW */
-
-static int fio_fusion_aw_eng_init(struct thread_data fio_unused *td)
-{
-       log_err("fio: fusion atomic write engine not available\n");
-       return 1;
-}
-
-static struct ioengine_ops ioengine = {
-       .name           = "fusion-aw-sync",
-       .version        = FIO_IOOPS_VERSION,
-       .init           = fio_fusion_aw_eng_init,
-};
-
-#endif /* FUSION_HAVE_FUSION_AW */
-
 static void fio_init fio_fusion_aw_init(void)
 {
        register_ioengine(&ioengine);
 static void fio_init fio_fusion_aw_init(void)
 {
        register_ioengine(&ioengine);
index 4839019fc49c3ec88facc04eda4e5c812b3a68f9..6faae8d0bfc2054ea542f31181b3f888437ea06c 100644 (file)
@@ -21,8 +21,6 @@
 
 #include "../fio.h"
 
 
 #include "../fio.h"
 
-#ifdef FIO_HAVE_GUASI
-
 #define GFIO_MIN_THREADS 32
 #ifndef GFIO_MAX_THREADS
 #define GFIO_MAX_THREADS 2000
 #define GFIO_MIN_THREADS 32
 #ifndef GFIO_MAX_THREADS
 #define GFIO_MAX_THREADS 2000
@@ -264,27 +262,6 @@ static struct ioengine_ops ioengine = {
        .get_file_size  = generic_get_file_size,
 };
 
        .get_file_size  = generic_get_file_size,
 };
 
-#else /* FIO_HAVE_GUASI */
-
-/*
- * When we have a proper configure system in place, we simply wont build
- * and install this io engine. For now install a crippled version that
- * just complains and fails to load.
- */
-static int fio_guasi_init(struct thread_data fio_unused *td)
-{
-       log_err("fio: guasi not available\n");
-       return 1;
-}
-
-static struct ioengine_ops ioengine = {
-       .name           = "guasi",
-       .version        = FIO_IOOPS_VERSION,
-       .init           = fio_guasi_init,
-};
-
-#endif
-
 static void fio_init fio_guasi_register(void)
 {
        register_ioengine(&ioengine);
 static void fio_init fio_guasi_register(void)
 {
        register_ioengine(&ioengine);
index f17260d32911523b563d3c8493abcb3f67960eba..4d1f3a311a18fb4ce6b6fad69258062abe785574 100644 (file)
@@ -9,11 +9,10 @@
 #include <unistd.h>
 #include <errno.h>
 #include <assert.h>
 #include <unistd.h>
 #include <errno.h>
 #include <assert.h>
+#include <libaio.h>
 
 #include "../fio.h"
 
 
 #include "../fio.h"
 
-#ifdef FIO_HAVE_LIBAIO
-
 struct libaio_data {
        io_context_t aio_ctx;
        struct io_event *aio_events;
 struct libaio_data {
        io_context_t aio_ctx;
        struct io_event *aio_events;
@@ -304,27 +303,6 @@ static struct ioengine_ops ioengine = {
        .option_struct_size     = sizeof(struct libaio_options),
 };
 
        .option_struct_size     = sizeof(struct libaio_options),
 };
 
-#else /* FIO_HAVE_LIBAIO */
-
-/*
- * When we have a proper configure system in place, we simply wont build
- * and install this io engine. For now install a crippled version that
- * just complains and fails to load.
- */
-static int fio_libaio_init(struct thread_data fio_unused *td)
-{
-       log_err("fio: libaio not available\n");
-       return 1;
-}
-
-static struct ioengine_ops ioengine = {
-       .name           = "libaio",
-       .version        = FIO_IOOPS_VERSION,
-       .init           = fio_libaio_init,
-};
-
-#endif
-
 static void fio_init fio_libaio_register(void)
 {
        register_ioengine(&ioengine);
 static void fio_init fio_libaio_register(void)
 {
        register_ioengine(&ioengine);
index edb5577660f032159f400a655c35eff426920d10..eb05bcccc5cb9e1d8db8236a1a1fc0f78d8db48f 100644 (file)
@@ -157,7 +157,7 @@ static int fio_netio_prep(struct thread_data *td, struct io_u *io_u)
        return 0;
 }
 
        return 0;
 }
 
-#ifdef FIO_HAVE_SPLICE
+#ifdef CONFIG_LINUX_SPLICE
 static int splice_io_u(int fdin, int fdout, unsigned int len)
 {
        int bytes = 0;
 static int splice_io_u(int fdin, int fdout, unsigned int len)
 {
        int bytes = 0;
@@ -352,7 +352,7 @@ static int fio_netio_recv(struct thread_data *td, struct io_u *io_u)
 
        do {
                if (o->proto == FIO_TYPE_UDP) {
 
        do {
                if (o->proto == FIO_TYPE_UDP) {
-                       fio_socklen_t len = sizeof(nd->addr);
+                       socklen_t len = sizeof(nd->addr);
                        struct sockaddr *from = (struct sockaddr *) &nd->addr;
 
                        ret = recvfrom(io_u->file->fd, io_u->xfer_buf,
                        struct sockaddr *from = (struct sockaddr *) &nd->addr;
 
                        ret = recvfrom(io_u->file->fd, io_u->xfer_buf,
@@ -474,7 +474,7 @@ static int fio_netio_connect(struct thread_data *td, struct fio_file *f)
        if (o->proto == FIO_TYPE_UDP)
                return 0;
        else if (o->proto == FIO_TYPE_TCP) {
        if (o->proto == FIO_TYPE_UDP)
                return 0;
        else if (o->proto == FIO_TYPE_TCP) {
-               fio_socklen_t len = sizeof(nd->addr);
+               socklen_t len = sizeof(nd->addr);
 
                if (connect(f->fd, (struct sockaddr *) &nd->addr, len) < 0) {
                        td_verror(td, errno, "connect");
 
                if (connect(f->fd, (struct sockaddr *) &nd->addr, len) < 0) {
                        td_verror(td, errno, "connect");
@@ -483,7 +483,7 @@ static int fio_netio_connect(struct thread_data *td, struct fio_file *f)
                }
        } else {
                struct sockaddr_un *addr = &nd->addr_un;
                }
        } else {
                struct sockaddr_un *addr = &nd->addr_un;
-               fio_socklen_t len;
+               socklen_t len;
 
                len = sizeof(addr->sun_family) + strlen(addr->sun_path) + 1;
 
 
                len = sizeof(addr->sun_family) + strlen(addr->sun_path) + 1;
 
@@ -501,7 +501,7 @@ static int fio_netio_accept(struct thread_data *td, struct fio_file *f)
 {
        struct netio_data *nd = td->io_ops->data;
        struct netio_options *o = td->eo;
 {
        struct netio_data *nd = td->io_ops->data;
        struct netio_options *o = td->eo;
-       fio_socklen_t socklen = sizeof(nd->addr);
+       socklen_t socklen = sizeof(nd->addr);
        int state;
 
        if (o->proto == FIO_TYPE_UDP) {
        int state;
 
        if (o->proto == FIO_TYPE_UDP) {
@@ -566,7 +566,7 @@ static int fio_netio_udp_recv_open(struct thread_data *td, struct fio_file *f)
        struct netio_data *nd = td->io_ops->data;
        struct udp_close_msg msg;
        struct sockaddr *to = (struct sockaddr *) &nd->addr;
        struct netio_data *nd = td->io_ops->data;
        struct udp_close_msg msg;
        struct sockaddr *to = (struct sockaddr *) &nd->addr;
-       fio_socklen_t len = sizeof(nd->addr);
+       socklen_t len = sizeof(nd->addr);
        int ret;
 
        ret = recvfrom(f->fd, &msg, sizeof(msg), MSG_WAITALL, to, &len);
        int ret;
 
        ret = recvfrom(f->fd, &msg, sizeof(msg), MSG_WAITALL, to, &len);
@@ -887,7 +887,7 @@ static void fio_netio_terminate(struct thread_data *td)
        kill(td->pid, SIGUSR2);
 }
 
        kill(td->pid, SIGUSR2);
 }
 
-#ifdef FIO_HAVE_SPLICE
+#ifdef CONFIG_LINUX_SPLICE
 static int fio_netio_setup_splice(struct thread_data *td)
 {
        struct netio_data *nd;
 static int fio_netio_setup_splice(struct thread_data *td)
 {
        struct netio_data *nd;
@@ -954,7 +954,7 @@ static int str_hostname_cb(void *data, const char *input)
 static void fio_init fio_netio_register(void)
 {
        register_ioengine(&ioengine_rw);
 static void fio_init fio_netio_register(void)
 {
        register_ioengine(&ioengine_rw);
-#ifdef FIO_HAVE_SPLICE
+#ifdef CONFIG_LINUX_SPLICE
        register_ioengine(&ioengine_splice);
 #endif
 }
        register_ioengine(&ioengine_splice);
 #endif
 }
@@ -962,7 +962,7 @@ static void fio_init fio_netio_register(void)
 static void fio_exit fio_netio_unregister(void)
 {
        unregister_ioengine(&ioengine_rw);
 static void fio_exit fio_netio_unregister(void)
 {
        unregister_ioengine(&ioengine_rw);
-#ifdef FIO_HAVE_SPLICE
+#ifdef CONFIG_LINUX_SPLICE
        unregister_ioengine(&ioengine_splice);
 #endif
 }
        unregister_ioengine(&ioengine_splice);
 #endif
 }
index 0966e0d5e7fa66b261c20bb1948177e108ab4455..0872f9aebbe9ab59bd9d0e21b0ac089b0b1da8e4 100644 (file)
@@ -12,8 +12,6 @@
 
 #include "../fio.h"
 
 
 #include "../fio.h"
 
-#ifdef FIO_HAVE_POSIXAIO
-
 struct posixaio_data {
        struct io_u **aio_events;
        unsigned int queued;
 struct posixaio_data {
        struct io_u **aio_events;
        unsigned int queued;
@@ -173,7 +171,7 @@ static int fio_posixaio_queue(struct thread_data *td,
                do_io_u_trim(td, io_u);
                return FIO_Q_COMPLETED;
        } else {
                do_io_u_trim(td, io_u);
                return FIO_Q_COMPLETED;
        } else {
-#ifdef FIO_HAVE_POSIXAIO_FSYNC
+#ifdef CONFIG_POSIXAIO_FSYNC
                ret = aio_fsync(O_SYNC, aiocb);
 #else
                if (pd->queued)
                ret = aio_fsync(O_SYNC, aiocb);
 #else
                if (pd->queued)
@@ -240,27 +238,6 @@ static struct ioengine_ops ioengine = {
        .get_file_size  = generic_get_file_size,
 };
 
        .get_file_size  = generic_get_file_size,
 };
 
-#else /* FIO_HAVE_POSIXAIO */
-
-/*
- * When we have a proper configure system in place, we simply wont build
- * and install this io engine. For now install a crippled version that
- * just complains and fails to load.
- */
-static int fio_posixaio_init(struct thread_data fio_unused *td)
-{
-       log_err("fio: posixaio not available\n");
-       return 1;
-}
-
-static struct ioengine_ops ioengine = {
-       .name           = "posixaio",
-       .version        = FIO_IOOPS_VERSION,
-       .init           = fio_posixaio_init,
-};
-
-#endif
-
 static void fio_init fio_posixaio_register(void)
 {
        register_ioengine(&ioengine);
 static void fio_init fio_posixaio_register(void)
 {
        register_ioengine(&ioengine);
index 9b1830158a652f6b48399c323faa11130cd4bc03..a847b541d3a0927dd3b575fa5a38fb3dc5832ff4 100644 (file)
@@ -48,8 +48,6 @@
 #include "../fio.h"
 #include "../hash.h"
 
 #include "../fio.h"
 #include "../hash.h"
 
-#ifdef FIO_HAVE_RDMA
-
 #include <rdma/rdma_cma.h>
 #include <infiniband/arch.h>
 
 #include <rdma/rdma_cma.h>
 #include <infiniband/arch.h>
 
@@ -1224,49 +1222,6 @@ static struct ioengine_ops ioengine_rw = {
        .flags          = FIO_DISKLESSIO | FIO_UNIDIR | FIO_PIPEIO,
 };
 
        .flags          = FIO_DISKLESSIO | FIO_UNIDIR | FIO_PIPEIO,
 };
 
-#else /* FIO_HAVE_RDMA */
-
-static int fio_rdmaio_open_file(struct thread_data *td, struct fio_file *f)
-{
-       return 0;
-}
-
-static int fio_rdmaio_close_file(struct thread_data *td, struct fio_file *f)
-{
-       return 0;
-}
-
-static int fio_rdmaio_queue(struct thread_data *td, struct io_u *io_u)
-{
-       return FIO_Q_COMPLETED;
-}
-
-static int fio_rdmaio_init(struct thread_data fio_unused * td)
-{
-       log_err("fio: rdma(librdmacm libibverbs) not available\n");
-       log_err("     You haven't compiled rdma ioengine into fio.\n");
-       log_err("     If you want to try rdma ioengine,\n");
-       log_err("     make sure OFED is installed,\n");
-       log_err("     $ ofed_info\n");
-       log_err("     then try to make fio as follows:\n");
-       log_err("     $ export EXTFLAGS+=\" -DFIO_HAVE_RDMA \"\n");
-       log_err("     $ export EXTLIBS+=\" -libverbs -lrdmacm \"\n");
-       log_err("     $ make clean && make\n");
-       return 1;
-}
-
-static struct ioengine_ops ioengine_rw = {
-       .name           = "rdma",
-       .version        = FIO_IOOPS_VERSION,
-       .init           = fio_rdmaio_init,
-       .queue          = fio_rdmaio_queue,
-       .open_file      = fio_rdmaio_open_file,
-       .close_file     = fio_rdmaio_close_file,
-       .flags          = FIO_SYNCIO | FIO_DISKLESSIO | FIO_UNIDIR | FIO_PIPEIO,
-};
-
-#endif
-
 static void fio_init fio_rdmaio_register(void)
 {
        register_ioengine(&ioengine_rw);
 static void fio_init fio_rdmaio_register(void)
 {
        register_ioengine(&ioengine_rw);
index 906a154a2eee3093274f3537cdf4bf40bcf1751c..137dc225d151393959266e0e6e1df51377c67bfc 100644 (file)
@@ -10,8 +10,6 @@
 
 #include "../fio.h"
 
 
 #include "../fio.h"
 
-#ifdef FIO_HAVE_SOLARISAIO
-
 #include <sys/asynch.h>
 
 struct solarisaio_data {
 #include <sys/asynch.h>
 
 struct solarisaio_data {
@@ -225,27 +223,6 @@ static struct ioengine_ops ioengine = {
        .get_file_size  = generic_get_file_size,
 };
 
        .get_file_size  = generic_get_file_size,
 };
 
-#else /* FIO_HAVE_SOLARISAIO */
-
-/*
- * When we have a proper configure system in place, we simply wont build
- * and install this io engine. For now install a crippled version that
- * just complains and fails to load.
- */
-static int fio_solarisaio_init(struct thread_data fio_unused *td)
-{
-       log_err("fio: solarisaio not available\n");
-       return 1;
-}
-
-static struct ioengine_ops ioengine = {
-       .name           = "solarisaio",
-       .version        = FIO_IOOPS_VERSION,
-       .init           = fio_solarisaio_init,
-};
-
-#endif
-
 static void fio_init fio_solarisaio_register(void)
 {
        register_ioengine(&ioengine);
 static void fio_init fio_solarisaio_register(void)
 {
        register_ioengine(&ioengine);
index ca7997b70aeae1142263a580acdfb555c6fd8b2c..f35ae17bc574b7af5928e4c73e6e76f8a744b230 100644 (file)
@@ -15,8 +15,6 @@
 
 #include "../fio.h"
 
 
 #include "../fio.h"
 
-#ifdef FIO_HAVE_SPLICE
-
 struct spliceio_data {
        int pipe[2];
        int vmsplice_to_user;
 struct spliceio_data {
        int pipe[2];
        int vmsplice_to_user;
@@ -302,27 +300,6 @@ static struct ioengine_ops ioengine = {
        .flags          = FIO_SYNCIO | FIO_PIPEIO,
 };
 
        .flags          = FIO_SYNCIO | FIO_PIPEIO,
 };
 
-#else /* FIO_HAVE_SPLICE */
-
-/*
- * When we have a proper configure system in place, we simply wont build
- * and install this io engine. For now install a crippled version that
- * just complains and fails to load.
- */
-static int fio_spliceio_init(struct thread_data fio_unused *td)
-{
-       log_err("fio: splice not available\n");
-       return 1;
-}
-
-static struct ioengine_ops ioengine = {
-       .name           = "splice",
-       .version        = FIO_IOOPS_VERSION,
-       .init           = fio_spliceio_init,
-};
-
-#endif
-
 static void fio_init fio_spliceio_register(void)
 {
        register_ioengine(&ioengine);
 static void fio_init fio_spliceio_register(void)
 {
        register_ioengine(&ioengine);
diff --git a/engines/syslet-rw.c b/engines/syslet-rw.c
deleted file mode 100644 (file)
index 15e4c25..0000000
+++ /dev/null
@@ -1,327 +0,0 @@
-/*
- * syslet engine
- *
- * IO engine that does regular pread(2)/pwrite(2) to transfer data, but
- * with syslets to make the execution async.
- *
- */
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <errno.h>
-#include <assert.h>
-#include <malloc.h>
-#include <asm/unistd.h>
-
-#include "../fio.h"
-#include "../lib/fls.h"
-
-#ifdef FIO_HAVE_SYSLET
-
-#ifdef __NR_pread64
-#define __NR_fio_pread __NR_pread64
-#define __NR_fio_pwrite        __NR_pwrite64
-#else
-#define __NR_fio_pread __NR_pread
-#define __NR_fio_pwrite        __NR_pwrite
-#endif
-
-struct syslet_data {
-       struct io_u **events;
-       unsigned int nr_events;
-       
-       struct syslet_ring *ring;
-       unsigned int ring_mask;
-       void *stack;
-};
-
-static void fio_syslet_add_event(struct thread_data *td, struct io_u *io_u)
-{
-       struct syslet_data *sd = td->io_ops->data;
-
-       assert(sd->nr_events < td->o.iodepth);
-       sd->events[sd->nr_events++] = io_u;
-}
-
-static void fio_syslet_add_events(struct thread_data *td, unsigned int nr)
-{
-       struct syslet_data *sd = td->io_ops->data;
-       unsigned int i, uidx;
-
-       uidx = sd->ring->user_tail;
-       read_barrier();
-
-       for (i = 0; i < nr; i++) {
-               unsigned int idx = (i + uidx) & sd->ring_mask;
-               struct syslet_completion *comp = &sd->ring->comp[idx];
-               struct io_u *io_u = (struct io_u *) (long) comp->caller_data;
-               long ret;
-
-               ret = comp->status;
-               if (ret <= 0) {
-                       io_u->resid = io_u->xfer_buflen;
-                       io_u->error = -ret;
-               } else {
-                       io_u->resid = io_u->xfer_buflen - ret;
-                       io_u->error = 0;
-               }
-
-               fio_syslet_add_event(td, io_u);
-       }
-}
-
-static void fio_syslet_wait_for_events(struct thread_data *td)
-{
-       struct syslet_data *sd = td->io_ops->data;
-       struct syslet_ring *ring = sd->ring;
-
-       do {
-               unsigned int kh = ring->kernel_head;
-               int ret;
-
-               /*
-                * first reap events that are already completed
-                */
-               if (ring->user_tail != kh) {
-                       unsigned int nr = kh - ring->user_tail;
-
-                       fio_syslet_add_events(td, nr);
-                       ring->user_tail = kh;
-                       break;
-               }
-
-               /*
-                * block waiting for at least one event
-                */
-               ret = syscall(__NR_syslet_ring_wait, ring, ring->user_tail);
-               assert(!ret);
-       } while (1);
-}
-
-static int fio_syslet_getevents(struct thread_data *td, unsigned int min,
-                               unsigned int fio_unused max,
-                               struct timespec fio_unused *t)
-{
-       struct syslet_data *sd = td->io_ops->data;
-       long ret;
-
-       /*
-        * While we have less events than requested, block waiting for them
-        * (if we have to, there may already be more completed events ready
-        * for us - see fio_syslet_wait_for_events()
-        */
-       while (sd->nr_events < min)
-               fio_syslet_wait_for_events(td);
-
-       ret = sd->nr_events;
-       sd->nr_events = 0;
-       return ret;
-}
-
-static struct io_u *fio_syslet_event(struct thread_data *td, int event)
-{
-       struct syslet_data *sd = td->io_ops->data;
-
-       return sd->events[event];
-}
-
-static void fio_syslet_prep_sync(struct fio_file *f,
-                                struct indirect_registers *regs)
-{
-       FILL_IN(*regs, __NR_fsync, (long) f->fd);
-}
-
-static void fio_syslet_prep_datasync(struct fio_file *f,
-                                    struct indirect_registers *regs)
-{
-       FILL_IN(*regs, __NR_fdatasync, (long) f->fd);
-}
-
-static void fio_syslet_prep_rw(struct io_u *io_u, struct fio_file *f,
-                              struct indirect_registers *regs)
-{
-       long nr;
-
-       /*
-        * prepare rw
-        */
-       if (io_u->ddir == DDIR_READ)
-               nr = __NR_fio_pread;
-       else
-               nr = __NR_fio_pwrite;
-
-       FILL_IN(*regs, nr, (long) f->fd, (long) io_u->xfer_buf,
-               (long) io_u->xfer_buflen, (long) io_u->offset);
-}
-
-static void fio_syslet_prep(struct io_u *io_u, struct indirect_registers *regs)
-{
-       struct fio_file *f = io_u->file;
-
-       if (io_u->ddir == DDIR_SYNC)
-               fio_syslet_prep_sync(f, regs);
-       else if (io_u->ddir == DDIR_DATASYNC)
-               fio_syslet_prep_datasync(f, regs);
-       else
-               fio_syslet_prep_rw(io_u, f, regs);
-}
-
-static void ret_func(void)
-{
-       syscall(__NR_exit);
-}
-
-static int fio_syslet_queue(struct thread_data *td, struct io_u *io_u)
-{
-       struct syslet_data *sd = td->io_ops->data;
-       union indirect_params params;
-       struct indirect_registers regs;
-       int ret;
-
-       fio_ro_check(td, io_u);
-
-       memset(&params, 0, sizeof(params));
-       fill_syslet_args(&params.syslet, sd->ring, (long)io_u, ret_func, sd->stack);
-
-       fio_syslet_prep(io_u, &regs);
-
-       ret = syscall(__NR_indirect, &regs, &params, sizeof(params), 0);
-       if (ret == (int) io_u->xfer_buflen) {
-               /*
-                * completed sync, account. this also catches fsync().
-                */
-               return FIO_Q_COMPLETED;
-       } else if (ret < 0) {
-               /*
-                * queued for async execution
-                */
-               if (errno == ESYSLETPENDING)
-                       return FIO_Q_QUEUED;
-       }
-
-       io_u->error = errno;
-       td_verror(td, io_u->error, "xfer");
-       return FIO_Q_COMPLETED;
-}
-
-static int check_syslet_support(struct syslet_data *sd)
-{
-       union indirect_params params;
-       struct indirect_registers regs;
-       pid_t pid, my_pid = getpid();
-
-       memset(&params, 0, sizeof(params));
-       fill_syslet_args(&params.syslet, sd->ring, 0, ret_func, sd->stack);
-
-       FILL_IN(regs, __NR_getpid);
-
-       pid = syscall(__NR_indirect, &regs, &params, sizeof(params), 0);
-       if (pid == my_pid)
-               return 0;
-
-       return 1;
-}
-
-static void fio_syslet_cleanup(struct thread_data *td)
-{
-       struct syslet_data *sd = td->io_ops->data;
-
-       if (sd) {
-               free(sd->events);
-               free(sd->ring);
-               free(sd);
-       }
-}
-
-static int fio_syslet_init(struct thread_data *td)
-{
-       struct syslet_data *sd;
-       void *ring = NULL, *stack = NULL;
-       unsigned int ring_size, ring_nr;
-
-       sd = malloc(sizeof(*sd));
-       memset(sd, 0, sizeof(*sd));
-
-       sd->events = malloc(sizeof(struct io_u *) * td->o.iodepth);
-       memset(sd->events, 0, sizeof(struct io_u *) * td->o.iodepth);
-
-       /*
-        * The ring needs to be a power-of-2, so round it up if we have to
-        */
-       ring_nr = td->o.iodepth;
-       if (ring_nr & (ring_nr - 1))
-               ring_nr = 1 << __fls(ring_nr);
-
-       ring_size = sizeof(struct syslet_ring) +
-                       ring_nr * sizeof(struct syslet_completion);
-       if (posix_memalign(&ring, sizeof(uint64_t), ring_size))
-               goto err_mem;
-       if (posix_memalign(&stack, page_size, page_size))
-               goto err_mem;
-
-       sd->ring = ring;
-       sd->ring_mask = ring_nr - 1;
-       sd->stack = stack;
-
-       memset(sd->ring, 0, ring_size);
-       sd->ring->elements = ring_nr;
-
-       if (!check_syslet_support(sd)) {
-               td->io_ops->data = sd;
-               return 0;
-       }
-
-       log_err("fio: syslets do not appear to work\n");
-err_mem:
-       free(sd->events);
-       if (ring)
-               free(ring);
-       if (stack)
-               free(stack);
-       free(sd);
-       return 1;
-}
-
-static struct ioengine_ops ioengine = {
-       .name           = "syslet-rw",
-       .version        = FIO_IOOPS_VERSION,
-       .init           = fio_syslet_init,
-       .queue          = fio_syslet_queue,
-       .getevents      = fio_syslet_getevents,
-       .event          = fio_syslet_event,
-       .cleanup        = fio_syslet_cleanup,
-       .open_file      = generic_open_file,
-       .close_file     = generic_close_file,
-       .get_file_size  = generic_get_file_size,
-};
-
-#else /* FIO_HAVE_SYSLET */
-
-/*
- * When we have a proper configure system in place, we simply wont build
- * and install this io engine. For now install a crippled version that
- * just complains and fails to load.
- */
-static int fio_syslet_init(struct thread_data fio_unused *td)
-{
-       log_err("fio: syslet not available\n");
-       return 1;
-}
-
-static struct ioengine_ops ioengine = {
-       .name           = "syslet-rw",
-       .version        = FIO_IOOPS_VERSION,
-       .init           = fio_syslet_init,
-};
-
-#endif /* FIO_HAVE_SYSLET */
-
-static void fio_init fio_syslet_register(void)
-{
-       register_ioengine(&ioengine);
-}
-
-static void fio_exit fio_syslet_unregister(void)
-{
-       unregister_ioengine(&ioengine);
-}
diff --git a/fio.c b/fio.c
index f44273f483c59103ece4a3d4681496e663698f66..24af397a414d27669c6aa7874d3d5170737ea0c2 100644 (file)
--- a/fio.c
+++ b/fio.c
@@ -79,6 +79,10 @@ int main(int argc, char *argv[], char *envp[])
                return 1;
        }
 
                return 1;
        }
 
+#if !defined(CONFIG_GETTIMEOFDAY) && !defined(CONFIG_CLOCK_GETTIME)
+#error "No available clock source!"
+#endif
+
        arch_init(envp);
 
        sinit();
        arch_init(envp);
 
        sinit();
diff --git a/fio.h b/fio.h
index de4ca4daefa2ebc6bceb770e345be87a8d2389aa..a528f6a07ef60dd7d4905bc49e5401bd8173eeed 100644 (file)
--- a/fio.h
+++ b/fio.h
@@ -40,15 +40,11 @@ struct thread_data;
 #include "stat.h"
 #include "flow.h"
 
 #include "stat.h"
 #include "flow.h"
 
-#ifdef FIO_HAVE_GUASI
-#include <guasi.h>
-#endif
-
 #ifdef FIO_HAVE_SOLARISAIO
 #include <sys/asynch.h>
 #endif
 
 #ifdef FIO_HAVE_SOLARISAIO
 #include <sys/asynch.h>
 #endif
 
-#ifdef FIO_HAVE_LIBNUMA
+#ifdef CONFIG_LIBNUMA
 #include <linux/mempolicy.h>
 #include <numa.h>
 
 #include <linux/mempolicy.h>
 #include <numa.h>
 
@@ -213,7 +209,7 @@ struct thread_options {
        unsigned int cpumask_set;
        os_cpu_mask_t verify_cpumask;
        unsigned int verify_cpumask_set;
        unsigned int cpumask_set;
        os_cpu_mask_t verify_cpumask;
        unsigned int verify_cpumask_set;
-#ifdef FIO_HAVE_LIBNUMA
+#ifdef CONFIG_LIBNUMA
        struct bitmask *numa_cpunodesmask;
        unsigned int numa_cpumask_set;
        unsigned short numa_mem_mode;
        struct bitmask *numa_cpunodesmask;
        unsigned int numa_cpumask_set;
        unsigned short numa_mem_mode;
index 1648b17b677f3325664282eb66052f40a2b646fd..e60d3e20ee492ee96c628e671951ada7e67c1b0b 100644 (file)
--- a/gettime.c
+++ b/gettime.c
@@ -24,7 +24,11 @@ struct tv_valid {
        int last_tv_valid;
        unsigned long last_cycles;
 };
        int last_tv_valid;
        unsigned long last_cycles;
 };
+#ifdef CONFIG_TLS_THREAD
+static struct tv_valid __thread static_tv_valid;
+#else
 static pthread_key_t tv_tls_key;
 static pthread_key_t tv_tls_key;
+#endif
 
 enum fio_cs fio_clock_source = FIO_PREFERRED_CLOCK_SOURCE;
 int fio_clock_source_set = 0;
 
 enum fio_cs fio_clock_source = FIO_PREFERRED_CLOCK_SOURCE;
 int fio_clock_source_set = 0;
@@ -121,40 +125,34 @@ static void fio_init gtod_init(void)
 
 #endif /* FIO_DEBUG_TIME */
 
 
 #endif /* FIO_DEBUG_TIME */
 
+#ifdef CONFIG_CLOCK_GETTIME
 static int fill_clock_gettime(struct timespec *ts)
 {
 static int fill_clock_gettime(struct timespec *ts)
 {
-#ifdef FIO_HAVE_CLOCK_MONOTONIC
+#ifdef CONFIG_CLOCK_MONOTONIC
        return clock_gettime(CLOCK_MONOTONIC, ts);
 #else
        return clock_gettime(CLOCK_REALTIME, ts);
 #endif
 }
        return clock_gettime(CLOCK_MONOTONIC, ts);
 #else
        return clock_gettime(CLOCK_REALTIME, ts);
 #endif
 }
-
-#ifdef FIO_DEBUG_TIME
-void fio_gettime(struct timeval *tp, void *caller)
-#else
-void fio_gettime(struct timeval *tp, void fio_unused *caller)
 #endif
 #endif
+
+static void *__fio_gettime(struct timeval *tp)
 {
        struct tv_valid *tv;
 
 {
        struct tv_valid *tv;
 
-#ifdef FIO_DEBUG_TIME
-       if (!caller)
-               caller = __builtin_return_address(0);
-
-       gtod_log_caller(caller);
-#endif
-       if (fio_tv) {
-               memcpy(tp, fio_tv, sizeof(*tp));
-               return;
-       }
-
+#ifdef CONFIG_TLS_THREAD
+       tv = &static_tv_valid;
+#else
        tv = pthread_getspecific(tv_tls_key);
        tv = pthread_getspecific(tv_tls_key);
+#endif
 
        switch (fio_clock_source) {
 
        switch (fio_clock_source) {
+#ifdef CONFIG_GETTIMEOFDAY
        case CS_GTOD:
                gettimeofday(tp, NULL);
                break;
        case CS_GTOD:
                gettimeofday(tp, NULL);
                break;
+#endif
+#ifdef CONFIG_CLOCK_GETTIME
        case CS_CGETTIME: {
                struct timespec ts;
 
        case CS_CGETTIME: {
                struct timespec ts;
 
@@ -167,6 +165,7 @@ void fio_gettime(struct timeval *tp, void fio_unused *caller)
                tp->tv_usec = ts.tv_nsec / 1000;
                break;
                }
                tp->tv_usec = ts.tv_nsec / 1000;
                break;
                }
+#endif
 #ifdef ARCH_HAVE_CPU_CLOCK
        case CS_CPUCLOCK: {
                unsigned long long usecs, t;
 #ifdef ARCH_HAVE_CPU_CLOCK
        case CS_CPUCLOCK: {
                unsigned long long usecs, t;
@@ -189,6 +188,30 @@ void fio_gettime(struct timeval *tp, void fio_unused *caller)
                break;
        }
 
                break;
        }
 
+       return tv;
+}
+
+#ifdef FIO_DEBUG_TIME
+void fio_gettime(struct timeval *tp, void *caller)
+#else
+void fio_gettime(struct timeval *tp, void fio_unused *caller)
+#endif
+{
+       struct tv_valid *tv;
+
+#ifdef FIO_DEBUG_TIME
+       if (!caller)
+               caller = __builtin_return_address(0);
+
+       gtod_log_caller(caller);
+#endif
+       if (fio_tv) {
+               memcpy(tp, fio_tv, sizeof(*tp));
+               return;
+       }
+
+       tv = __fio_gettime(tp);
+
        /*
         * If Linux is using the tsc clock on non-synced processors,
         * sometimes time can appear to drift backwards. Fix that up.
        /*
         * If Linux is using the tsc clock on non-synced processors,
         * sometimes time can appear to drift backwards. Fix that up.
@@ -209,21 +232,22 @@ void fio_gettime(struct timeval *tp, void fio_unused *caller)
 #ifdef ARCH_HAVE_CPU_CLOCK
 static unsigned long get_cycles_per_usec(void)
 {
 #ifdef ARCH_HAVE_CPU_CLOCK
 static unsigned long get_cycles_per_usec(void)
 {
-       struct timespec ts;
        struct timeval s, e;
        unsigned long long c_s, c_e;
        struct timeval s, e;
        unsigned long long c_s, c_e;
+       enum fio_cs old_cs = fio_clock_source;
 
 
-       fill_clock_gettime(&ts);
-       s.tv_sec = ts.tv_sec;
-       s.tv_usec = ts.tv_nsec / 1000;
+#ifdef CONFIG_CLOCK_GETTIME
+       fio_clock_source = CS_CGETTIME;
+#else
+       fio_clock_source = CS_GTOD;
+#endif
+       __fio_gettime(&s);
 
        c_s = get_cpu_clock();
        do {
                unsigned long long elapsed;
 
 
        c_s = get_cpu_clock();
        do {
                unsigned long long elapsed;
 
-               fill_clock_gettime(&ts);
-               e.tv_sec = ts.tv_sec;
-               e.tv_usec = ts.tv_nsec / 1000;
+               __fio_gettime(&e);
 
                elapsed = utime_since(&s, &e);
                if (elapsed >= 1280) {
 
                elapsed = utime_since(&s, &e);
                if (elapsed >= 1280) {
@@ -232,6 +256,7 @@ static unsigned long get_cycles_per_usec(void)
                }
        } while (1);
 
                }
        } while (1);
 
+       fio_clock_source = old_cs;
        return (c_e - c_s + 127) >> 7;
 }
 
        return (c_e - c_s + 127) >> 7;
 }
 
@@ -287,6 +312,7 @@ static void calibrate_cpu_clock(void)
 }
 #endif
 
 }
 #endif
 
+#ifndef CONFIG_TLS_THREAD
 void fio_local_clock_init(int is_thread)
 {
        struct tv_valid *t;
 void fio_local_clock_init(int is_thread)
 {
        struct tv_valid *t;
@@ -300,14 +326,21 @@ static void kill_tv_tls_key(void *data)
 {
        free(data);
 }
 {
        free(data);
 }
+#else
+void fio_local_clock_init(int is_thread)
+{
+}
+#endif
 
 void fio_clock_init(void)
 {
        if (fio_clock_source == fio_clock_source_inited)
                return;
 
 
 void fio_clock_init(void)
 {
        if (fio_clock_source == fio_clock_source_inited)
                return;
 
+#ifndef CONFIG_TLS_THREAD
        if (pthread_key_create(&tv_tls_key, kill_tv_tls_key))
                log_err("fio: can't create TLS key\n");
        if (pthread_key_create(&tv_tls_key, kill_tv_tls_key))
                log_err("fio: can't create TLS key\n");
+#endif
 
        fio_clock_source_inited = fio_clock_source;
        calibrate_cpu_clock();
 
        fio_clock_source_inited = fio_clock_source;
        calibrate_cpu_clock();
@@ -390,7 +423,8 @@ uint64_t time_since_now(struct timeval *s)
        return mtime_since_now(s) / 1000;
 }
 
        return mtime_since_now(s) / 1000;
 }
 
-#if defined(FIO_HAVE_CPU_AFFINITY) && defined(ARCH_HAVE_CPU_CLOCK)
+#if defined(FIO_HAVE_CPU_AFFINITY) && defined(ARCH_HAVE_CPU_CLOCK)  && \
+    defined(CONFIG_SFAA)
 
 #define CLOCK_ENTRIES  100000
 
 
 #define CLOCK_ENTRIES  100000
 
index 1b4e1d0a2c9ccabe9c3e6483223f2abae54b5c7d..dce967d39d6c4bc8f1e2b7cbf8410fdaa1aed093 100644 (file)
--- a/helpers.c
+++ b/helpers.c
@@ -9,50 +9,31 @@
 #include "arch/arch.h"
 #include "os/os.h"
 
 #include "arch/arch.h"
 #include "os/os.h"
 
-#ifndef FIO_HAVE_LINUX_FALLOCATE 
-int _weak fallocate(int fd, int mode, off_t offset, off_t len)
+#ifndef CONFIG_LINUX_FALLOCATE
+int fallocate(int fd, int mode, off_t offset, off_t len)
 {
        errno = ENOSYS;
        return -1;
 }
 #endif
 
 {
        errno = ENOSYS;
        return -1;
 }
 #endif
 
-#ifndef __NR_fallocate
-int _weak posix_fallocate(int fd, off_t offset, off_t len)
+#ifndef CONFIG_POSIX_FALLOCATE
+int posix_fallocate(int fd, off_t offset, off_t len)
 {
        return 0;
 }
 #endif
 
 {
        return 0;
 }
 #endif
 
-int _weak inet_aton(const char *cp, struct in_addr *inp)
-{
-       return 0;
-}
-
-int _weak clock_gettime(clockid_t clk_id, struct timespec *ts)
-{
-       struct timeval tv;
-       int ret;
-
-       ret = gettimeofday(&tv, NULL);
-
-       ts->tv_sec = tv.tv_sec;
-       ts->tv_nsec = tv.tv_usec * 1000;
-
-       return ret;
-}
-
-#ifndef __NR_sync_file_range
-int _weak sync_file_range(int fd, off64_t offset, off64_t nbytes,
-                          unsigned int flags)
+#ifndef CONFIG_SYNC_FILE_RANGE
+int sync_file_range(int fd, off64_t offset, off64_t nbytes, unsigned int flags)
 {
        errno = ENOSYS;
        return -1;
 }
 #endif
 
 {
        errno = ENOSYS;
        return -1;
 }
 #endif
 
-#ifndef FIO_HAVE_FADVISE
-int _weak posix_fadvise(int fd, off_t offset, off_t len, int advice)
+#ifndef CONFIG_FADVISE
+int posix_fadvise(int fd, off_t offset, off_t len, int advice)
 {
        return 0;
 }
 {
        return 0;
 }
index 191096bde600b07c1ed352b69cd4d72cf193a337..5f1865bba8129f272edc4afbce9d2e281bc41949 100644 (file)
--- a/helpers.h
+++ b/helpers.h
@@ -6,15 +6,10 @@
 #include <sys/types.h>
 #include <time.h>
 
 #include <sys/types.h>
 #include <time.h>
 
-struct in_addr;
-
-extern int _weak fallocate(int fd, int mode, off_t offset, off_t len);
-extern int _weak posix_memalign(void **ptr, size_t align, size_t size);
-extern int _weak posix_fallocate(int fd, off_t offset, off_t len);
-extern int _weak inet_aton(const char *cp, struct in_addr *inp);
-extern int _weak clock_gettime(clockid_t clk_id, struct timespec *ts);
-extern int _weak sync_file_range(int fd, off64_t offset, off64_t nbytes,
+extern int fallocate(int fd, int mode, off_t offset, off_t len);
+extern int posix_fallocate(int fd, off_t offset, off_t len);
+extern int sync_file_range(int fd, off64_t offset, off64_t nbytes,
                                        unsigned int flags);
                                        unsigned int flags);
-extern int _weak posix_fadvise(int fd, off_t offset, off_t len, int advice);
+extern int posix_fadvise(int fd, off_t offset, off_t len, int advice);
 
 #endif /* FIO_HELPERS_H_ */
 
 #endif /* FIO_HELPERS_H_ */
diff --git a/init.c b/init.c
index e7b3303e6179673703697e71063a9f63d29badcc..15b54116816e862f2563db8a67f41fac168e6d46 100644 (file)
--- a/init.c
+++ b/init.c
@@ -496,17 +496,8 @@ static int fixup_options(struct thread_data *td)
        /*
         * The low water mark cannot be bigger than the iodepth
         */
        /*
         * The low water mark cannot be bigger than the iodepth
         */
-       if (o->iodepth_low > o->iodepth || !o->iodepth_low) {
-               /*
-                * syslet work around - if the workload is sequential,
-                * we want to let the queue drain all the way down to
-                * avoid seeking between async threads
-                */
-               if (!strcmp(td->io_ops->name, "syslet-rw") && !td_random(td))
-                       o->iodepth_low = 1;
-               else
-                       o->iodepth_low = o->iodepth;
-       }
+       if (o->iodepth_low > o->iodepth || !o->iodepth_low)
+               o->iodepth_low = o->iodepth;
 
        /*
         * If batch number isn't set, default to the same as iodepth
 
        /*
         * If batch number isn't set, default to the same as iodepth
@@ -569,7 +560,7 @@ static int fixup_options(struct thread_data *td)
                }
        }
 
                }
        }
 
-#ifndef FIO_HAVE_FDATASYNC
+#ifndef CONFIG_FDATASYNC
        if (o->fdatasync_blocks) {
                log_info("fio: this platform does not support fdatasync()"
                         " falling back to using fsync().  Use the 'fsync'"
        if (o->fdatasync_blocks) {
                log_info("fio: this platform does not support fdatasync()"
                         " falling back to using fsync().  Use the 'fsync'"
index 0285b08c77567aefc1bdfed7a2bf481548a99ed5..6809501ffa795fa46e59419d91345bfc3904a0a6 100644 (file)
@@ -1,6 +1,13 @@
 #ifndef FIO_IOENGINE_H
 #define FIO_IOENGINE_H
 
 #ifndef FIO_IOENGINE_H
 #define FIO_IOENGINE_H
 
+#ifdef CONFIG_LIBAIO
+#include <libaio.h>
+#endif
+#ifdef CONFIG_GUASI
+#include <guasi.h>
+#endif
+
 #define FIO_IOOPS_VERSION      14
 
 enum {
 #define FIO_IOOPS_VERSION      14
 
 enum {
@@ -19,25 +26,25 @@ enum {
  */
 struct io_u {
        union {
  */
 struct io_u {
        union {
-#ifdef FIO_HAVE_LIBAIO
+#ifdef CONFIG_LIBAIO
                struct iocb iocb;
 #endif
                struct iocb iocb;
 #endif
-#ifdef FIO_HAVE_POSIXAIO
+#ifdef CONFIG_POSIXAIO
                os_aiocb_t aiocb;
 #endif
 #ifdef FIO_HAVE_SGIO
                struct sg_io_hdr hdr;
 #endif
                os_aiocb_t aiocb;
 #endif
 #ifdef FIO_HAVE_SGIO
                struct sg_io_hdr hdr;
 #endif
-#ifdef FIO_HAVE_GUASI
+#ifdef CONFIG_GUASI
                guasi_req_t greq;
 #endif
                guasi_req_t greq;
 #endif
-#ifdef FIO_HAVE_SOLARISAIO
+#ifdef CONFIG_SOLARISAIO
                aio_result_t resultp;
 #endif
 #ifdef FIO_HAVE_BINJECT
                struct b_user_cmd buc;
 #endif
                aio_result_t resultp;
 #endif
 #ifdef FIO_HAVE_BINJECT
                struct b_user_cmd buc;
 #endif
-#ifdef FIO_HAVE_RDMA
+#ifdef CONFIG_RDMA
                struct ibv_mr *mr;
 #endif
                void *mmap_data;
                struct ibv_mr *mr;
 #endif
                void *mmap_data;
index c2a64cb092786519746ef82111e19bd1a79300fb..a87175a23aa74999999ec18a64edf823e84aff90 100644 (file)
@@ -503,7 +503,7 @@ int do_io_u_sync(struct thread_data *td, struct io_u *io_u)
        if (io_u->ddir == DDIR_SYNC) {
                ret = fsync(io_u->file->fd);
        } else if (io_u->ddir == DDIR_DATASYNC) {
        if (io_u->ddir == DDIR_SYNC) {
                ret = fsync(io_u->file->fd);
        } else if (io_u->ddir == DDIR_DATASYNC) {
-#ifdef FIO_HAVE_FDATASYNC
+#ifdef CONFIG_FDATASYNC
                ret = fdatasync(io_u->file->fd);
 #else
                ret = io_u->xfer_buflen;
                ret = fdatasync(io_u->file->fd);
 #else
                ret = io_u->xfer_buflen;
index 237cbae541e716ea046fc55c35b1362014dada87..84272c0c8c288a3d0e5e8a6c2ce493d78c583999 100644 (file)
@@ -1,8 +1,8 @@
-#if !(defined(_AIX) || defined(__hpux))
+#ifndef CONFIG_GETOPT_LONG_ONLY
 
 #include <getopt.h>
 
 
 #include <getopt.h>
 
-#else /* _AIX || __hpux */
+#else
 
 #ifndef _GETOPT_H
 #define _GETOPT_H
 
 #ifndef _GETOPT_H
 #define _GETOPT_H
@@ -22,5 +22,5 @@ enum {
 
 int getopt_long_only(int, char *const *, const char *, const struct option *, int *);
 
 
 int getopt_long_only(int, char *const *, const char *, const struct option *, int *);
 
-#endif /* _GETOPT_H */
-#endif /* _AIX || __hpux */
+#endif
+#endif
diff --git a/lib/inet_aton.c b/lib/inet_aton.c
new file mode 100644 (file)
index 0000000..7ae7db7
--- /dev/null
@@ -0,0 +1,6 @@
+#include "inet_aton.h"
+
+int inet_aton(const char *cp, struct in_addr *inp)
+{
+       return inet_pton(AF_INET, cp, inp);
+}
diff --git a/lib/inet_aton.h b/lib/inet_aton.h
new file mode 100644 (file)
index 0000000..c93c87f
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef FIO_INET_ATON_LIB_H
+#define FIO_INET_ATON_LIB_H
+
+#include <arpa/inet.h>
+
+int inet_aton(const char *cp, struct in_addr *inp);
+
+#endif
index 782a360097cae1eaeed290af5c5439e2bf248226..5fea5d191f3dc7122bb9446b22851a355c108bca 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef FIO_LIB_H
-#define FIO_LIB_H
+#ifndef FIO_STRSEP_LIB_H
+#define FIO_STRSEP_LIB_H
 
 char *strsep(char **, const char *);
 
 
 char *strsep(char **, const char *);
 
index ae290edb15d4e45260c5a5d0c7b9dcd7c596a8d2..3a406fafb18e76e26bb653b178c80684db87c303 100644 (file)
--- a/options.c
+++ b/options.c
@@ -565,7 +565,7 @@ static int str_verify_cpus_allowed_cb(void *data, const char *input)
 }
 #endif
 
 }
 #endif
 
-#ifdef FIO_HAVE_LIBNUMA
+#ifdef CONFIG_LIBNUMA
 static int str_numa_cpunodes_cb(void *data, char *input)
 {
        struct thread_data *td = data;
 static int str_numa_cpunodes_cb(void *data, char *input)
 {
        struct thread_data *td = data;
@@ -713,7 +713,7 @@ static int str_fst_cb(void *data, const char *str)
        return 0;
 }
 
        return 0;
 }
 
-#ifdef FIO_HAVE_SYNC_FILE_RANGE
+#ifdef CONFIG_SYNC_FILE_RANGE
 static int str_sfr_cb(void *data, const char *str)
 {
        struct thread_data *td = data;
 static int str_sfr_cb(void *data, const char *str)
 {
        struct thread_data *td = data;
@@ -1272,12 +1272,12 @@ static struct fio_option options[FIO_MAX_OPTS] = {
                          { .ival = "vsync",
                            .help = "Use readv/writev",
                          },
                          { .ival = "vsync",
                            .help = "Use readv/writev",
                          },
-#ifdef FIO_HAVE_LIBAIO
+#ifdef CONFIG_LIBAIO
                          { .ival = "libaio",
                            .help = "Linux native asynchronous IO",
                          },
 #endif
                          { .ival = "libaio",
                            .help = "Linux native asynchronous IO",
                          },
 #endif
-#ifdef FIO_HAVE_POSIXAIO
+#ifdef CONFIG_POSIXAIO
                          { .ival = "posixaio",
                            .help = "POSIX asynchronous IO",
                          },
                          { .ival = "posixaio",
                            .help = "POSIX asynchronous IO",
                          },
@@ -1295,7 +1295,7 @@ static struct fio_option options[FIO_MAX_OPTS] = {
                          { .ival = "mmap",
                            .help = "Memory mapped IO"
                          },
                          { .ival = "mmap",
                            .help = "Memory mapped IO"
                          },
-#ifdef FIO_HAVE_SPLICE
+#ifdef CONFIG_LINUX_SPLICE
                          { .ival = "splice",
                            .help = "splice/vmsplice based IO",
                          },
                          { .ival = "splice",
                            .help = "splice/vmsplice based IO",
                          },
@@ -1314,15 +1314,10 @@ static struct fio_option options[FIO_MAX_OPTS] = {
                          { .ival = "net",
                            .help = "Network IO",
                          },
                          { .ival = "net",
                            .help = "Network IO",
                          },
-#ifdef FIO_HAVE_SYSLET
-                         { .ival = "syslet-rw",
-                           .help = "syslet enabled async pread/pwrite IO",
-                         },
-#endif
                          { .ival = "cpuio",
                            .help = "CPU cycle burner engine",
                          },
                          { .ival = "cpuio",
                            .help = "CPU cycle burner engine",
                          },
-#ifdef FIO_HAVE_GUASI
+#ifdef CONFIG_GUASI
                          { .ival = "guasi",
                            .help = "GUASI IO engine",
                          },
                          { .ival = "guasi",
                            .help = "GUASI IO engine",
                          },
@@ -1332,12 +1327,12 @@ static struct fio_option options[FIO_MAX_OPTS] = {
                            .help = "binject direct inject block engine",
                          },
 #endif
                            .help = "binject direct inject block engine",
                          },
 #endif
-#ifdef FIO_HAVE_RDMA
+#ifdef CONFIG_RDMA
                          { .ival = "rdma",
                            .help = "RDMA IO engine",
                          },
 #endif
                          { .ival = "rdma",
                            .help = "RDMA IO engine",
                          },
 #endif
-#ifdef FIO_HAVE_FUSION_AW
+#ifdef CONFIG_FUSION_AW
                          { .ival = "fusion-aw-sync",
                            .help = "Fusion-io atomic write engine",
                          },
                          { .ival = "fusion-aw-sync",
                            .help = "Fusion-io atomic write engine",
                          },
@@ -1650,7 +1645,7 @@ static struct fio_option options[FIO_MAX_OPTS] = {
                .help   = "Make every Nth write a barrier write",
                .def    = "0",
        },
                .help   = "Make every Nth write a barrier write",
                .def    = "0",
        },
-#ifdef FIO_HAVE_SYNC_FILE_RANGE
+#ifdef CONFIG_SYNC_FILE_RANGE
        {
                .name   = "sync_file_range",
                .posval = {
        {
                .name   = "sync_file_range",
                .posval = {
@@ -1747,14 +1742,18 @@ static struct fio_option options[FIO_MAX_OPTS] = {
                .off1   = td_var_offset(clocksource),
                .help   = "What type of timing source to use",
                .posval = {
                .off1   = td_var_offset(clocksource),
                .help   = "What type of timing source to use",
                .posval = {
+#ifdef CONFIG_GETTIMEOFDAY
                          { .ival = "gettimeofday",
                            .oval = CS_GTOD,
                            .help = "Use gettimeofday(2) for timing",
                          },
                          { .ival = "gettimeofday",
                            .oval = CS_GTOD,
                            .help = "Use gettimeofday(2) for timing",
                          },
+#endif
+#ifdef CONFIG_CLOCK_GETTIME
                          { .ival = "clock_gettime",
                            .oval = CS_CGETTIME,
                            .help = "Use clock_gettime(2) for timing",
                          },
                          { .ival = "clock_gettime",
                            .oval = CS_CGETTIME,
                            .help = "Use clock_gettime(2) for timing",
                          },
+#endif
 #ifdef ARCH_HAVE_CPU_CLOCK
                          { .ival = "cpu",
                            .oval = CS_CPUCLOCK,
 #ifdef ARCH_HAVE_CPU_CLOCK
                          { .ival = "cpu",
                            .oval = CS_CPUCLOCK,
@@ -2278,7 +2277,7 @@ static struct fio_option options[FIO_MAX_OPTS] = {
                .help   = "Set CPUs allowed",
        },
 #endif
                .help   = "Set CPUs allowed",
        },
 #endif
-#ifdef FIO_HAVE_LIBNUMA
+#ifdef CONFIG_LIBNUMA
        {
                .name   = "numa_cpu_nodes",
                .type   = FIO_OPT_STR,
        {
                .name   = "numa_cpu_nodes",
                .type   = FIO_OPT_STR,
diff --git a/os/indirect.h b/os/indirect.h
deleted file mode 100644 (file)
index fba6b6b..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-#ifndef _INDIRECT_H_
-#define _INDIRECT_H_
-
-#include "syslet.h"
-
-union indirect_params {
-       struct {
-               u32 flags;
-       } file_flags;
-       struct syslet_args syslet;
-};
-
-#ifdef __x86_64__
-# define __NR_indirect 286
-struct indirect_registers {
-       u64 rax;
-       u64 rdi;
-       u64 rsi;
-       u64 rdx;
-       u64 r10;
-       u64 r8;
-       u64 r9;
-};
-#elif defined __i386__
-# define __NR_indirect 325
-struct indirect_registers {
-       u32 eax;
-       u32 ebx;
-       u32 ecx;
-       u32 edx;
-       u32 esi;
-       u32 edi;
-       u32 ebp;
-};
-#endif
-
-#define FILL_IN(var, values...) \
-         (var) = (struct indirect_registers) { values, }
-
-#endif
index 1870e6e46f9c14676c53394eaadff3383a08d675..01b2bdbb29ad2e605ea55f5c9d83819b29f9208d 100644 (file)
 
 #include "../file.h"
 
 
 #include "../file.h"
 
-#define FIO_HAVE_POSIXAIO
 #define FIO_HAVE_ODIRECT
 #define FIO_USE_GENERIC_RAND
 #define FIO_USE_GENERIC_INIT_RANDOM_STATE
 #define FIO_HAVE_ODIRECT
 #define FIO_USE_GENERIC_RAND
 #define FIO_USE_GENERIC_INIT_RANDOM_STATE
-#define FIO_HAVE_CLOCK_MONOTONIC
-
-/*
- * This is broken on AIX if _LARGE_FILES is defined...
- */
-#if 0
-#define FIO_HAVE_FALLOCATE
-#endif
 
 #define FIO_HAVE_PSHARED_MUTEX
 
 
 #define FIO_HAVE_PSHARED_MUTEX
 
@@ -36,9 +27,6 @@
 
 #define FIO_USE_GENERIC_SWAP
 
 
 #define FIO_USE_GENERIC_SWAP
 
-#define FIO_OS_HAVE_SOCKLEN_T
-#define fio_socklen_t socklen_t
-
 static inline int blockdev_invalidate_cache(struct fio_file *f)
 {
        return EINVAL;
 static inline int blockdev_invalidate_cache(struct fio_file *f)
 {
        return EINVAL;
index 3da39531bff53c5f931e9557b240ac8c883824ec..e78a95bfa9a420d63708bbed42e2497fa9db2262 100644 (file)
 #include <linux/major.h>
 #include <endian.h>
 
 #include <linux/major.h>
 #include <endian.h>
 
-#include "indirect.h"
 #include "binject.h"
 #include "../file.h"
 
 #define FIO_HAVE_DISK_UTIL
 #include "binject.h"
 #include "../file.h"
 
 #define FIO_HAVE_DISK_UTIL
-#define FIO_HAVE_SPLICE
 #define FIO_HAVE_IOSCHED_SWITCH
 #define FIO_HAVE_ODIRECT
 #define FIO_HAVE_HUGETLB
 #define FIO_HAVE_BLKTRACE
 #define FIO_HAVE_IOSCHED_SWITCH
 #define FIO_HAVE_ODIRECT
 #define FIO_HAVE_HUGETLB
 #define FIO_HAVE_BLKTRACE
-#define FIO_HAVE_STRSEP
-#define FIO_HAVE_POSIXAIO_FSYNC
 #define FIO_HAVE_PSHARED_MUTEX
 #define FIO_HAVE_CL_SIZE
 #define FIO_HAVE_PSHARED_MUTEX
 #define FIO_HAVE_CL_SIZE
-#define FIO_HAVE_FDATASYNC
 #define FIO_HAVE_FS_STAT
 #define FIO_HAVE_TRIM
 #define FIO_HAVE_FS_STAT
 #define FIO_HAVE_TRIM
-#define FIO_HAVE_CLOCK_MONOTONIC
 #define FIO_HAVE_GETTID
 #define FIO_USE_GENERIC_INIT_RANDOM_STATE
 #define FIO_HAVE_E4_ENG
 #define FIO_HAVE_GETTID
 #define FIO_USE_GENERIC_INIT_RANDOM_STATE
 #define FIO_HAVE_E4_ENG
@@ -78,36 +72,6 @@ static inline int shmdt (const void *__shmaddr)
 }
 
 
 }
 
 
-/*
- * Just check for SPLICE_F_MOVE, if that isn't there, assume the others
- * aren't either.
- */
-#ifndef SPLICE_F_MOVE
-#define SPLICE_F_MOVE  (0x01)  /* move pages instead of copying */
-#define SPLICE_F_NONBLOCK (0x02) /* don't block on the pipe splicing (but */
-                                /* we may still block on the fd we splice */
-                                /* from/to, of course */
-#define SPLICE_F_MORE  (0x04)  /* expect more data */
-#define SPLICE_F_GIFT   (0x08)  /* pages passed in are a gift */
-
-static inline int splice(int fdin, loff_t *off_in, int fdout, loff_t *off_out,
-                        size_t len, unsigned int flags)
-{
-       return syscall(__NR_sys_splice, fdin, off_in, fdout, off_out, len, flags);
-}
-
-static inline int tee(int fdin, int fdout, size_t len, unsigned int flags)
-{
-       return syscall(__NR_sys_tee, fdin, fdout, len, flags);
-}
-
-static inline int vmsplice(int fd, const struct iovec *iov,
-                          unsigned long nr_segs, unsigned int flags)
-{
-       return syscall(__NR_sys_vmsplice, fd, iov, nr_segs, flags);
-}
-#endif
-
 #define SPLICE_DEF_SIZE        (64*1024)
 
 #ifndef BLKGETSIZE64
 #define SPLICE_DEF_SIZE        (64*1024)
 
 #ifndef BLKGETSIZE64
index 2a7b7b327a83f6fb50eb7f1839108ca108b9e1ef..501260098a8ace11c99d6c28d4aba9dec0438335 100644 (file)
 
 #include "../file.h"
 
 
 #include "../file.h"
 
-#define FIO_HAVE_POSIXAIO
 #define FIO_HAVE_ODIRECT
 #define FIO_HAVE_ODIRECT
-#define FIO_HAVE_STRSEP
 #define FIO_USE_GENERIC_RAND
 #define FIO_USE_GENERIC_INIT_RANDOM_STATE
 #define FIO_HAVE_CHARDEV_SIZE
 #define FIO_HAVE_GETTID
 #define FIO_USE_GENERIC_RAND
 #define FIO_USE_GENERIC_INIT_RANDOM_STATE
 #define FIO_HAVE_CHARDEV_SIZE
 #define FIO_HAVE_GETTID
-#define FIO_HAVE_CLOCK_MONOTONIC
 
 #define OS_MAP_ANON            MAP_ANON
 
 
 #define OS_MAP_ANON            MAP_ANON
 
index 821c91690b12c8165488c5d2e99170d98a77e1af..b4d677a4cf28d63bea693d7dc1b5add509b7724e 100644 (file)
 
 #include "../file.h"
 
 
 #include "../file.h"
 
-#define FIO_HAVE_POSIXAIO
 #define FIO_HAVE_ODIRECT
 #define FIO_USE_GENERIC_RAND
 #define FIO_USE_GENERIC_INIT_RANDOM_STATE
 #define FIO_HAVE_ODIRECT
 #define FIO_USE_GENERIC_RAND
 #define FIO_USE_GENERIC_INIT_RANDOM_STATE
-#define FIO_HAVE_CLOCK_MONOTONIC
 #define FIO_HAVE_PSHARED_MUTEX
 #define FIO_HAVE_PSHARED_MUTEX
-#define FIO_HAVE_FADVISE
 #define FIO_HAVE_CHARDEV_SIZE
 #define FIO_HAVE_CHARDEV_SIZE
-#define FIO_HAVE_FALLOCATE
-#define FIO_HAVE_POSIXAIO_FSYNC
-#define FIO_HAVE_FDATASYNC
 
 #define OS_MAP_ANON            MAP_ANONYMOUS
 #define OS_MSG_DONTWAIT                0
 
 #define OS_MAP_ANON            MAP_ANONYMOUS
 #define OS_MSG_DONTWAIT                0
@@ -58,9 +52,6 @@
 #define FIO_OS_HAVE_AIOCB_TYPEDEF
 typedef struct aiocb64 os_aiocb_t;
 
 #define FIO_OS_HAVE_AIOCB_TYPEDEF
 typedef struct aiocb64 os_aiocb_t;
 
-#define FIO_OS_HAVE_SOCKLEN_T
-typedef int fio_socklen_t;
-
 static inline int blockdev_invalidate_cache(struct fio_file *f)
 {
        return EINVAL;
 static inline int blockdev_invalidate_cache(struct fio_file *f)
 {
        return EINVAL;
index e9d7cf3e6f6e0cf4af791bab019fc9faf9586e21..d7eec0f2fd7d1bece339f9b61e723523755545ff 100644 (file)
 #include <linux/major.h>
 #include <endian.h>
 
 #include <linux/major.h>
 #include <endian.h>
 
-#include "indirect.h"
 #include "binject.h"
 #include "../file.h"
 
 #include "binject.h"
 #include "../file.h"
 
-#define FIO_HAVE_LIBAIO
-#define FIO_HAVE_POSIXAIO
-#define FIO_HAVE_FADVISE
 #define FIO_HAVE_CPU_AFFINITY
 #define FIO_HAVE_DISK_UTIL
 #define FIO_HAVE_SGIO
 #define FIO_HAVE_IOPRIO
 #define FIO_HAVE_CPU_AFFINITY
 #define FIO_HAVE_DISK_UTIL
 #define FIO_HAVE_SGIO
 #define FIO_HAVE_IOPRIO
-#define FIO_HAVE_SPLICE
 #define FIO_HAVE_IOSCHED_SWITCH
 #define FIO_HAVE_ODIRECT
 #define FIO_HAVE_HUGETLB
 #define FIO_HAVE_RAWBIND
 #define FIO_HAVE_BLKTRACE
 #define FIO_HAVE_IOSCHED_SWITCH
 #define FIO_HAVE_ODIRECT
 #define FIO_HAVE_HUGETLB
 #define FIO_HAVE_RAWBIND
 #define FIO_HAVE_BLKTRACE
-#define FIO_HAVE_STRSEP
-#define FIO_HAVE_POSIXAIO_FSYNC
 #define FIO_HAVE_PSHARED_MUTEX
 #define FIO_HAVE_CL_SIZE
 #define FIO_HAVE_CGROUPS
 #define FIO_HAVE_PSHARED_MUTEX
 #define FIO_HAVE_CL_SIZE
 #define FIO_HAVE_CGROUPS
-#define FIO_HAVE_FDATASYNC
 #define FIO_HAVE_FS_STAT
 #define FIO_HAVE_TRIM
 #define FIO_HAVE_BINJECT
 #define FIO_HAVE_FS_STAT
 #define FIO_HAVE_TRIM
 #define FIO_HAVE_BINJECT
-#define FIO_HAVE_CLOCK_MONOTONIC
 #define FIO_HAVE_GETTID
 #define FIO_USE_GENERIC_INIT_RANDOM_STATE
 #define FIO_HAVE_GETTID
 #define FIO_USE_GENERIC_INIT_RANDOM_STATE
-#define FIO_HAVE_E4_ENG
 
 #ifdef MAP_HUGETLB
 #define FIO_HAVE_MMAP_HUGE
 #endif
 
 
 #ifdef MAP_HUGETLB
 #define FIO_HAVE_MMAP_HUGE
 #endif
 
-/*
- * Can only enable this for newer glibcs, or the header and defines are
- * missing
- */
-#if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 6
-#define FIO_HAVE_FALLOCATE
-#endif
-#if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 8
-#define FIO_HAVE_LINUX_FALLOCATE
-#endif
-
-#ifdef FIO_HAVE_LINUX_FALLOCATE
-#define FIO_HAVE_FALLOC_ENG
-#endif
-
-#ifdef SYNC_FILE_RANGE_WAIT_BEFORE
-#define FIO_HAVE_SYNC_FILE_RANGE
-#endif
-
 #define OS_MAP_ANON            MAP_ANONYMOUS
 
 #define OS_MAP_ANON            MAP_ANONYMOUS
 
-#ifndef CLOCK_MONOTONIC
-#define CLOCK_MONOTONIC 1
-#endif
-
 typedef cpu_set_t os_cpu_mask_t;
 
 typedef struct drand48_data os_random_state_t;
 
 typedef cpu_set_t os_cpu_mask_t;
 
 typedef struct drand48_data os_random_state_t;
 
-/*
- * we want fadvise64 really, but it's so tangled... later
- */
-#ifdef FIO_HAVE_FADVISE
-#define fadvise(fd, off, len, advice)  \
-       posix_fadvise((fd), (off_t)(off), (len), (advice))
-#endif
-
-/*
- * If you are on an ancient glibc (2.3.2), then define GLIBC_2_3_2 if you want
- * the affinity helpers to work.
- */
-#ifndef GLIBC_2_3_2
+#ifdef CONFIG_3ARG_AFFINITY
 #define fio_setaffinity(pid, cpumask)          \
        sched_setaffinity((pid), sizeof(cpumask), &(cpumask))
 #define fio_getaffinity(pid, ptr)      \
        sched_getaffinity((pid), sizeof(cpu_set_t), (ptr))
 #define fio_setaffinity(pid, cpumask)          \
        sched_setaffinity((pid), sizeof(cpumask), &(cpumask))
 #define fio_getaffinity(pid, ptr)      \
        sched_getaffinity((pid), sizeof(cpu_set_t), (ptr))
-#else
+#elif defined(CONFIG_2ARG_AFFINITY)
 #define fio_setaffinity(pid, cpumask)  \
        sched_setaffinity((pid), &(cpumask))
 #define fio_getaffinity(pid, ptr)      \
 #define fio_setaffinity(pid, cpumask)  \
        sched_setaffinity((pid), &(cpumask))
 #define fio_getaffinity(pid, ptr)      \
@@ -131,71 +86,8 @@ static inline int gettid(void)
        return syscall(__NR_gettid);
 }
 
        return syscall(__NR_gettid);
 }
 
-/*
- * Just check for SPLICE_F_MOVE, if that isn't there, assume the others
- * aren't either.
- */
-#ifndef SPLICE_F_MOVE
-#define SPLICE_F_MOVE  (0x01)  /* move pages instead of copying */
-#define SPLICE_F_NONBLOCK (0x02) /* don't block on the pipe splicing (but */
-                                /* we may still block on the fd we splice */
-                                /* from/to, of course */
-#define SPLICE_F_MORE  (0x04)  /* expect more data */
-#define SPLICE_F_GIFT   (0x08)  /* pages passed in are a gift */
-
-static inline int splice(int fdin, loff_t *off_in, int fdout, loff_t *off_out,
-                        size_t len, unsigned int flags)
-{
-       return syscall(__NR_sys_splice, fdin, off_in, fdout, off_out, len, flags);
-}
-
-static inline int tee(int fdin, int fdout, size_t len, unsigned int flags)
-{
-       return syscall(__NR_sys_tee, fdin, fdout, len, flags);
-}
-
-static inline int vmsplice(int fd, const struct iovec *iov,
-                          unsigned long nr_segs, unsigned int flags)
-{
-       return syscall(__NR_sys_vmsplice, fd, iov, nr_segs, flags);
-}
-#endif
-
 #define SPLICE_DEF_SIZE        (64*1024)
 
 #define SPLICE_DEF_SIZE        (64*1024)
 
-#ifdef FIO_HAVE_SYSLET
-
-struct syslet_uatom;
-struct async_head_user;
-
-/*
- * syslet stuff
- */
-static inline struct syslet_uatom *
-async_exec(struct syslet_uatom *atom, struct async_head_user *ahu)
-{
-       return (struct syslet_uatom *) syscall(__NR_async_exec, atom, ahu);
-}
-
-static inline long
-async_wait(unsigned long min_wait_events, unsigned long user_ring_idx,
-          struct async_head_user *ahu)
-{
-       return syscall(__NR_async_wait, min_wait_events,
-                       user_ring_idx, ahu);
-}
-
-static inline long async_thread(void *event, struct async_head_user *ahu)
-{
-       return syscall(__NR_async_thread, event, ahu);
-}
-
-static inline long umem_add(unsigned long *uptr, unsigned long inc)
-{
-       return syscall(__NR_umem_add, uptr, inc);
-}
-#endif /* FIO_HAVE_SYSLET */
-
 enum {
        IOPRIO_CLASS_NONE,
        IOPRIO_CLASS_RT,
 enum {
        IOPRIO_CLASS_NONE,
        IOPRIO_CLASS_RT,
index 553f82007fae7c23a83a5b89ac77108907e2cb18..0f351a78a2ab4a258c1a9b13389ff212960cdd3b 100644 (file)
@@ -24,8 +24,6 @@
 #define CLOCK_REALTIME 1
 #endif
 
 #define CLOCK_REALTIME 1
 #endif
 
-#define FIO_HAVE_POSIXAIO
-#define FIO_HAVE_CLOCK_MONOTONIC
 #define FIO_USE_GENERIC_RAND
 #define FIO_USE_GENERIC_INIT_RANDOM_STATE
 #define FIO_HAVE_GETTID
 #define FIO_USE_GENERIC_RAND
 #define FIO_USE_GENERIC_INIT_RANDOM_STATE
 #define FIO_HAVE_GETTID
index de687ba386103b7e40be350724d4262b2894fa06..1753226e5512eaa22fcc4283056181f771730fe5 100644 (file)
 
 #include "../file.h"
 
 
 #include "../file.h"
 
-#define FIO_HAVE_POSIXAIO
-#define FIO_HAVE_FADVISE
 #define FIO_HAVE_ODIRECT
 #define FIO_HAVE_ODIRECT
-#define FIO_HAVE_STRSEP
-#define FIO_HAVE_FDATASYNC
 #define FIO_USE_GENERIC_BDEV_SIZE
 #define FIO_USE_GENERIC_RAND
 #define FIO_USE_GENERIC_INIT_RANDOM_STATE
 #define FIO_USE_GENERIC_BDEV_SIZE
 #define FIO_USE_GENERIC_RAND
 #define FIO_USE_GENERIC_INIT_RANDOM_STATE
index 5efd7ac1e96481ec4ed0645c2c2bb88a66cbdf6d..7dd62a712ac2f49aaa351e3bbe3c96c87a505718 100644 (file)
 
 #include "../file.h"
 
 
 #include "../file.h"
 
-#define FIO_HAVE_POSIXAIO
 #define FIO_HAVE_SOLARISAIO
 #define FIO_HAVE_SOLARISAIO
-#define FIO_HAVE_POSIXAIO_FSYNC
 #define FIO_HAVE_CPU_AFFINITY
 #define FIO_HAVE_PSHARED_MUTEX
 #define FIO_HAVE_CPU_AFFINITY
 #define FIO_HAVE_PSHARED_MUTEX
-#define FIO_HAVE_FDATASYNC
 #define FIO_HAVE_CHARDEV_SIZE
 #define FIO_USE_GENERIC_BDEV_SIZE
 #define FIO_USE_GENERIC_INIT_RANDOM_STATE
 #define FIO_HAVE_GETTID
 #define FIO_HAVE_CHARDEV_SIZE
 #define FIO_USE_GENERIC_BDEV_SIZE
 #define FIO_USE_GENERIC_INIT_RANDOM_STATE
 #define FIO_HAVE_GETTID
-#define FIO_HAVE_FADVISE
 
 #define OS_MAP_ANON            MAP_ANON
 #define OS_RAND_MAX            2147483648UL
 
 #define OS_MAP_ANON            MAP_ANON
 #define OS_RAND_MAX            2147483648UL
index ba9319536a04d9ce75d811c65d34fc0e19b79962..0b199c5213cff429b576d90293310864b90ee8ef 100644 (file)
@@ -22,8 +22,6 @@
 #define FIO_HAVE_WINDOWSAIO
 #define FIO_HAVE_FALLOCATE
 #define FIO_HAVE_GETTID
 #define FIO_HAVE_WINDOWSAIO
 #define FIO_HAVE_FALLOCATE
 #define FIO_HAVE_GETTID
-#define FIO_HAVE_CLOCK_MONOTONIC
-#define FIO_HAVE_FADVISE
 #define FIO_USE_GENERIC_RAND
 
 #define FIO_PREFERRED_ENGINE           "windowsaio"
 #define FIO_USE_GENERIC_RAND
 
 #define FIO_PREFERRED_ENGINE           "windowsaio"
@@ -32,9 +30,6 @@
 
 #define FIO_MAX_CPUS   MAXIMUM_PROCESSORS
 
 
 #define FIO_MAX_CPUS   MAXIMUM_PROCESSORS
 
-#define FIO_OS_HAVE_SOCKLEN_T
-typedef int fio_socklen_t;
-
 #define OS_MAP_ANON            MAP_ANON
 
 #define FIO_LITTLE_ENDIAN
 #define OS_MAP_ANON            MAP_ANON
 
 #define FIO_LITTLE_ENDIAN
@@ -97,7 +92,6 @@ struct sigaction
        void* (*sa_sigaction)(int, siginfo_t *, void*);
 };
 
        void* (*sa_sigaction)(int, siginfo_t *, void*);
 };
 
-char *strsep(char **stringp, const char *delim);
 long sysconf(int name);
 
 int kill(pid_t pid, int sig);
 long sysconf(int name);
 
 int kill(pid_t pid, int sig);
diff --git a/os/os.h b/os/os.h
index 2e4764e18f4ab6c021c3171827bd7323b52ef8bf..a14d7f0c0333152ed6663d895d787fb95d7e1f18 100644 (file)
--- a/os/os.h
+++ b/os/os.h
@@ -44,11 +44,7 @@ enum {
 #error "unsupported os"
 #endif
 
 #error "unsupported os"
 #endif
 
-#ifdef FIO_HAVE_LIBAIO
-#include <libaio.h>
-#endif
-
-#ifdef FIO_HAVE_POSIXAIO
+#ifdef CONFIG_POSIXAIO
 #include <aio.h>
 #ifndef FIO_OS_HAVE_AIOCB_TYPEDEF
 typedef struct aiocb os_aiocb_t;
 #include <aio.h>
 #ifndef FIO_OS_HAVE_AIOCB_TYPEDEF
 typedef struct aiocb os_aiocb_t;
@@ -60,7 +56,7 @@ typedef struct aiocb os_aiocb_t;
 #include <scsi/sg.h>
 #endif
 
 #include <scsi/sg.h>
 #endif
 
-#ifndef FIO_HAVE_STRSEP
+#ifdef CONFIG_STRSEP
 #include "../lib/strsep.h"
 #endif
 
 #include "../lib/strsep.h"
 #endif
 
@@ -116,12 +112,6 @@ typedef unsigned long os_cpu_mask_t;
 #define OS_RAND_MAX                    RAND_MAX
 #endif
 
 #define OS_RAND_MAX                    RAND_MAX
 #endif
 
-#ifdef FIO_HAVE_CLOCK_MONOTONIC
-#define FIO_TIMER_CLOCK CLOCK_MONOTONIC
-#else
-#define FIO_TIMER_CLOCK CLOCK_REALTIME
-#endif
-
 #ifndef FIO_HAVE_RAWBIND
 #define fio_lookup_raw(dev, majdev, mindev)    1
 #endif
 #ifndef FIO_HAVE_RAWBIND
 #define fio_lookup_raw(dev, majdev, mindev)    1
 #endif
@@ -142,8 +132,8 @@ typedef unsigned long os_cpu_mask_t;
 #define FIO_MAX_JOBS           2048
 #endif
 
 #define FIO_MAX_JOBS           2048
 #endif
 
-#ifndef FIO_OS_HAVE_SOCKLEN_T
-typedef socklen_t fio_socklen_t;
+#ifndef CONFIG_SOCKLEN_T
+typedef unsigned int socklen_t;
 #endif
 
 #ifndef FIO_OS_HAS_CTIME_R
 #endif
 
 #ifndef FIO_OS_HAS_CTIME_R
diff --git a/os/syslet.h b/os/syslet.h
deleted file mode 100644 (file)
index 095cc13..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-#ifndef _SYSLET_H_
-#define _SYSLET_H_
-
-#include "kcompat.h"
-
-struct syslet_frame {
-       u64 ip;
-       u64 sp;
-};
-
-struct syslet_args {
-       u64 ring_ptr;
-       u64 caller_data;
-       struct syslet_frame frame;
-};
-
-struct syslet_completion {
-       u64 status;
-       u64 caller_data;
-};
-
-struct syslet_ring {
-       u32 kernel_head;
-       u32 user_tail;
-       u32 elements;
-       u32 wait_group;
-       struct syslet_completion comp[0];
-};
-
-#ifdef __x86_64__
-#define __NR_syslet_ring_wait  287
-#elif defined __i386__
-#define __NR_syslet_ring_wait  326
-#endif
-
-#define ESYSLETPENDING   132
-
-typedef void (*syslet_return_func_t)(void);
-
-static inline void fill_syslet_args(struct syslet_args *args,
-                     struct syslet_ring *ring, uint64_t caller_data,
-                     syslet_return_func_t func, void *stack)
-{
-       args->ring_ptr = (u64)(unsigned long)ring;
-       args->caller_data = caller_data;
-       args->frame.ip = (u64)(unsigned long)func;
-       args->frame.sp = (u64)(unsigned long)stack;
-}
-
-#endif
index f616e876ba79e70c84d862535861d43f848da72d..8b451478dec79e142397572c2cd6943142255a33 100755 (executable)
@@ -823,11 +823,6 @@ const char* inet_ntop(int af, const void *restrict src,
        return ret;
 }
 
        return ret;
 }
 
-int inet_aton(const char *cp, struct in_addr *inp)
-{
-       return inet_pton(AF_INET, cp, inp);
-}
-
 int inet_pton(int af, const char *restrict src, void *restrict dst)
 {
        INT status = SOCKET_ERROR;
 int inet_pton(int af, const char *restrict src, void *restrict dst)
 {
        INT status = SOCKET_ERROR;
index f8c36357a2dbfcce3577d94c8f94466cb979538d..ffa6ed4bdfa7db270181bab4e2ab7a48d2f6f979 100644 (file)
--- a/server.c
+++ b/server.c
@@ -310,7 +310,7 @@ int fio_net_send_simple_cmd(int sk, uint16_t opcode, uint64_t tag,
        fio_net_cmd_crc(&cmd->cmd);
 
        INIT_FLIST_HEAD(&cmd->list);
        fio_net_cmd_crc(&cmd->cmd);
 
        INIT_FLIST_HEAD(&cmd->list);
-       gettimeofday(&cmd->tv, NULL);
+       fio_gettime(&cmd->tv, NULL);
        cmd->saved_tag = tag;
 
        ret = fio_send_data(sk, &cmd->cmd, sizeof(cmd->cmd));
        cmd->saved_tag = tag;
 
        ret = fio_send_data(sk, &cmd->cmd, sizeof(cmd->cmd));
@@ -561,7 +561,7 @@ void fio_server_idle_loop(void)
 static int accept_loop(int listen_sk)
 {
        struct sockaddr_in addr;
 static int accept_loop(int listen_sk)
 {
        struct sockaddr_in addr;
-       fio_socklen_t len = sizeof(addr);
+       socklen_t len = sizeof(addr);
        struct pollfd pfd;
        int ret, sk, flags, exitval = 0;
 
        struct pollfd pfd;
        int ret, sk, flags, exitval = 0;
 
@@ -815,7 +815,7 @@ int fio_server_log(const char *format, ...)
 static int fio_init_server_ip(void)
 {
        struct sockaddr *addr;
 static int fio_init_server_ip(void)
 {
        struct sockaddr *addr;
-       fio_socklen_t socklen;
+       socklen_t socklen;
        int sk, opt;
 
        if (use_ipv6)
        int sk, opt;
 
        if (use_ipv6)
@@ -864,7 +864,7 @@ static int fio_init_server_ip(void)
 static int fio_init_server_sock(void)
 {
        struct sockaddr_un addr;
 static int fio_init_server_sock(void)
 {
        struct sockaddr_un addr;
-       fio_socklen_t len;
+       socklen_t len;
        mode_t mode;
        int sk;
 
        mode_t mode;
        int sk;