Add options to have fio latency profile a device
This adds three new options:
- latency_target. This defines a specific latency target, in usec.
- latency_window. This defines the period over which fio samples.
- latency_percentile. This defines the percentage of IOs that must
meet the criteria specified by latency_target/latency_window.
With these options set, fio will run the described workload and
vary the queue depth between 1 and iodepth= to find the best
performing spot that meets the criteria specified by the three
options.
A sample job file is also added to demonstrate how to use this.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
diff --git a/parse.c b/parse.c
index e3f431e..6141c91 100644
--- a/parse.c
+++ b/parse.c
@@ -547,9 +547,11 @@
** Initialize precision to 0 and zero out list
** in case specified list is shorter than default
*/
- ul2 = 0;
- ilp = td_var(data, o->off2);
- *ilp = ul2;
+ if (o->off2) {
+ ul2 = 0;
+ ilp = td_var(data, o->off2);
+ *ilp = ul2;
+ }
flp = td_var(data, o->off1);
for(i = 0; i < o->maxlen; i++)
@@ -592,9 +594,11 @@
while (*++cp2 != '\0' && *cp2 >= '0' && *cp2 <= '9')
len++;
- ilp = td_var(data, o->off2);
- if (len > *ilp)
- *ilp = len;
+ if (o->off2) {
+ ilp = td_var(data, o->off2);
+ if (len > *ilp)
+ *ilp = len;
+ }
}
break;