use crc32 for verifies.
stonewall Wait for preceeding jobs to end before running.
numjobs=x Create 'x' similar entries for this job
+ thread Use pthreads instead of forked jobs
Examples using a job file
struct stat sb;
int numjobs;
- if (td == &def_thread)
- return 0;
+ if (td->io_engine & FIO_SYNCIO)
+ td->iodepth = 1;
+ else {
+ if (!td->iodepth)
+ td->iodepth = 1;
+ }
#ifndef FIO_HAVE_LIBAIO
if (td->io_engine == FIO_LIBAIO) {
td->ioprio = (prioclass << IOPRIO_CLASS_SHIFT) | prio;
#endif
+ /*
+ * the def_thread is just for options, it's not a real job
+ */
+ if (td == &def_thread)
+ return 0;
+
td->filetype = FIO_TYPE_FILE;
if (!stat(jobname, &sb) && S_ISBLK(sb.st_mode))
td->filetype = FIO_TYPE_BD;
td->slat_stat.min_val = ULONG_MAX;
td->bw_stat.min_val = ULONG_MAX;
- run_str[td->thread_number - 1] = 'P';
-
- if ((td->io_engine & FIO_SYNCIO) == 0) {
- if (!td->iodepth)
- td->iodepth = 1;
- }
-
if (td->min_bs == -1U)
td->min_bs = td->bs;
if (td->max_bs == -1U)
+/*
+ * The io parts of the fio tool, includes workers for sync and mmap'ed
+ * io, as well as both posix and linux libaio support.
+ *
+ * sync io is implemented on top of aio.
+ *
+ */
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
+#include <assert.h>
#include <sys/mman.h>
#include "fio.h"
#include "os.h"
static int fio_syncio_getevents(struct thread_data *td, int min, int max,
struct timespec *t)
{
+ assert(max <= 1);
+
+ /*
+ * we can only have one finished io_u for sync io, since the depth
+ * is always 1
+ */
if (list_empty(&td->io_u_busylist))
return 0;
{
struct syncio_data *sd = td->io_data;
+ assert(event == 0);
+
return sd->last_io_u;
}
int groupid = 0;
int thread_number = 0;
-char run_str[MAX_JOBS + 1];
+static char run_str[MAX_JOBS + 1];
int shm_id = 0;
static LIST_HEAD(disk_list);
+static struct itimerval itimer;
static void update_io_ticks(void);
static void disk_util_timer_arm(void);
static void disk_util_timer_arm(void)
{
- struct itimerval itimer;
-
itimer.it_value.tv_sec = 0;
itimer.it_value.tv_usec = DISK_UTIL_MSEC * 1000;
setitimer(ITIMER_REAL, &itimer, NULL);
for (i = 0; i < thread_number; i++) {
td = &threads[i];
+ run_str[td->thread_number - 1] = 'P';
+
init_disk_util(td);
if (!td->create_serialize)
int main(int argc, char *argv[])
{
- memset(run_str, 0, sizeof(run_str));
-
if (parse_options(argc, argv))
return 1;
extern int shm_id;
extern int groupid;
-extern char run_str[];
-
extern struct thread_data *threads;
enum {