Recent changes (master)
The following changes since commit d5c4f97458d59689c3d1a13831519617d000fb19:
arch-arm: Consider armv7ve arch as well (2019-11-05 06:41:55 -0700)
are available in the Git repository at:
git://git.kernel.dk/fio.git master
for you to fetch changes up to cc16261082a4d0f027cef9d019ad023129bf6012:
Merge branch 'testing' of https://github.com/vincentkfu/fio (2019-11-06 17:04:17 -0700)
----------------------------------------------------------------
Jens Axboe (1):
Merge branch 'testing' of https://github.com/vincentkfu/fio
Vincent Fu (12):
t/iee754: add return value
t/readonly: replace shell script with python script t/strided.py: change LFSR tests
t/steadystate_tests: better support automated testing t/sgunmap-test.py: drop six.moves dependency t/stest: non-zero exit value on failure
t/jobs: fixup t0002 test jobs
t/jobs: use current directory for test file for t0003 and t0004 t/jobs: drop time_based in t0007
t/jobs: clean up t0009 and use only 4 CPUs
t/jobs: fix t0011 syntax error
t/run-fio-tests: a script to automate running fio tests
t/ieee754.c | 15 +-
t/jobs/readonly-r.fio | 5 -
t/jobs/readonly-t.fio | 5 -
t/jobs/readonly-w.fio | 5 -
...t0002-13af05ae-post => t0002-13af05ae-post.fio} | 48 +-
.../{t0002-13af05ae-pre => t0002-13af05ae-pre.fio} | 46 +-
t/jobs/t0003-0ae2c6e1-post.fio | 2 +-
t/jobs/t0003-0ae2c6e1-pre.fio | 2 +-
t/jobs/t0004-8a99fdf6.fio | 2 +-
t/jobs/t0007-37cf9e3c.fio | 1 -
t/jobs/t0009-f8b0bd10.fio | 6 +-
t/jobs/t0011-5d2788d5.fio | 2 +-
t/readonly.py | 138 +++++
t/readonly.sh | 84 ---
t/run-fio-tests.py | 676 +++++++++++++++++++++
t/sgunmap-test.py | 1 -
t/steadystate_tests.py | 40 +-
t/stest.c | 15 +-
t/strided.py | 36 +-
19 files changed, 936 insertions(+), 193 deletions(-)
delete mode 100644 t/jobs/readonly-r.fio
delete mode 100644 t/jobs/readonly-t.fio
delete mode 100644 t/jobs/readonly-w.fio
rename t/jobs/{t0002-13af05ae-post => t0002-13af05ae-post.fio} (85%)
rename t/jobs/{t0002-13af05ae-pre => t0002-13af05ae-pre.fio} (85%)
create mode 100755 t/readonly.py
delete mode 100755 t/readonly.sh
create mode 100755 t/run-fio-tests.py---
Diff of recent changes:
t/ieee754.c +10 -5
@@ -1,21 +1,26 @@#include <stdio.h> #include "../lib/ieee754.h" -static double values[] = {-17.23 ,17.23 ,123.4567 ,98765.4321 ,0.0 }; +static double values[] = {-17.23 ,17.23 ,123.4567 ,98765.4321 , +3.14159265358979323 ,0.0 };int main (int argc,char *argv[]) {uint64_t i; -double f; -int j; +double f, delta; +int j, differences =0 ; j =0 ;do { i =fio_double_to_uint64 (values[j]); f =fio_uint64_to_double (i); -printf ("%f -> %f\n" , values[j], f); + delta = values[j] - f; +printf ("%26.20lf -> %26.20lf, delta = %26.20lf\n" , values[j], + f, delta); +if (f != values[j]) + differences++; j++; }while (values[j] !=0.0 ); -return 0 ; +return differences; }
t/jobs/readonly-r.fio deleted +0 -5
@@ -1,5 +0,0 @@ -[test] -filename=${DUT} -rw=randread -time_based -runtime=1s
t/jobs/readonly-t.fio deleted +0 -5
@@ -1,5 +0,0 @@ -[test] -filename=${DUT} -rw=randtrim -time_based -runtime=1s
t/jobs/readonly-w.fio deleted +0 -5
@@ -1,5 +0,0 @@ -[test] -filename=${DUT} -rw=randwrite -time_based -runtime=1s
t/jobs/t0002-13af05ae-post.fio renamed from t/jobs/t0002-13af05ae-post +24 -24
48 lines not on this page · raw message
t/jobs/t0002-13af05ae-pre.fio renamed from t/jobs/t0002-13af05ae-pre +23 -23
46 lines not on this page · raw message
t/jobs/t0003-0ae2c6e1-post.fio +1 -1
@@ -3,7 +3,7 @@ [global] ioengine=libaio direct=1 -filename=/tmp/foo +filename=foo iodepth=128 size=1M loops=1
t/jobs/t0003-0ae2c6e1-pre.fio +1 -1
@@ -1,7 +1,7 @@ [global] ioengine=libaio direct=1 -filename=/tmp/foo +filename=foo iodepth=128 size=10M loops=1
t/jobs/t0004-8a99fdf6.fio +1 -1
@@ -3,7 +3,7 @@ [global] ioengine=libaio direct=1 -filename=/tmp/foo +filename=foo iodepth=128 size=10M loops=1
t/jobs/t0007-37cf9e3c.fio +0 -1
@@ -4,7 +4,6 @@ size=128mb rw=read:512k bs=1m -time_based norandommap write_iolog=log direct=1
t/jobs/t0009-f8b0bd10.fio +3 -3
@@ -16,21 +16,21 @@ numjobs=1 #numjobs=24 # number_ios=1 # runtime=216000 -runtime=3600 +#runtime=3600 time_based=1 group_reporting=1 thread gtod_reduce=1 iodepth_batch=4 iodepth_batch_complete=4 -cpus_allowed=0-5 +cpus_allowed=0-3 cpus_allowed_policy=split rw=randwrite verify=crc32c-intel verify_backlog=1m do_verify=1 verify_async=6 -verify_async_cpus=0-5 +verify_async_cpus=0-3 runtime=1m [4_KiB_RR_drive_r]
t/jobs/t0011-5d2788d5.fio +1 -1
@@ -1,7 +1,7 @@ # Expected results: no parse warnings, runs and with roughly 1/8 iops between # the two jobs. # Buggy result: parse warning on flow value overflow, no 1/8 division between - jobs. +# jobs. # [global] bs=4k
t/readonly.py new file +138 -0
138 lines not on this page · raw message
t/readonly.sh deleted +0 -84
84 lines not on this page · raw message
t/run-fio-tests.py new file +676 -0
676 lines not on this page · raw message
t/sgunmap-test.py +0 -1
@@ -45,7 +45,6 @@ import json import argparse import traceback import subprocess -from six.moves import range def parse_args():
t/steadystate_tests.py +30 -10
@@ -1,5 +1,5 @@ -#!/usr/bin/python2.7 -# Note: this script is python2 and python 3 compatible. +#!/usr/bin/env python +# Note: this script is python2 and python3 compatible. # # steadystate_tests.py #
@@ -24,12 +24,10 @@ from __future__ import print_function import os import sys import json -import uuid import pprint import argparse import subprocess from scipy import stats -from six.moves import range def parse_args(): parser = argparse.ArgumentParser()
@@ -53,7 +51,7 @@ def check(data, iops, slope, pct, limit, dur, criterion): m, intercept, r_value, p_value, std_err = stats.linregress(x,data) m = abs(m) if pct: - target = m / mean * 100 + target = (m / mean * 100) if mean != 0 else 0 criterion = criterion[:-1] else: target = m
@@ -68,7 +66,11 @@ def check(data, iops, slope, pct, limit, dur, criterion): target = maxdev criterion = float(criterion) - return (abs(target - criterion) / criterion < 0.005), target < limit, mean, target + if criterion == 0.0: + objsame = False + else: + objsame = abs(target - criterion) / criterion < 0.005 + return (objsame, target < limit, mean, target) if __name__ == '__main__':
@@ -76,6 +78,9 @@ if __name__ == '__main__': pp = pprint.PrettyPrinter(indent=4) + passed = 0 + failed = 0 + # # test option parsing #
@@ -96,8 +101,10 @@ if __name__ == '__main__': output = subprocess.check_output([args.fio] + test['args']) if test['output'] in output.decode(): print("PASSED '{0}' found with arguments {1}".format(test['output'], test['args'])) + passed = passed + 1 else: print("FAILED '{0}' NOT found with arguments {1}".format(test['output'], test['args'])) + failed = failed + 1 # # test some read workloads
@@ -119,7 +126,7 @@ if __name__ == '__main__': if args.read == None: if os.name == 'posix': args.read = '/dev/zero' - extra = [ "--size=134217728" ] # 128 MiB + extra = [ "--size=128M" ] else: print("ERROR: file for read testing must be specified on non-posix systems") sys.exit(1)
@@ -129,7 +136,7 @@ if __name__ == '__main__': jobnum = 0 for job in reads: - tf = uuid.uuid4().hex + tf = "steadystate_job{0}.json".format(jobnum) parameters = [ "--name=job{0}".format(jobnum) ] parameters.extend(extra) parameters.extend([ "--thread",
@@ -160,10 +167,10 @@ if __name__ == '__main__': output = subprocess.call([args.fio] + parameters) with open(tf, 'r') as source: jsondata = json.loads(source.read()) - os.remove(tf) + source.close() for jsonjob in jsondata['jobs']: - line = "job {0}".format(jsonjob['job options']['name']) + line = "{0}".format(jsonjob['job options']['name']) if job['s']: if jsonjob['steadystate']['attained'] == 1: # check runtime >= ss_dur + ss_ramp, check criterion, check criterion < limit
@@ -171,6 +178,7 @@ if __name__ == '__main__': actual = jsonjob['read']['runtime'] if mintime > actual: line = 'FAILED ' + line + ' ss attained, runtime {0} < ss_dur {1} + ss_ramp {2}'.format(actual, job['ss_dur'], job['ss_ramp']) + failed = failed + 1 else: line = line + ' ss attained, runtime {0} > ss_dur {1} + ss_ramp {2},'.format(actual, job['ss_dur'], job['ss_ramp']) objsame, met, mean, target = check(data=jsonjob['steadystate']['data'],
@@ -182,11 +190,14 @@ if __name__ == '__main__': criterion=jsonjob['steadystate']['criterion']) if not objsame: line = 'FAILED ' + line + ' fio criterion {0} != calculated criterion {1} '.format(jsonjob['steadystate']['criterion'], target) + failed = failed + 1 else: if met: line = 'PASSED ' + line + ' target {0} < limit {1}'.format(target, job['ss_limit']) + passed = passed + 1 else: line = 'FAILED ' + line + ' target {0} < limit {1} but fio reports ss not attained '.format(target, job['ss_limit']) + failed = failed + 1 else: # check runtime, confirm criterion calculation, and confirm that criterion was not met expected = job['timeout'] * 1000
@@ -205,22 +216,31 @@ if __name__ == '__main__': if not objsame: if actual > (job['ss_dur'] + job['ss_ramp'])*1000: line = 'FAILED ' + line + ' fio criterion {0} != calculated criterion {1} '.format(jsonjob['steadystate']['criterion'], target) + failed = failed + 1 else: line = 'PASSED ' + line + ' fio criterion {0} == 0.0 since ss_dur + ss_ramp has not elapsed '.format(jsonjob['steadystate']['criterion']) + passed = passed + 1 else: if met: line = 'FAILED ' + line + ' target {0} < threshold {1} but fio reports ss not attained '.format(target, job['ss_limit']) + failed = failed + 1 else: line = 'PASSED ' + line + ' criterion {0} > threshold {1}'.format(target, job['ss_limit']) + passed = passed + 1 else: expected = job['timeout'] * 1000 actual = jsonjob['read']['runtime'] if abs(expected - actual) < 10: result = 'PASSED ' + passed = passed + 1 else: result = 'FAILED ' + failed = failed + 1 line = result + line + ' no ss, expected runtime {0} ~= actual runtime {1}'.format(expected, actual) print(line) if 'steadystate' in jsonjob: pp.pprint(jsonjob['steadystate']) jobnum += 1 + + print("{0} test(s) PASSED, {1} test(s) FAILED".format(passed,failed)) + sys.exit(failed)
t/stest.c +10 -5
@@ -25,7 +25,7 @@ static FLIST_HEAD(list);static int do_rand_allocs (void ) { -unsigned int size, nr, rounds =0 ; +unsigned int size, nr, rounds =0 , ret =0 ;unsigned long total;struct elem *e;bool error;
@@ -41,6 +41,7 @@ static int do_rand_allocs(void) e =smalloc (size);if (!e) {printf ("fail at %lu, size %u\n" , total, size); + ret++;break ; } e->magic1 =MAGIC1 ;
@@ -65,6 +66,7 @@ static int do_rand_allocs(void) e =smalloc (LARGESMALLOC );if (!e) { error = true; + ret++;printf ("failure allocating %u bytes at %lu allocated during sfree phase\n" ,LARGESMALLOC , total); }
@@ -74,18 +76,21 @@ static int do_rand_allocs(void) } } -return 0 ; +return ret; }int main (int argc,char *argv[]) { +int ret; +arch_init (argv);sinit ();debug_init (); -do_rand_allocs (); -smalloc_debug (0 );/* free and total blocks should match */ + ret =do_rand_allocs (); +smalloc_debug (0 );/* TODO: check that free and total blocks +** match */ scleanup (); -return 0 ; +return ret; }
t/strided.py +18 -18
@@ -202,20 +202,20 @@ if __name__ == '__main__': # lfsr { "random_generator": "lfsr", - "zonerange": 4096, - "zonesize": 4096, + "zonerange": 4096*1024, + "zonesize": 4096*1024, "bs": 4096, - "offset": 8*4096, - "size": 16*4096, - "io_size": 16*4096, + "offset": 8*4096*1024, + "size": 16*4096*1024, + "io_size": 16*4096*1024, }, { "random_generator": "lfsr", - "zonerange": 4096, - "zonesize": 4096, + "zonerange": 4096*1024, + "zonesize": 4096*1024, "bs": 4096, - "size": 16*4096, - "io_size": 16*4096, + "size": 16*4096*1024, + "io_size": 16*4096*1024, }, { "random_generator": "lfsr",
@@ -227,11 +227,11 @@ if __name__ == '__main__': }, { "random_generator": "lfsr", - "zonerange": 4096, - "zonesize": 4*4096, + "zonerange": 4096*1024, + "zonesize": 4*4096*1024, "bs": 4096, - "size": 16*4096, - "io_size": 16*4096, + "size": 16*4096*1024, + "io_size": 16*4096*1024, }, { "random_generator": "lfsr",
@@ -243,11 +243,11 @@ if __name__ == '__main__': }, { "random_generator": "lfsr", - "zonerange": 8192, - "zonesize": 4096, + "zonerange": 8192*1024, + "zonesize": 4096*1024, "bs": 4096, - "size": 16*4096, - "io_size": 16*4096, + "size": 16*4096*1024, + "io_size": 16*4096*1024, }, { "random_generator": "lfsr",
@@ -313,7 +313,7 @@ if __name__ == '__main__': "zonesize": 8*1024*1024, "bs": 4096, "size": 256*1024*1024, - "io_size": 256*1024*204, + "io_size": 256*1024*1024, }, ]