summaryrefslogtreecommitdiff
path: root/parse.c
diff options
context:
space:
mode:
authorStephen M. Cameron <stephenmcameron@gmail.com>2014-09-29 12:15:35 -0600
committerJens Axboe <axboe@fb.com>2014-09-29 12:18:35 -0600
commit18722a18d75aaf487917776e077a8e61d14c8b8d (patch)
treee4128e25cd95af5d380858897c9bb453ae9a4057 /parse.c
parentb470a02cade02049509d22442addfbc88d10116e (diff)
downloadfio-18722a18d75aaf487917776e077a8e61d14c8b8d.tar.gz
fio-18722a18d75aaf487917776e077a8e61d14c8b8d.tar.bz2
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>
Diffstat (limited to 'parse.c')
-rw-r--r--parse.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/parse.c b/parse.c
index c2d1cc81..b632bf1a 100644
--- a/parse.c
+++ b/parse.c
@@ -312,8 +312,12 @@ int str_to_decimal(const char *str, long long *val, int kilo, void *data,
#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) {