PROGS = fio
SCRIPTS = fio_generate_plots
+OBJS = fio.o ioengines.o init.o stat.o log.o time.o md5.o crc32.o
+
all: depend $(PROGS) $(SCRIPTS)
fio: fio.o ioengines.o init.o stat.o log.o time.o md5.o crc32.o
- $(CC) $(CFLAGS) -o $@ $(filter %.o,$^) -lpthread -laio -lm -lrt
+ $(CC) $(CFLAGS) -o $@ $(OBJS) -lpthread -lm
clean:
-rm -f *.o .depend cscope.out $(PROGS)
fprintf(stderr, "io priorities not available\n");
ret = 1;
break;
-#endif
+#else
td->ioprio |= prioclass << IOPRIO_CLASS_SHIFT;
fgetpos(f, &off);
continue;
+#endif
}
if (!check_int(p, "direct", &td->odirect)) {
fgetpos(f, &off);
#include <errno.h>
#include <assert.h>
#include <time.h>
+#include <string.h>
#include <sys/mman.h>
#include <sys/poll.h>
#include "fio.h"
#include "os.h"
-#ifdef FIO_HAVE_LIBAIO
-
-#define ev_to_iou(ev) (struct io_u *) ((unsigned long) (ev)->obj)
-
-static int fio_io_sync(struct thread_data *td)
-{
- return fsync(td->fd);
-}
-
static int fill_timespec(struct timespec *ts)
{
#ifdef _POSIX_TIMERS
return sec + nsec;
}
+static int fio_io_sync(struct thread_data *td)
+{
+ return fsync(td->fd);
+}
+
+#ifdef FIO_HAVE_LIBAIO
+
+#define ev_to_iou(ev) (struct io_u *) ((unsigned long) (ev)->obj)
+
struct libaio_data {
io_context_t aio_ctx;
struct io_event *aio_events;
if ((unsigned int) ret != io_u->buflen) {
if (ret > 0) {
io_u->resid = io_u->buflen - ret;
- io_u->error = ENODATA;
+ io_u->error = EIO;
} else
io_u->error = errno;
}
#define LIST_HEAD_INIT(name) { &(name), &(name) }
-#define LIST_HEAD(name) \
- struct list_head name = LIST_HEAD_INIT(name)
-
#define INIT_LIST_HEAD(ptr) do { \
(ptr)->next = (ptr); (ptr)->prev = (ptr); \
} while (0)
#ifndef FIO_OS_FREEBSD_H
#define FIO_OS_FREEBSD_H
+#include <sys/sysctl.h>
+
#undef FIO_HAVE_LIBAIO
#define FIO_HAVE_POSIXAIO
#undef FIO_HAVE_FADVISE
#include <string.h>
#include <sys/time.h>
#include <sys/types.h>
+#include <sys/stat.h>
#include <dirent.h>
#include <libgen.h>
#include <math.h>
#include "fio.h"
static struct itimerval itimer;
-static LIST_HEAD(disk_list);
+static struct list_head disk_list = LIST_HEAD_INIT(disk_list);
static int get_io_ticks(struct disk_util *du, struct disk_util_stat *dus)
{