been read. The two zone options can be used to only do
io on zones of a file.
-write_iolog=str Write the issued io patterns to the specified file. See iolog.
+write_iolog=str Write the issued io patterns to the specified file. See
+ read_iolog.
-iolog=str Open an iolog with the specified file name and replay the
+read_iolog=str Open an iolog with the specified file name and replay the
io patterns it contains. This can be used to store a
workload and replay it sometime later.
} else if (td->cpuload > 100)
td->cpuload = 100;
- td->read_iolog = td->write_iolog = 0;
td->nr_files = 0;
return 0;
finish_log(td, td->slat_log, "slat");
if (td->clat_log)
finish_log(td, td->clat_log, "clat");
- if (td->write_iolog)
+ if (td->write_iolog_file)
write_iolog_close(td);
if (td->exec_postrun)
system(td->exec_postrun);
os_cpu_mask_t cpumask;
unsigned int iolog;
unsigned int read_iolog;
- unsigned int write_iolog;
unsigned int rwmixcycle;
unsigned int rwmixread;
unsigned int rwmixwrite;
unsigned int nice;
- char *iolog_file;
+ char *read_iolog_file;
+ char *write_iolog_file;
void *iolog_buf;
FILE *iolog_f;
},
{
.name = "write_iolog",
- .type = FIO_OPT_INT,
- .off1 = td_var_offset(write_iolog),
+ .type = FIO_OPT_STR_STORE,
+ .off1 = td_var_offset(write_iolog_file),
},
{
- .name = "iolog",
+ .name = "read_iolog",
.type = FIO_OPT_STR_STORE,
- .off1 = td_var_offset(iolog),
+ .off1 = td_var_offset(read_iolog_file),
},
{
.name = "exec_prerun",
if (!td->rwmixread && td->rwmixwrite)
td->rwmixread = 100 - td->rwmixwrite;
- if (td->iolog && !td->write_iolog)
- td->read_iolog = 1;
+ if (td->write_iolog_file && td->read_iolog_file) {
+ log_err("fio: read iolog overrides write_iolog\n");
+ free(td->write_iolog_file);
+ td->write_iolog_file = NULL;
+ }
}
/*
/*
* If using a write iolog, store this entry.
*/
- if (td->write_iolog)
+ if (td->write_iolog_file)
write_iolog_put(td, io_u);
io_u->file = f;
FILE *f;
int rw, reads, writes;
- f = fopen(td->iolog_file, "r");
+ f = fopen(td->read_iolog_file, "r");
if (!f) {
perror("fopen read iolog");
return 1;
*/
static int init_iolog_write(struct thread_data *td)
{
- FILE *f = fopen(td->iolog_file, "w");
+ FILE *f;
- f = fopen(td->iolog_file, "w");
+ f = fopen(td->write_iolog_file, "w+");
if (!f) {
perror("fopen write iolog");
return 1;
{
int ret = 0;
- if (td->read_iolog)
+ if (td->read_iolog_file)
ret = init_iolog_read(td);
- else if (td->write_iolog)
+ else if (td->write_iolog_file)
ret = init_iolog_write(td);
return 0;