unsigned int bs;
int fileno;
+ if (td->o.replay_skip & (1u << DDIR_TRIM))
+ return;
+
ipo = calloc(1, sizeof(*ipo));
init_ipo(ipo);
fileno = trace_add_file(td, t->device, &bs);
rw = (t->action & BLK_TC_ACT(BLK_TC_WRITE)) != 0;
+ if (rw) {
+ if (td->o.replay_skip & (1u << DDIR_WRITE))
+ return;
+ } else {
+ if (td->o.replay_skip & (1u << DDIR_READ))
+ return;
+ }
+
assert(t->bytes);
if (t->bytes > rw_bs[rw])
unsigned int bs;
int fileno;
+ if (td->o.replay_skip & (1u << DDIR_SYNC))
+ return;
+
ipo = calloc(1, sizeof(*ipo));
init_ipo(ipo);
fileno = trace_add_file(td, t->device, &bs);
o->replay_align = le32_to_cpu(top->replay_align);
o->replay_scale = le32_to_cpu(top->replay_scale);
o->replay_time_scale = le32_to_cpu(top->replay_time_scale);
+ o->replay_skip = le32_to_cpu(top->replay_skip);
o->per_job_logs = le32_to_cpu(top->per_job_logs);
o->write_bw_log = le32_to_cpu(top->write_bw_log);
o->write_lat_log = le32_to_cpu(top->write_lat_log);
top->replay_align = cpu_to_le32(o->replay_align);
top->replay_scale = cpu_to_le32(o->replay_scale);
top->replay_time_scale = cpu_to_le32(o->replay_time_scale);
+ top->replay_skip = cpu_to_le32(o->replay_skip);
top->per_job_logs = cpu_to_le32(o->per_job_logs);
top->write_bw_log = cpu_to_le32(o->write_bw_log);
top->write_lat_log = cpu_to_le32(o->write_lat_log);
}
+static int str_replay_skip_cb(void *data, const char *input)
+{
+ struct thread_data *td = cb_data_to_td(data);
+ char *str, *p, *n;
+ int ret = 0;
+
+ if (parse_dryrun())
+ return 0;
+
+ p = str = strdup(input);
+
+ strip_blank_front(&str);
+ strip_blank_end(str);
+
+ while (p) {
+ n = strchr(p, ',');
+ if (n)
+ *n++ = '\0';
+ if (!strcmp(p, "read"))
+ td->o.replay_skip |= 1u << DDIR_READ;
+ else if (!strcmp(p, "write"))
+ td->o.replay_skip |= 1u << DDIR_WRITE;
+ else if (!strcmp(p, "trim"))
+ td->o.replay_skip |= 1u << DDIR_TRIM;
+ else if (!strcmp(p, "sync"))
+ td->o.replay_skip |= 1u << DDIR_SYNC;
+ else {
+ log_err("Unknown skip type: %s\n", p);
+ ret = 1;
+ break;
+ }
+ p = n;
+ }
+ free(str);
+ return ret;
+}
+
static int str_ignore_error_cb(void *data, const char *input)
{
struct thread_data *td = cb_data_to_td(data);
.category = FIO_OPT_C_IO,
.group = FIO_OPT_G_IOLOG,
},
+ {
+ .name = "replay_skip",
+ .lname = "Replay Skip",
+ .type = FIO_OPT_STR,
+ .cb = str_replay_skip_cb,
+ .off1 = offsetof(struct thread_options, replay_skip),
+ .parent = "read_iolog",
+ .help = "Skip certain IO types (read,write,trim,flush)",
+ .category = FIO_OPT_C_IO,
+ .group = FIO_OPT_G_IOLOG,
+ },
{
.name = "exec_prerun",
.lname = "Pre-execute runnable",
};
enum {
- FIO_SERVER_VER = 72,
+ FIO_SERVER_VER = 73,
FIO_SERVER_MAX_FRAGMENT_PDU = 1024,
FIO_SERVER_MAX_CMD_MB = 2048,
unsigned int replay_align;
unsigned int replay_scale;
unsigned int replay_time_scale;
+ unsigned int replay_skip;
unsigned int per_job_logs;
uint32_t replay_align;
uint32_t replay_scale;
uint32_t replay_time_scale;
+ uint32_t replay_skip;
uint32_t per_job_logs;