a number of IO's to do before getting a new offset, this is
one by appending a ':<nr>' to the end of the string given.
For a random read, it would look like 'rw=randread:8' for
- passing in an offset modifier with a value of 8. See the
- 'rw_sequencer' option.
+ passing in an offset modifier with a value of 8. If the
+ postfix is used with a sequential IO pattern, then the value
+ specified will be added to the generated offset for each IO.
+ For instance, using rw=write:4k will skip 4k for every
+ write. It turns sequential IO into sequential IO with holes.
+ See the 'rw_sequencer' option.
rw_sequencer=str If an offset modifier is given by appending a number to
the rw=<str> line, then this option controls how that
specify a number of IO's to do before getting a new offset, this is one by
appending a `:\fI<nr>\fR to the end of the string given. For a random read, it
would look like \fBrw=randread:8\fR for passing in an offset modifier with a
-value of 8. See the \fBrw_sequencer\fR option.
+value of 8. If the postfix is used with a sequential IO pattern, then the value
+specified will be added to the generated offset for each IO. For instance,
+using \fBrw=write:4k\fR will skip 4k for every write. It turns sequential IO
+into sequential IO with holes. See the \fBrw_sequencer\fR option.
.RE
.TP
.BI rw_sequencer \fR=\fPstr
unsigned int rw_seq;
unsigned int kb_base;
unsigned int ddir_seq_nr;
+ unsigned long ddir_seq_add;
unsigned int iodepth;
unsigned int iodepth_low;
unsigned int iodepth_batch;
assert(ddir_rw(ddir));
if (f->last_pos < f->real_file_size) {
- *b = (f->last_pos - f->file_offset) / td->o.min_bs[ddir];
+ unsigned long long pos = f->last_pos - f->file_offset;
+
+ if (pos)
+ pos += td->o.ddir_seq_add;
+
+ *b = pos / td->o.min_bs[ddir];
return 0;
}
char *nr = get_opt_postfix(str);
td->o.ddir_seq_nr = 1;
- if (nr) {
+ td->o.ddir_seq_add = 0;
+
+ if (!nr)
+ return 0;
+
+ if (td_random(td))
td->o.ddir_seq_nr = atoi(nr);
- free(nr);
+ else {
+ long long val;
+
+ if (str_to_decimal(nr, &val, 1, td)) {
+ log_err("fio: rw postfix parsing failed\n");
+ free(nr);
+ return 1;
+ }
+
+ td->o.ddir_seq_add = val;
}
+ free(nr);
return 0;
}