fio: support suffixes in expression parser
Note that time values in expressions by default have units of microseconds
Signed-off-by: Stephen M. Cameron <stephenmcameron@gmail.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
diff --git a/parse.c b/parse.c
index c2d1cc8..b632bf1 100644
--- a/parse.c
+++ b/parse.c
@@ -312,8 +312,12 @@
#ifdef CONFIG_ARITHMETIC
if (str[0] == '(')
rc = evaluate_arithmetic_expression(str, &ival, &dval);
- if (str[0] == '(' && !rc)
- *val = ival;
+ if (str[0] == '(' && !rc) {
+ if (!kilo && is_seconds)
+ *val = ival / 1000000LL;
+ else
+ *val = ival;
+ }
#endif
if (rc == 1) {