o->override_sync = le32_to_cpu(top->override_sync);
o->rand_repeatable = le32_to_cpu(top->rand_repeatable);
o->use_os_rand = le32_to_cpu(top->use_os_rand);
- o->write_lat_log = le32_to_cpu(top->write_lat_log);
- o->write_bw_log = le32_to_cpu(top->write_bw_log);
- o->write_iops_log = le32_to_cpu(top->write_iops_log);
o->log_avg_msec = le32_to_cpu(top->log_avg_msec);
o->norandommap = le32_to_cpu(top->norandommap);
o->softrandommap = le32_to_cpu(top->softrandommap);
top->override_sync = cpu_to_le32(o->override_sync);
top->rand_repeatable = cpu_to_le32(o->rand_repeatable);
top->use_os_rand = cpu_to_le32(o->use_os_rand);
- top->write_lat_log = cpu_to_le32(o->write_lat_log);
- top->write_bw_log = cpu_to_le32(o->write_bw_log);
- top->write_iops_log = cpu_to_le32(o->write_iops_log);
top->log_avg_msec = cpu_to_le32(o->log_avg_msec);
top->norandommap = cpu_to_le32(o->norandommap);
top->softrandommap = cpu_to_le32(o->softrandommap);
}
#endif
-#ifdef FIO_HAVE_TRIM
-static int str_verify_trim_cb(void *data, unsigned long long *val)
-{
- struct thread_data *td = data;
-
- td->o.trim_percentage = *val;
- return 0;
-}
-#endif
-
static int str_fst_cb(void *data, const char *str)
{
struct thread_data *td = data;
}
#endif
-static int check_dir(struct thread_data *td, char *fname)
-{
-#if 0
- char file[PATH_MAX], *dir;
- int elen = 0;
-
- if (td->o.directory) {
- strcpy(file, td->o.directory);
- strcat(file, "/");
- elen = strlen(file);
- }
-
- sprintf(file + elen, "%s", fname);
- dir = dirname(file);
-
- {
- struct stat sb;
- /*
- * We can't do this on FIO_DISKLESSIO engines. The engine isn't loaded
- * yet, so we can't do this check right here...
- */
- if (lstat(dir, &sb) < 0) {
- int ret = errno;
-
- log_err("fio: %s is not a directory\n", dir);
- td_verror(td, ret, "lstat");
- return 1;
- }
-
- if (!S_ISDIR(sb.st_mode)) {
- log_err("fio: %s is not a directory\n", dir);
- return 1;
- }
- }
-#endif
-
- return 0;
-}
-
/*
* Return next file in the string. Files are separated with ':'. If the ':'
* is escaped with a '\', then that ':' is part of the filename and does not
while ((fname = get_next_file_name(&str)) != NULL) {
if (!strlen(fname))
break;
- if (check_dir(td, fname)) {
- free(p);
- return 1;
- }
add_file(td, fname);
td->o.nr_files++;
}
return add_dir_files(td, td->o.opendir);
}
-static int str_verify_offset_cb(void *data, unsigned long long *off)
-{
- struct thread_data *td = data;
-
- if (*off && *off < sizeof(struct verify_header)) {
- log_err("fio: verify_offset too small\n");
- return 1;
- }
-
- td->o.verify_offset = *off;
- return 0;
-}
-
static int str_verify_pattern_cb(void *data, const char *input)
{
struct thread_data *td = data;
return 0;
}
-static int str_write_bw_log_cb(void *data, const char *str)
-{
- struct thread_data *td = data;
-
- if (str)
- td->o.bw_log_file = strdup(str);
-
- td->o.write_bw_log = 1;
- return 0;
-}
-
-static int str_write_lat_log_cb(void *data, const char *str)
-{
- struct thread_data *td = data;
-
- if (str)
- td->o.lat_log_file = strdup(str);
-
- td->o.write_lat_log = 1;
- return 0;
-}
-
-static int str_write_iops_log_cb(void *data, const char *str)
-{
- struct thread_data *td = data;
-
- if (str)
- td->o.iops_log_file = strdup(str);
-
- td->o.write_iops_log = 1;
- return 0;
-}
-
static int str_gtod_reduce_cb(void *data, int *il)
{
struct thread_data *td = data;
.lname = "Verify offset",
.type = FIO_OPT_INT,
.help = "Offset verify header location by N bytes",
- .def = "0",
- .cb = str_verify_offset_cb,
+ .off1 = td_var_offset(verify_offset),
+ .minval = sizeof(struct verify_header),
.parent = "verify",
.hide = 1,
.category = FIO_OPT_C_IO,
.name = "trim_percentage",
.lname = "Trim percentage",
.type = FIO_OPT_INT,
- .cb = str_verify_trim_cb,
+ .off1 = td_var_offset(trim_percentage),
.minval = 0,
.maxval = 100,
.help = "Number of verify blocks to discard/trim",
{
.name = "write_bw_log",
.lname = "Write bandwidth log",
- .type = FIO_OPT_STR,
- .off1 = td_var_offset(write_bw_log),
- .cb = str_write_bw_log_cb,
+ .type = FIO_OPT_STR_STORE,
+ .off1 = td_var_offset(bw_log_file),
.help = "Write log of bandwidth during run",
.category = FIO_OPT_C_LOG,
.group = FIO_OPT_G_INVALID,
{
.name = "write_lat_log",
.lname = "Write latency log",
- .type = FIO_OPT_STR,
- .off1 = td_var_offset(write_lat_log),
- .cb = str_write_lat_log_cb,
+ .type = FIO_OPT_STR_STORE,
+ .off1 = td_var_offset(lat_log_file),
.help = "Write log of latency during run",
.category = FIO_OPT_C_LOG,
.group = FIO_OPT_G_INVALID,
.name = "write_iops_log",
.lname = "Write IOPS log",
.type = FIO_OPT_STR,
- .off1 = td_var_offset(write_iops_log),
- .cb = str_write_iops_log_cb,
+ .off1 = td_var_offset(iops_log_file),
.help = "Write log of IOPS during run",
.category = FIO_OPT_C_LOG,
.group = FIO_OPT_G_INVALID,