-enum fio_filetype {
- FIO_TYPE_FILE = 1, /* plain file */
- FIO_TYPE_BD, /* block device */
- FIO_TYPE_CHAR, /* character device */
- FIO_TYPE_PIPE, /* pipe */
-};
-
-enum fio_ioengine_flags {
- FIO_SYNCIO = 1 << 0, /* io engine has synchronous ->queue */
- FIO_RAWIO = 1 << 1, /* some sort of direct/raw io */
- FIO_DISKLESSIO = 1 << 2, /* no disk involved */
- FIO_NOEXTEND = 1 << 3, /* engine can't extend file */
- FIO_NODISKUTIL = 1 << 4, /* diskutil can't handle filename */
- FIO_UNIDIR = 1 << 5, /* engine is uni-directional */
- FIO_NOIO = 1 << 6, /* thread does only pseudo IO */
-};
-
-enum fio_file_flags {
- FIO_FILE_OPEN = 1 << 0, /* file is open */
- FIO_FILE_CLOSING = 1 << 1, /* file being closed */
- FIO_FILE_EXISTS = 1 << 2, /* file there */
- FIO_FILE_EXTEND = 1 << 3, /* needs extend */
- FIO_FILE_NOSORT = 1 << 4, /* don't sort verify blocks */
- FIO_FILE_DONE = 1 << 5, /* io completed to this file */
- FIO_SIZE_KNOWN = 1 << 6, /* size has been set */
-};
-
-/*
- * Each thread_data structure has a number of files associated with it,
- * this structure holds state information for a single file.
- */
-struct fio_file {
- enum fio_filetype filetype;
-
- /*
- * A file may not be a file descriptor, let the io engine decide
- */
- union {
- unsigned long file_data;
- int fd;
- };
-
- /*
- * filename and possible memory mapping
- */
- char *file_name;
- void *mmap;
- unsigned int major, minor;
-
- /*
- * size of the file, offset into file, and io size from that offset
- */
- unsigned long long real_file_size;
- unsigned long long file_offset;
- unsigned long long io_size;
-
- unsigned long long last_pos;
- unsigned long long last_completed_pos;
-
- /*
- * block map for random io
- */
- unsigned long *file_map;
- unsigned int num_maps;
- unsigned int last_free_lookup;
-
- int references;
- enum fio_file_flags flags;
-};
-
-/*
- * How many depth levels to log
- */
-#define FIO_IO_U_MAP_NR 8
-#define FIO_IO_U_LAT_U_NR 10
-#define FIO_IO_U_LAT_M_NR 12
-
-struct thread_stat {
- char *name;
- char *verror;
- int error;
- int groupid;
- pid_t pid;
- char *description;
- int members;
-
- struct io_log *slat_log;
- struct io_log *clat_log;
- struct io_log *bw_log;
-
- /*
- * bandwidth and latency stats
- */
- struct io_stat clat_stat[2]; /* completion latency */
- struct io_stat slat_stat[2]; /* submission latency */
- struct io_stat bw_stat[2]; /* bandwidth stats */
-
- unsigned long long stat_io_bytes[2];
- struct timeval stat_sample_time[2];
-
- /*
- * fio system usage accounting
- */
- struct rusage ru_start;
- struct rusage ru_end;
- unsigned long usr_time;
- unsigned long sys_time;
- unsigned long ctx;
- unsigned long minf, majf;
-
- /*
- * IO depth and latency stats
- */
- unsigned int io_u_map[FIO_IO_U_MAP_NR];
- unsigned int io_u_lat_u[FIO_IO_U_LAT_U_NR];
- unsigned int io_u_lat_m[FIO_IO_U_LAT_M_NR];
- unsigned long total_io_u[2];
- unsigned long short_io_u[2];
-
- unsigned long long io_bytes[2];
- unsigned long runtime[2];
- unsigned long total_run_time;