Lines Matching refs:f
62 devname = subprocess.run(f'findmnt -nvo SOURCE -T{path}',
70 rdev = os.stat(f'/dev/{devname}').st_rdev
71 return (devname, f'{os.major(rdev)}:{os.minor(rdev)}')
79 info(f'Creating testfile {path}')
80 subprocess.check_call(f'rm -f {path}', shell=True)
81 subprocess.check_call(f'touch {path}', shell=True)
82 subprocess.call(f'chattr +C {path}', shell=True)
84 f'pv -s {size} -pr /dev/urandom {"-q" if args.quiet else ""} | '
85 f'dd of={path} count={size} '
86 f'iflag=count_bytes,fullblock oflag=direct bs=16M status=none',
94 cmd = (f'fio --direct=1 --ioengine=libaio --name=coef '
95 f'--filename={testfile} --runtime={round(duration)} '
96 f'--readwrite={iotype} --iodepth={iodepth} --blocksize={blocksize} '
97 f'--eta={eta} --output-format json --output={outfile.name} '
98 f'--time_based --numjobs={jobs}')
100 dbg(f'Running {cmd}')
102 with open(outfile.name, 'r') as f:
103 d = json.loads(f.read())
109 info(f'Restoring elevator to {elevator} and nomerges to {nomerges}')
110 with open(elevator_path, 'w') as f:
111 f.write(elevator)
112 with open(nomerges_path, 'w') as f:
113 f.write(nomerges)
121 print(f'Required command "{cmd}" is missing', file=sys.stderr)
128 rdev = os.stat(f'/dev/{devname}').st_rdev
129 devno = f'{os.major(rdev)}:{os.minor(rdev)}'
130 testfile = f'/dev/{devname}'
131 info(f'Test target: {devname}({devno})')
137 info(f'Test target: {testfile} on {devname}({devno})')
139 elevator_path = f'/sys/block/{devname}/queue/scheduler'
140 nomerges_path = f'/sys/block/{devname}/queue/nomerges'
142 with open(elevator_path, 'r') as f:
143 elevator = re.sub(r'.*\[(.*)\].*', r'\1', f.read().strip())
144 with open(nomerges_path, 'r') as f:
145 nomerges = f.read().strip()
147 info(f'Temporarily disabling elevator and merges')
149 with open(elevator_path, 'w') as f:
150 f.write('none')
151 with open(nomerges_path, 'w') as f:
152 f.write('1')
157 info(f'\nrbps={rbps}, determining rseqiops...')
160 info(f'\nrseqiops={rseqiops}, determining rrandiops...')
163 info(f'\nrrandiops={rrandiops}, determining wbps...')
166 info(f'\nwbps={wbps}, determining wseqiops...')
169 info(f'\nwseqiops={wseqiops}, determining wrandiops...')
172 info(f'\nwrandiops={wrandiops}')
177 print(f'{devno} rbps={rbps} rseqiops={rseqiops} rrandiops={rrandiops} '
178 f'wbps={wbps} wseqiops={wseqiops} wrandiops={wrandiops}')