1、FIO中大概的10流程是这样的:
(1).FIO 根据在command line 中得到的options,经过 parse command line,把
相关参数填充到到 struct thread_options
(2).在do_io 中,调用get_io_u 填充 struct io_u,并且发送到 backend(libaio)去
prepare aio的 io unit单位(iocb)
2、FIO中常用的结构体大概有以下多种:
fio/fio.h:
struct thread_data {
struct flist_head opt_list;
unsigned long flags;
struct thread_options o;
void *eo;
pthread_t thread;
}
该结构体接收由 command line 传递的参数,将参数进行解析后生成对应的工作任务,
则该结构体统计单个任务的latency/IOPS/BW 等信息;简而言之,该结构体描述以一个线程
或进程为单位的fio job
fio/fio/io_u.h:
struct io_u {
struct timespec start_time;
struct timespec issue_time;
**struct fio_file *file;
unsigned int flags;
enum fio_ddir ddir;
}
该结构体是一个io request unit的描述符,主要用来管理由 command line 传递下来的参数
所生成的 io request,用于输出fio打印出的I0请求,并分发到对应的IO引擎。
fio_file(file.h):
struct fio_file{
struct flist_head hash_list;
enum fio_filetype filetype;
int fd;
int sh